From 3af441d3ef082111b5718a3ea76de7b6ab102225 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 11 Jan 2004 16:06:22 +0000 Subject: hideMenus function, hides all menus on current screen --- src/Screen.cc | 37 +++++++++++++++++++++++++++++++++++-- src/Screen.hh | 5 +++-- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index c6ec4e7..dfe92fb 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1,5 +1,5 @@ // Screen.cc for Fluxbox Window Manager -// Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) +// Copyright (c) 2001 - 2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) // // Screen.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net) @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.259 2004/01/10 02:58:01 fluxgen Exp $ +// $Id: Screen.cc,v 1.260 2004/01/11 16:06:22 fluxgen Exp $ #include "Screen.hh" @@ -743,6 +743,39 @@ FbTk::Menu *BScreen::createMenu(const std::string &label) { return menu; } +void BScreen::hideMenus() { + // hide extra menus + Fluxbox::instance()->hideExtraMenus(*this); + +#ifdef SLIT + // hide slit menu + if (slit()) + slit()->menu().hide(); +#endif // SLIT + + // hide icon menus + if (getIconList().size()) { + Icons::iterator it = getIconList().begin(); + const Icons::iterator it_end = getIconList().end(); + for (; it != it_end; ++it) + (*it)->menu().hide(); + } + // hide all client menus + Workspaces::iterator w_it = getWorkspacesList().begin(); + const Workspaces::iterator w_it_end = getWorkspacesList().end(); + for (; w_it != w_it_end; ++w_it) { + if ((*w_it)->windowList().size()) { + Workspace::Windows::iterator win_it = (*w_it)->windowList().begin(); + const Workspace::Windows::iterator win_it_end = (*w_it)->windowList().end(); + for (; win_it != win_it_end; ++win_it) { + (*win_it)->menu().hide(); + } + } + } + + +} + void BScreen::reconfigure() { m_menutheme->setAlpha(*resource.menu_alpha); m_menutheme->setMenuMode(*resource.menu_mode); diff --git a/src/Screen.hh b/src/Screen.hh index 114957e..0b606a8 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -1,5 +1,5 @@ // Screen.hh for Fluxbox Window Manager -// Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net) +// Copyright (c) 2001 - 2004 Henrik Kinnunen (fluxgen at users.sourceforge.net) // // Screen.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net) @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.131 2003/12/30 17:57:12 fluxgen Exp $ +// $Id: Screen.hh,v 1.132 2004/01/11 16:05:55 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -172,6 +172,7 @@ public: void update(FbTk::Subject *subj); FbTk::Menu *createMenu(const std::string &label); + void hideMenus(); /// @return the resource value of number of workspace inline int getNumberOfWorkspaces() const { return *resource.workspaces; } -- cgit v0.11.2