diff options
author | simonb <simonb> | 2006-04-25 03:11:31 (GMT) |
---|---|---|
committer | simonb <simonb> | 2006-04-25 03:11:31 (GMT) |
commit | e2bc57bc0fef16faba89f996e354445c31aebedd (patch) | |
tree | cc6127b87a9c5d5c2e6ecc84a4317c04dabb0e63 | |
parent | cb65dae95fb3bd01cb4e43286ba2a56c41838d2e (diff) | |
download | fluxbox-e2bc57bc0fef16faba89f996e354445c31aebedd.zip fluxbox-e2bc57bc0fef16faba89f996e354445c31aebedd.tar.bz2 |
Fix occasional highlighting of menu nops+separators, sf.net patch
#1475268 (thanks Scott Kuhl; skuhl AT cs utah edu)
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/FbTk/Menu.cc | 2 | ||||
-rw-r--r-- | src/FbTk/MenuSeparator.cc | 6 | ||||
-rw-r--r-- | src/FbTk/MenuSeparator.hh | 1 | ||||
-rw-r--r-- | src/MenuCreator.cc | 3 |
5 files changed, 11 insertions, 4 deletions
@@ -1,6 +1,9 @@ | |||
1 | (Format: Year/Month/Day) | 1 | (Format: Year/Month/Day) |
2 | Changes for 0.9.16: | 2 | Changes for 0.9.16: |
3 | *06/04/25: | 3 | *06/04/25: |
4 | * Fix occasional highlighting of menu nops+separators, sf.net patch | ||
5 | #1475268 (thanks Scott Kuhl; skuhl AT cs utah edu) | ||
6 | FbTk/MenuSeparator.hh/cc FbTk/Menu.cc MenuCreator.cc | ||
4 | * fbrun: Move the cursor to the end when tab completing | 7 | * fbrun: Move the cursor to the end when tab completing |
5 | (Simon + thanks Jonas Koelker), sf.net rfe #1333003, patch #1475578 | 8 | (Simon + thanks Jonas Koelker), sf.net rfe #1333003, patch #1475578 |
6 | util/fbrun/FbRun.hh/cc | 9 | util/fbrun/FbRun.hh/cc |
diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index b08bfe9..d99c9ba 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc | |||
@@ -1182,7 +1182,7 @@ void Menu::openSubmenu() { | |||
1182 | return; | 1182 | return; |
1183 | 1183 | ||
1184 | int item = m_which_sbl * menu.persub + m_which_press; | 1184 | int item = m_which_sbl * menu.persub + m_which_press; |
1185 | if (!validIndex(item)) | 1185 | if (!validIndex(item) || !menuitems[item]->isEnabled()) |
1186 | return; | 1186 | return; |
1187 | 1187 | ||
1188 | clearItem(item); | 1188 | clearItem(item); |
diff --git a/src/FbTk/MenuSeparator.cc b/src/FbTk/MenuSeparator.cc index 34c97fe..be43a87 100644 --- a/src/FbTk/MenuSeparator.cc +++ b/src/FbTk/MenuSeparator.cc | |||
@@ -38,8 +38,10 @@ void MenuSeparator::draw(FbDrawable &drawable, | |||
38 | 38 | ||
39 | if (draw_background) { | 39 | if (draw_background) { |
40 | const GContext &tgc = | 40 | const GContext &tgc = |
41 | (highlight ? theme.hiliteTextGC() : | 41 | // its a separator, it shouldn't be highlighted! or shown as disabled |
42 | (isEnabled() ? theme.frameTextGC() : theme.disableTextGC() ) ); | 42 | // (highlight ? theme.hiliteTextGC() : |
43 | // (isEnabled() ? theme.frameTextGC() : theme.disableTextGC() ) ); | ||
44 | theme.frameTextGC(); | ||
43 | 45 | ||
44 | drawable.drawRectangle(tgc.gc(), | 46 | drawable.drawRectangle(tgc.gc(), |
45 | x + theme.bevelWidth() + height + 1, y + height / 2, | 47 | x + theme.bevelWidth() + height + 1, y + height / 2, |
diff --git a/src/FbTk/MenuSeparator.hh b/src/FbTk/MenuSeparator.hh index c35efc4..38f15d3 100644 --- a/src/FbTk/MenuSeparator.hh +++ b/src/FbTk/MenuSeparator.hh | |||
@@ -36,6 +36,7 @@ public: | |||
36 | bool highlight, bool draw_foreground, bool draw_background, | 36 | bool highlight, bool draw_foreground, bool draw_background, |
37 | int x, int y, | 37 | int x, int y, |
38 | unsigned int width, unsigned int height) const; | 38 | unsigned int width, unsigned int height) const; |
39 | virtual inline bool isEnabled() const { return false; } | ||
39 | 40 | ||
40 | }; | 41 | }; |
41 | 42 | ||
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index c97d51d..f920321 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc | |||
@@ -186,7 +186,8 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) { | |||
186 | if (str_key == "end") { | 186 | if (str_key == "end") { |
187 | return; | 187 | return; |
188 | } else if (str_key == "nop") { | 188 | } else if (str_key == "nop") { |
189 | menu.insert(str_label.c_str()); | 189 | int menuSize = menu.insert(str_label.c_str()); |
190 | menu.setItemEnabled(menuSize-1, false); | ||
190 | } else if (str_key == "icons") { | 191 | } else if (str_key == "icons") { |
191 | FbTk::Menu *submenu = MenuCreator::createMenuType("iconmenu", menu.screenNumber()); | 192 | FbTk::Menu *submenu = MenuCreator::createMenuType("iconmenu", menu.screenNumber()); |
192 | if (submenu == 0) | 193 | if (submenu == 0) |