From 2e95f9e6df7059cee13d193169a98c19374e48f7 Mon Sep 17 00:00:00 2001 From: looncraz Date: Tue, 12 Jul 2016 22:55:55 +0000 Subject: [PATCH] Deskbar: Expand already running applications on startup. Fixes #12480. Another way to solve this would be to ensure that TExpandoMenuBar was subscribed to TBarApp's notifications before TExpandoMenuBar::AttachedToWindow() returns, but creates other problems that this solution does not have. Signed-off-by: Augustin Cavalier --- src/apps/deskbar/ExpandoMenuBar.cpp | 7 +++++++ src/apps/deskbar/ExpandoMenuBar.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp index b4c01b1669..cebdaa6b83 100644 --- a/src/apps/deskbar/ExpandoMenuBar.cpp +++ b/src/apps/deskbar/ExpandoMenuBar.cpp @@ -92,6 +92,7 @@ TExpandoMenuBar::TExpandoMenuBar(TBarView* barView, bool vertical) fBarView(barView), fVertical(vertical), fOverflow(false), + fFirstBuild(true), fDeskbarMenuWidth(kMinMenuItemWidth), fPreviousDragTargetItem(NULL), fLastMousedOverItem(NULL), @@ -506,6 +507,10 @@ TExpandoMenuBar::BuildItems() AddItem(item, 0); } else AddItem(item); + + if (fFirstBuild && fVertical && settings->expandNewTeams) + item->ToggleExpandState(true); + } else { // existing team, update info and add it TTeamMenuItem* item = iter->second; @@ -551,6 +556,8 @@ TExpandoMenuBar::BuildItems() // weird value - we just override it again ResizeTo(itemWidth, 0); } + + fFirstBuild = false; } diff --git a/src/apps/deskbar/ExpandoMenuBar.h b/src/apps/deskbar/ExpandoMenuBar.h index 468e3c6e89..5f338c5ac9 100644 --- a/src/apps/deskbar/ExpandoMenuBar.h +++ b/src/apps/deskbar/ExpandoMenuBar.h @@ -114,6 +114,7 @@ private: TBarView* fBarView; bool fVertical : 1; bool fOverflow : 1; + bool fFirstBuild : 1; float fDeskbarMenuWidth; TTeamMenuItem* fPreviousDragTargetItem;