{
BC_Resources *resources = get_resources();
int l = margin >= 0 ? margin : resources->popupmenu_margin;
- int r = use_title < 0 ? l : resources->popupmenu_triangle_margin;
+ int r = use_title < 0 ? l : l + resources->popupmenu_triangle_margin;
return l + text_width + r;
}
return margin;
}
-int BC_PopupMenu::draw_face(int dx)
+int BC_PopupMenu::draw_face(int dx, int color)
{
if( !use_title ) return 0;
draw_3segmenth(0, 0, w, images[status]);
// Overlay text
- set_color(get_resources()->popup_title_text);
+ if( color < 0 ) color = get_resources()->popup_title_text;
+ set_color(color);
+
int offset = status == BUTTON_DN ? 1 : 0;
int available_w = get_w() - calculate_w(margin, 0, use_title);
get_h()/2 - icon->get_h()/2 + offset);
}
- if( use_title >= 0 )
- draw_triangle_down_flat(available_w + margin,
- get_h()/2 - TRIANGLE_H/2, TRIANGLE_W, TRIANGLE_H);
+ if( use_title >= 0 ) {
+ int tx = get_w() - margin - get_resources()->popupmenu_triangle_margin;
+ int ty = get_h()/2 - TRIANGLE_H/2;
+ draw_triangle_down_flat(tx, ty, TRIANGLE_W, TRIANGLE_H);
+ }
return 1;
}
int BC_PopupMenu::draw_title(int flush)
{
- draw_face(0);
+ draw_face(0, -1);
flash(flush);
return 0;
}
popup_down = 1;
if( use_title ) draw_title(1);
}
+ else
+ deactivate_menu();
return 1;
}
int BC_PopupMenu::button_press_event()
{
int result = 0;
- if( get_buttonpress() == 1 &&
- is_event_win() &&
- use_title ) {
+ if( get_buttonpress() == 1 && is_event_win() && use_title ) {
top_level->hide_tooltip();
if( status == BUTTON_HI || status == BUTTON_UP ) status = BUTTON_DN;
activate_menu();