all repos — fluxbox @ 0df6609bb94ae51e3fd6f18b1c05667653dfb37f

custom fork of the fluxbox windowmanager

added showSubmenu in MenuItem
fluxgen fluxgen
commit

0df6609bb94ae51e3fd6f18b1c05667653dfb37f

parent

5373f6d840abaa49685c15fee2f411e77472a7da

3 files changed, 11 insertions(+), 3 deletions(-)

jump to
M src/FbTk/Menu.ccsrc/FbTk/Menu.cc

@@ -734,7 +734,7 @@ if (! m_moving)

clearItem(index); if (! item->submenu()->isVisible()) { - item->submenu()->show(); + item->showSubmenu(); item->submenu()->raise(); }
M src/FbTk/MenuItem.ccsrc/FbTk/MenuItem.cc

@@ -29,6 +29,7 @@ #include "PixmapWithMask.hh"

#include "Image.hh" #include "App.hh" #include "StringUtil.hh" +#include "Menu.hh" namespace FbTk {

@@ -295,6 +296,11 @@

m_icon->pixmap.reset(Image::load(m_icon->filename.c_str(), theme.screenNum())); +} + +void MenuItem::showSubmenu() { + if (submenu() != 0) + submenu()->show(); } }; // end namespace FbTk
M src/FbTk/MenuItem.hhsrc/FbTk/MenuItem.hh

@@ -94,13 +94,13 @@ virtual inline void setEnabled(bool enabled) { m_enabled = enabled; }

virtual inline void setLabel(const char *label) { m_label = (label ? label : ""); } virtual inline void setToggleItem(bool val) { m_toggle_item = val; } void setIcon(const std::string &filename, int screen_num); - Menu *submenu() { return m_submenu; } + virtual Menu *submenu() { return m_submenu; } /** @name accessors */ //@{ virtual inline const std::string &label() const { return m_label; } - inline const Menu *submenu() const { return m_submenu; } + virtual const Menu *submenu() const { return m_submenu; } virtual inline bool isEnabled() const { return m_enabled; } virtual inline bool isSelected() const { return m_selected; } virtual inline bool isToggleItem() const { return m_toggle_item; }

@@ -120,6 +120,8 @@ @param button the button number

@param time the time stamp */ virtual void click(int button, int time); + /// must use this to show submenu to ensure consistency for object like window menu in ClientMenu (see Workspace.cc) + virtual void showSubmenu(); RefCount<Command> &command() { return m_command; } const RefCount<Command> &command() const { return m_command; } //@}