Set the TeamMenuItems to a more reasonable width in mini mode
This commit is contained in:
parent
0af37cd3bc
commit
d6d8b95a6d
@ -46,6 +46,7 @@ All rights reserved.
|
|||||||
#include "BarMenuBar.h"
|
#include "BarMenuBar.h"
|
||||||
#include "BarView.h"
|
#include "BarView.h"
|
||||||
#include "DeskbarUtils.h"
|
#include "DeskbarUtils.h"
|
||||||
|
#include "StatusView.h"
|
||||||
#include "TeamMenuItem.h"
|
#include "TeamMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
@ -70,6 +71,7 @@ void
|
|||||||
TTeamMenu::AttachedToWindow()
|
TTeamMenu::AttachedToWindow()
|
||||||
{
|
{
|
||||||
RemoveItems(0, CountItems(), true);
|
RemoveItems(0, CountItems(), true);
|
||||||
|
// remove all items
|
||||||
|
|
||||||
BMessenger self(this);
|
BMessenger self(this);
|
||||||
BList teamList;
|
BList teamList;
|
||||||
@ -77,29 +79,32 @@ TTeamMenu::AttachedToWindow()
|
|||||||
|
|
||||||
TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView();
|
TBarView* barview = (dynamic_cast<TBarApp*>(be_app))->BarView();
|
||||||
bool dragging = barview && barview->Dragging();
|
bool dragging = barview && barview->Dragging();
|
||||||
|
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
|
||||||
desk_settings* settings = ((TBarApp*)be_app)->Settings();
|
desk_settings* settings = ((TBarApp*)be_app)->Settings();
|
||||||
|
|
||||||
|
float width = sMinimumWindowWidth - iconSize - 4;
|
||||||
|
|
||||||
if (settings->sortRunningApps)
|
if (settings->sortRunningApps)
|
||||||
teamList.SortItems(CompareByName);
|
teamList.SortItems(CompareByName);
|
||||||
|
|
||||||
int32 count = teamList.CountItems();
|
int32 count = teamList.CountItems();
|
||||||
for (int32 i = 0; i < count; i++) {
|
for (int32 i = 0; i < count; i++) {
|
||||||
|
// add items back
|
||||||
BarTeamInfo* barInfo = (BarTeamInfo*)teamList.ItemAt(i);
|
BarTeamInfo* barInfo = (BarTeamInfo*)teamList.ItemAt(i);
|
||||||
|
|
||||||
if (((barInfo->flags & B_BACKGROUND_APP) == 0)
|
if (((barInfo->flags & B_BACKGROUND_APP) == 0)
|
||||||
&& (strcasecmp(barInfo->sig, kDeskbarSignature) != 0)) {
|
&& (strcasecmp(barInfo->sig, kDeskbarSignature) != 0)) {
|
||||||
TTeamMenuItem* item = new TTeamMenuItem(barInfo->teams,
|
TTeamMenuItem* item = new TTeamMenuItem(barInfo->teams,
|
||||||
barInfo->icon, barInfo->name, barInfo->sig, -1, -1,
|
barInfo->icon, barInfo->name, barInfo->sig,
|
||||||
!settings->hideLabels, true);
|
width, -1, !settings->hideLabels, true);
|
||||||
|
|
||||||
if ((settings->trackerAlwaysFirst)
|
if (settings->trackerAlwaysFirst
|
||||||
&& (strcmp(barInfo->sig, kTrackerSignature) == 0))
|
&& strcmp(barInfo->sig, kTrackerSignature) == 0) {
|
||||||
AddItem(item, 0);
|
AddItem(item, 0);
|
||||||
else
|
} else
|
||||||
AddItem(item);
|
AddItem(item);
|
||||||
|
|
||||||
if (dragging && item) {
|
if (dragging && item != NULL) {
|
||||||
bool canhandle = (dynamic_cast<TBarApp*>(be_app))->BarView()->
|
bool canhandle = (dynamic_cast<TBarApp*>(be_app))->BarView()->
|
||||||
AppCanHandleTypes(item->Signature());
|
AppCanHandleTypes(item->Signature());
|
||||||
if (item->IsEnabled() != canhandle)
|
if (item->IsEnabled() != canhandle)
|
||||||
|
Loading…
Reference in New Issue
Block a user