From 04d7b50bde21d8aea84736e7858c78d8174ed7fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 25 Sep 2007 13:28:50 +0000 Subject: [PATCH] Added shortcut 'h' to the Switcher to hide applications. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@22303 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/deskbar/Switcher.cpp | 21 +++++++++++++++++++++ src/apps/deskbar/Switcher.h | 1 + 2 files changed, 22 insertions(+) diff --git a/src/apps/deskbar/Switcher.cpp b/src/apps/deskbar/Switcher.cpp index a9aedaae03..83ce08ca23 100644 --- a/src/apps/deskbar/Switcher.cpp +++ b/src/apps/deskbar/Switcher.cpp @@ -984,6 +984,22 @@ TSwitchManager::QuitApp() } +void +TSwitchManager::HideApp() +{ + // hide all teams in this group + + TTeamGroup *teamGroup = (TTeamGroup *)fGroupList.ItemAt(fCurrentIndex); + + for (int32 i = teamGroup->TeamList()->CountItems(); i-- > 0;) { + team_id team = (team_id)teamGroup->TeamList()->ItemAt(i); + app_info info; + if (be_roster->GetRunningAppInfo(team, &info) == B_OK) + do_minimize_team(BRect(), team, false); + } +} + + window_info * TSwitchManager::WindowInfo(int32 groupIndex, int32 windowIndex) { @@ -1587,6 +1603,11 @@ TSwitcherWindow::DoKey(uint32 key, uint32 modifiers) fManager->QuitApp(); break; + case 'h': + case 'H': + fManager->HideApp(); + break; + #if _ALLOW_STICKY_ case 's': case 'S': diff --git a/src/apps/deskbar/Switcher.h b/src/apps/deskbar/Switcher.h index 3455624ad8..6c8f9ec8fd 100644 --- a/src/apps/deskbar/Switcher.h +++ b/src/apps/deskbar/Switcher.h @@ -64,6 +64,7 @@ class TSwitchManager : public BHandler { int32 CountVisibleGroups(); void QuitApp(); + void HideApp(); void CycleApp(bool forward, bool activate = false); void CycleWindow(bool forward, bool wrap = true); void SwitchToApp(int32 prevIndex, int32 newIndex, bool forward);