summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2006-06-16 10:42:58 +0000
committerMatthias Melcher <fltk@matthiasm.com>2006-06-16 10:42:58 +0000
commitec8ab0f22d4771082d347ab8b70af753b5e03b9e (patch)
tree6c15bfc79bfffe3f7072df8d535d89ed967ca260
parent27e5b81fd4ac20d2b7355a1a6a638f6bd93deb4f (diff)
STR #1322: fixes wrong menutitle position for popup menus. This was originally another fix for pulldown menus (see STR #794, SVN 4259), but had an impact on popups. This fix should work well for both situations.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5204 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--CHANGES1
-rw-r--r--src/Fl_Menu.cxx12
2 files changed, 10 insertions, 3 deletions
diff --git a/CHANGES b/CHANGES
index 78eff1a68..a4da562bd 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,6 @@
CHANGES IN FLTK 1.1.8
+ - Fixed position of popup menu titles (STR #1322)
- Showing any window will disable the current tooltip
so it won't pop over menus (STR #1321)
- Updated documentation to reflect limitation of
diff --git a/src/Fl_Menu.cxx b/src/Fl_Menu.cxx
index 80ceea9ff..afb1ade0d 100644
--- a/src/Fl_Menu.cxx
+++ b/src/Fl_Menu.cxx
@@ -328,9 +328,15 @@ menuwindow::menuwindow(const Fl_Menu_Item* m, int X, int Y, int Wp, int Hp,
if (m) y(Y); else {y(Y-2); w(1); h(1);}
if (t) {
- int dy = menubar_title ? Fl::box_dy(button->box())+1 : 2;
- int ht = menubar_title ? button->h()-dy*2 : Htitle+2*BW+3;
- title = new menutitle(tx, ty-ht-dy, Wtitle, ht, t);
+ if (menubar_title) {
+ int dy = Fl::box_dy(button->box())+1;
+ int ht = button->h()-dy*2;
+ title = new menutitle(tx, ty-ht-dy, Wtitle, ht, t);
+ } else {
+ int dy = 2;
+ int ht = Htitle+2*BW+3;
+ title = new menutitle(X, Y-ht-dy, Wtitle, ht, t);
+ }
} else
title = 0;
}