all repos — fluxbox @ e2bc57bc0fef16faba89f996e354445c31aebedd

custom fork of the fluxbox windowmanager

 Fix occasional highlighting of menu nops+separators, sf.net patch 
 #1475268 (thanks Scott Kuhl; skuhl AT cs utah edu)
simonb simonb
commit

e2bc57bc0fef16faba89f996e354445c31aebedd

parent

cb65dae95fb3bd01cb4e43286ba2a56c41838d2e

5 files changed, 11 insertions(+), 4 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,6 +1,9 @@

(Format: Year/Month/Day) Changes for 0.9.16: *06/04/25: + * Fix occasional highlighting of menu nops+separators, sf.net patch + #1475268 (thanks Scott Kuhl; skuhl AT cs utah edu) + FbTk/MenuSeparator.hh/cc FbTk/Menu.cc MenuCreator.cc * fbrun: Move the cursor to the end when tab completing (Simon + thanks Jonas Koelker), sf.net rfe #1333003, patch #1475578 util/fbrun/FbRun.hh/cc
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -1182,7 +1182,7 @@ ! validIndex(m_which_sbl))

return; int item = m_which_sbl * menu.persub + m_which_press; - if (!validIndex(item)) + if (!validIndex(item) || !menuitems[item]->isEnabled()) return; clearItem(item);
M src/FbTk/MenuSeparator.ccsrc/FbTk/MenuSeparator.cc

@@ -38,8 +38,10 @@ unsigned int width, unsigned int height) const {

if (draw_background) { const GContext &tgc = - (highlight ? theme.hiliteTextGC() : - (isEnabled() ? theme.frameTextGC() : theme.disableTextGC() ) ); +// its a separator, it shouldn't be highlighted! or shown as disabled +// (highlight ? theme.hiliteTextGC() : +// (isEnabled() ? theme.frameTextGC() : theme.disableTextGC() ) ); + theme.frameTextGC(); drawable.drawRectangle(tgc.gc(), x + theme.bevelWidth() + height + 1, y + height / 2,
M src/FbTk/MenuSeparator.hhsrc/FbTk/MenuSeparator.hh

@@ -36,6 +36,7 @@ const MenuTheme &theme,

bool highlight, bool draw_foreground, bool draw_background, int x, int y, unsigned int width, unsigned int height) const; + virtual inline bool isEnabled() const { return false; } };
M src/MenuCreator.ccsrc/MenuCreator.cc

@@ -186,7 +186,8 @@

if (str_key == "end") { return; } else if (str_key == "nop") { - menu.insert(str_label.c_str()); + int menuSize = menu.insert(str_label.c_str()); + menu.setItemEnabled(menuSize-1, false); } else if (str_key == "icons") { FbTk::Menu *submenu = MenuCreator::createMenuType("iconmenu", menu.screenNumber()); if (submenu == 0)