diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2011-09-28 02:44:56 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2011-09-28 02:44:56 +0000 |
| commit | d5822e35e7e3bde39b9c3db0547ac7b4d00a13d5 (patch) | |
| tree | 02a8576c1405f986fd8bace7843200eec6d2bb8c | |
| parent | 4de066bd0eafea75bd897dcc2313108f46d3dd8d (diff) | |
STR 2711: fitting Menu_Button label text into the part that does not have the pulldown symbol. This does not fix clipping: if a label is too big, it's still ugly (and too big)!
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@9070 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Menu_Button.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_Menu_Button.cxx b/src/Fl_Menu_Button.cxx index f77035697..9f7bf6d8c 100644 --- a/src/Fl_Menu_Button.cxx +++ b/src/Fl_Menu_Button.cxx @@ -25,13 +25,13 @@ static Fl_Menu_Button *pressed_menu_button_ = 0; void Fl_Menu_Button::draw() { if (!box() || type()) return; - draw_box(pressed_menu_button_ == this ? fl_down(box()) : box(), color()); - draw_label(); - if (Fl::focus() == this) draw_focus(); - // ** if (box() == FL_FLAT_BOX) return; // for XForms compatibility int H = (labelsize()-3)&-2; int X = x()+w()-H*2; int Y = y()+(h()-H)/2; + draw_box(pressed_menu_button_ == this ? fl_down(box()) : box(), color()); + draw_label(x(), y(), X-x()+2, h()); + if (Fl::focus() == this) draw_focus(); + // ** if (box() == FL_FLAT_BOX) return; // for XForms compatibility fl_color(active_r() ? FL_DARK3 : fl_inactive(FL_DARK3)); fl_line(X+H/2, Y+H, X, Y, X+H, Y); fl_color(active_r() ? FL_LIGHT3 : fl_inactive(FL_LIGHT3)); |
