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 <[email protected]>
This commit is contained in:
committed by
Augustin Cavalier
parent
de9c53f8f5
commit
2e95f9e6df
@@ -92,6 +92,7 @@ TExpandoMenuBar::TExpandoMenuBar(TBarView* barView, bool vertical)
|
|||||||
fBarView(barView),
|
fBarView(barView),
|
||||||
fVertical(vertical),
|
fVertical(vertical),
|
||||||
fOverflow(false),
|
fOverflow(false),
|
||||||
|
fFirstBuild(true),
|
||||||
fDeskbarMenuWidth(kMinMenuItemWidth),
|
fDeskbarMenuWidth(kMinMenuItemWidth),
|
||||||
fPreviousDragTargetItem(NULL),
|
fPreviousDragTargetItem(NULL),
|
||||||
fLastMousedOverItem(NULL),
|
fLastMousedOverItem(NULL),
|
||||||
@@ -506,6 +507,10 @@ TExpandoMenuBar::BuildItems()
|
|||||||
AddItem(item, 0);
|
AddItem(item, 0);
|
||||||
} else
|
} else
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
|
|
||||||
|
if (fFirstBuild && fVertical && settings->expandNewTeams)
|
||||||
|
item->ToggleExpandState(true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// existing team, update info and add it
|
// existing team, update info and add it
|
||||||
TTeamMenuItem* item = iter->second;
|
TTeamMenuItem* item = iter->second;
|
||||||
@@ -551,6 +556,8 @@ TExpandoMenuBar::BuildItems()
|
|||||||
// weird value - we just override it again
|
// weird value - we just override it again
|
||||||
ResizeTo(itemWidth, 0);
|
ResizeTo(itemWidth, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fFirstBuild = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ private:
|
|||||||
TBarView* fBarView;
|
TBarView* fBarView;
|
||||||
bool fVertical : 1;
|
bool fVertical : 1;
|
||||||
bool fOverflow : 1;
|
bool fOverflow : 1;
|
||||||
|
bool fFirstBuild : 1;
|
||||||
|
|
||||||
float fDeskbarMenuWidth;
|
float fDeskbarMenuWidth;
|
||||||
TTeamMenuItem* fPreviousDragTargetItem;
|
TTeamMenuItem* fPreviousDragTargetItem;
|
||||||
|
|||||||
Reference in New Issue
Block a user