From 94ebb7194156d95339d0314e0e445ae59d439337 Mon Sep 17 00:00:00 2001
From: looncraz <looncraz@looncraz.net>
Date: Tue, 12 Jul 2016 22:55:55 +0000
Subject: [PATCH] Expand already running applications when Deskbar starts
Fixes #12480
Another way to solvethis 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.
---
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 b4c01b1..cebdaa6 100644
a
|
b
|
TExpandoMenuBar::TExpandoMenuBar(TBarView* barView, bool vertical)
|
92 | 92 | fBarView(barView), |
93 | 93 | fVertical(vertical), |
94 | 94 | fOverflow(false), |
| 95 | fFirstBuild(true), |
95 | 96 | fDeskbarMenuWidth(kMinMenuItemWidth), |
96 | 97 | fPreviousDragTargetItem(NULL), |
97 | 98 | fLastMousedOverItem(NULL), |
… |
… |
TExpandoMenuBar::BuildItems()
|
506 | 507 | AddItem(item, 0); |
507 | 508 | } else |
508 | 509 | AddItem(item); |
| 510 | |
| 511 | if (fFirstBuild && fVertical && settings->expandNewTeams) |
| 512 | item->ToggleExpandState(true); |
| 513 | |
509 | 514 | } else { |
510 | 515 | // existing team, update info and add it |
511 | 516 | TTeamMenuItem* item = iter->second; |
… |
… |
TExpandoMenuBar::BuildItems()
|
551 | 556 | // weird value - we just override it again |
552 | 557 | ResizeTo(itemWidth, 0); |
553 | 558 | } |
| 559 | |
| 560 | fFirstBuild = false; |
554 | 561 | } |
555 | 562 | |
556 | 563 | |
diff --git a/src/apps/deskbar/ExpandoMenuBar.h b/src/apps/deskbar/ExpandoMenuBar.h
index 468e3c6..5f338c5 100644
a
|
b
|
private:
|
114 | 114 | TBarView* fBarView; |
115 | 115 | bool fVertical : 1; |
116 | 116 | bool fOverflow : 1; |
| 117 | bool fFirstBuild : 1; |
117 | 118 | |
118 | 119 | float fDeskbarMenuWidth; |
119 | 120 | TTeamMenuItem* fPreviousDragTargetItem; |