all repos — fluxbox @ 13a73a78f604c2735089f98e2e89d097c2f324bc

custom fork of the fluxbox windowmanager

highlight the nearest menu item when the current one is disabled, and add separators to focus model menu
Mark Tiefenbruck mark@fluxbox.org
commit

13a73a78f604c2735089f98e2e89d097c2f324bc

parent

79eadb258f8cb975b4984e56b1f061b9d3e02dd5

3 files changed, 22 insertions(+), 0 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,9 @@

(Format: Year/Month/Day) Changes for 1.1 +*08/09/01: + * When the current menu item gets disabled, highlight its nearest neighbor + and add separators to the focus model menu (Mark) + Screen.cc FbTk/Menu.cc *08/08/22: * Remove borders from maximized windows (Mark) FbWinFrame.cc
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -374,6 +374,21 @@ menu.item_w += (theme()->bevelWidth() * 2);

} else menu.item_w = 1; + if (validIndex(m_active_index) && !menuitems[m_active_index]->isEnabled()) { + // find the nearest enabled menuitem and highlight it + for (size_t i = 1; i < menuitems.size(); i++) { + if (validIndex(m_active_index + i) && + menuitems[m_active_index + i]->isEnabled()) { + m_active_index += i; + break; + } else if (validIndex(m_active_index - i) && + menuitems[m_active_index - i]->isEnabled()) { + m_active_index -= i; + break; + } + } + } + unsigned int ii = 0; Menuitems::iterator it = menuitems.begin(); Menuitems::iterator it_end = menuitems.end();
M src/Screen.ccsrc/Screen.cc

@@ -37,6 +37,7 @@

// menu items #include "FbTk/BoolMenuItem.hh" #include "FbTk/IntMenuItem.hh" +#include "FbTk/MenuSeparator.hh" #include "FocusModelMenuItem.hh" #include "RadioMenuItem.hh"

@@ -1619,12 +1620,14 @@ "Mouse Focus", "Mouse Focus",

FocusControl::MOUSEFOCUS); #undef _FOCUSITEM + focus_menu->insert(new FbTk::MenuSeparator()); focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, ClickTabFocus, "ClickTabFocus", "Click tab to focus windows"), focusControl(), FocusControl::CLICKTABFOCUS, save_and_reconfigure)); focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, MouseTabFocus, "MouseTabFocus", "Hover over tab to focus windows"), focusControl(), FocusControl::MOUSETABFOCUS, save_and_reconfigure)); + focus_menu->insert(new FbTk::MenuSeparator()); try { focus_menu->insert(new FbTk::BoolMenuItem(_FB_XTEXT(Configmenu, FocusNew,