From ec8ab0f22d4771082d347ab8b70af753b5e03b9e Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 16 Jun 2006 10:42:58 +0000 Subject: 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 --- src/Fl_Menu.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3