summaryrefslogtreecommitdiff
path: root/src/Fl_Menu.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-11-24 19:00:00 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-11-25 00:00:48 +0100
commitb1ba37c5ba1df543baa87d328805af34da4bd2b1 (patch)
tree01d6ff63843cd9ed1f58fd2ab201f462bf11a385 /src/Fl_Menu.cxx
parent40f376a6f707e6c5ae69c0f73300575bd79e28e3 (diff)
Add "Oxy" scheme (STR 2675, STR 3477)
This commit is similar to the patch given in STR 3477, oxy_v5.diff: https://www.fltk.org/strfiles/3477/oxy_v5.diff ... with modifications, and updated to current FLTK code.
Diffstat (limited to 'src/Fl_Menu.cxx')
-rw-r--r--src/Fl_Menu.cxx21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 6e6d26da9..77b48499e 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -476,10 +476,6 @@ 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();
@@ -497,19 +493,14 @@ void menuwindow::drawentry(const Fl_Menu_Item* m, int n, int eraseit) {
// the shortcuts and arrows assume fl_color() was left set by draw():
if (m->submenu()) {
- int sz = (hh-7)&-2;
- int y1 = yy+(hh-sz)/2;
- int x1 = xx+ww-sz-3;
-
-#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
+ // calculate the bounding box of the submenu pointer (arrow)
+ int sz = (hh-2) & -2;
+ int x1 = xx + ww - sz - 2;
+ int y1 = yy + (hh-sz)/2 + 1;
- fl_draw_arrow(Fl_Rect(x1-1, y1-1, sz+2, sz+2), FL_ARROW_SINGLE, FL_ORIENT_RIGHT, fl_color());
-
-#endif
+ // draw an arrow whose style dependends on the active scheme
+ fl_draw_arrow(Fl_Rect(x1, y1, sz, sz), FL_ARROW_SINGLE, FL_ORIENT_RIGHT, fl_color());
} else if (m->shortcut_) {
Fl_Font f = m->labelsize_ || m->labelfont_ ? (Fl_Font)m->labelfont_ :