diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-11-23 15:18:19 +0100 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2022-11-23 15:21:34 +0100 |
| commit | b684f70ad75701f3d3436157b75c6f2650d6a97b (patch) | |
| tree | 679e80a089c3af08044c4e312668a88cd5e79c23 /src/Fl_Menu.cxx | |
| parent | 5e4643621b252c36f2cd04bbb066dcae596473bb (diff) | |
Update remaining "arrow drawing" in menus
Use the new standard arrow drawing methods (whose style depends on
the active scheme) for "arrows" used in Fl_Menu and Fl_Menu_Button.
To do: maybe we need some "fine tuning" of arrow sizes in some of
the modified widgets using the new "arrow drawing" methods.
Diffstat (limited to 'src/Fl_Menu.cxx')
| -rw-r--r-- | src/Fl_Menu.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx index f2d19a7a8..6e6d26da9 100644 --- a/src/Fl_Menu.cxx +++ b/src/Fl_Menu.cxx @@ -476,6 +476,10 @@ void menuwindow::autoscroll(int n) { void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int eraseit) { if (!m) return; // this happens if -1 is selected item and redrawn + // FIXME: size and coordinate calculation (sz, x1, y1) should be simplified when + // the "old code" below is entirely removed (left as is for comparison). + // AlbrechtS Nov. 23, 2022 + int BW = Fl::box_dx(box()); int xx = BW; int W = w(); @@ -496,8 +500,17 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int eraseit) { int sz = (hh-7)&-2; int y1 = yy+(hh-sz)/2; int x1 = xx+ww-sz-3; - // FIXME_ARROW: use fl_draw_arrow() + +#if (0) // old code, independent of active scheme (left for comparison) + fl_polygon(x1+2, y1, x1+2, y1+sz, x1+sz/2+2, y1+sz/2); + +#else // right arrow whose style dependends on the active scheme + + fl_draw_arrow(Fl_Rect(x1-1, y1-1, sz+2, sz+2), FL_ARROW_SINGLE, FL_ORIENT_RIGHT, fl_color()); + +#endif + } else if (m->shortcut_) { Fl_Font f = m->labelsize_ || m->labelfont_ ? (Fl_Font)m->labelfont_ : button ? button->textfont() : FL_HELVETICA; |
