Deskbar: minor style cleanup.
This commit is contained in:
@@ -379,7 +379,7 @@ TBarView::PlaceDeskbarMenu()
|
|||||||
height = fVertical ? kMenuBarHeight : fBarApp->IconSize() + 4;
|
height = fVertical ? kMenuBarHeight : fBarApp->IconSize() + 4;
|
||||||
|
|
||||||
BPoint loc(B_ORIGIN);
|
BPoint loc(B_ORIGIN);
|
||||||
float width = sMinimumWindowWidth;
|
float width = gMinimumWindowWidth;
|
||||||
|
|
||||||
if (fState == kFullState) {
|
if (fState == kFullState) {
|
||||||
fBarMenuBar->RemoveTeamMenu();
|
fBarMenuBar->RemoveTeamMenu();
|
||||||
@@ -473,7 +473,7 @@ TBarView::PlaceApplicationBar()
|
|||||||
expandoFrame.top = fTrayLocation != 0 ? fDragRegion->Frame().bottom + 1
|
expandoFrame.top = fTrayLocation != 0 ? fDragRegion->Frame().bottom + 1
|
||||||
: fBarMenuBar->Frame().bottom + 1;
|
: fBarMenuBar->Frame().bottom + 1;
|
||||||
expandoFrame.left = fDragRegion->Frame().left;
|
expandoFrame.left = fDragRegion->Frame().left;
|
||||||
expandoFrame.right = expandoFrame.left + sMinimumWindowWidth;
|
expandoFrame.right = expandoFrame.left + gMinimumWindowWidth;
|
||||||
expandoFrame.bottom = fState == kFullState ? screenFrame.bottom
|
expandoFrame.bottom = fState == kFullState ? screenFrame.bottom
|
||||||
: expandoFrame.top + 1;
|
: expandoFrame.top + 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -521,7 +521,7 @@ void
|
|||||||
TBarView::GetPreferredWindowSize(BRect screenFrame, float* width, float* height)
|
TBarView::GetPreferredWindowSize(BRect screenFrame, float* width, float* height)
|
||||||
{
|
{
|
||||||
float windowHeight = 0;
|
float windowHeight = 0;
|
||||||
float windowWidth = sMinimumWindowWidth;
|
float windowWidth = gMinimumWindowWidth;
|
||||||
bool setToHiddenSize = fBarApp->Settings()->autoHide && IsHidden()
|
bool setToHiddenSize = fBarApp->Settings()->autoHide && IsHidden()
|
||||||
&& !fDragRegion->IsDragging();
|
&& !fDragRegion->IsDragging();
|
||||||
|
|
||||||
|
|||||||
@@ -470,7 +470,7 @@ TExpandoMenuBar::BuildItems()
|
|||||||
else {
|
else {
|
||||||
itemWidth = iconSize;
|
itemWidth = iconSize;
|
||||||
if (!settings->hideLabels)
|
if (!settings->hideLabels)
|
||||||
itemWidth += sMinimumWindowWidth - kMinimumIconSize;
|
itemWidth += gMinimumWindowWidth - kMinimumIconSize;
|
||||||
else
|
else
|
||||||
itemWidth += kIconPadding * 2;
|
itemWidth += kIconPadding * 2;
|
||||||
}
|
}
|
||||||
@@ -620,7 +620,7 @@ TExpandoMenuBar::AddTeam(BList* team, BBitmap* icon, char* name,
|
|||||||
else {
|
else {
|
||||||
itemWidth = iconSize;
|
itemWidth = iconSize;
|
||||||
if (!settings->hideLabels)
|
if (!settings->hideLabels)
|
||||||
itemWidth += sMinimumWindowWidth - kMinimumIconSize;
|
itemWidth += gMinimumWindowWidth - kMinimumIconSize;
|
||||||
else
|
else
|
||||||
itemWidth += kIconPadding * 2;
|
itemWidth += kIconPadding * 2;
|
||||||
}
|
}
|
||||||
@@ -744,7 +744,7 @@ TExpandoMenuBar::CheckItemSizes(int32 delta)
|
|||||||
? iconOnlyWidth + kMinMenuItemWidth
|
? iconOnlyWidth + kMinMenuItemWidth
|
||||||
: iconOnlyWidth - kIconPadding;
|
: iconOnlyWidth - kIconPadding;
|
||||||
float maxItemWidth = drawLabels
|
float maxItemWidth = drawLabels
|
||||||
? sMinimumWindowWidth + iconSize - kMinimumIconSize
|
? gMinimumWindowWidth + iconSize - kMinimumIconSize
|
||||||
: iconOnlyWidth;
|
: iconOnlyWidth;
|
||||||
float menuWidth = maxItemWidth * CountItems() + fDeskbarMenuWidth
|
float menuWidth = maxItemWidth * CountItems() + fDeskbarMenuWidth
|
||||||
+ kSepItemWidth;
|
+ kSepItemWidth;
|
||||||
@@ -889,11 +889,11 @@ void
|
|||||||
TExpandoMenuBar::SetMaxItemWidth()
|
TExpandoMenuBar::SetMaxItemWidth()
|
||||||
{
|
{
|
||||||
if (fVertical)
|
if (fVertical)
|
||||||
SetMaxContentWidth(sMinimumWindowWidth);
|
SetMaxContentWidth(gMinimumWindowWidth);
|
||||||
else {
|
else {
|
||||||
// Make more room for the icon in horizontal mode
|
// Make more room for the icon in horizontal mode
|
||||||
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
|
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
|
||||||
SetMaxContentWidth(sMinimumWindowWidth + iconSize
|
SetMaxContentWidth(gMinimumWindowWidth + iconSize
|
||||||
- kMinimumIconSize);
|
- kMinimumIconSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ const char* const kInstantiateEntryCFunctionName = "instantiate_deskbar_entry";
|
|||||||
const char* const kReplicantSettingsFile = "replicants";
|
const char* const kReplicantSettingsFile = "replicants";
|
||||||
const char* const kReplicantPathField = "replicant_path";
|
const char* const kReplicantPathField = "replicant_path";
|
||||||
|
|
||||||
float sMinimumWindowWidth = kGutter + kMinimumTrayWidth + kDragRegionWidth;
|
float gMinimumWindowWidth = kGutter + kMinimumTrayWidth + kDragRegionWidth;
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -142,9 +142,9 @@ TReplicantTray::TReplicantTray(TBarView* parent, bool vertical)
|
|||||||
const BBitmap* logoBitmap = AppResSet()->FindBitmap(B_MESSAGE_TYPE,
|
const BBitmap* logoBitmap = AppResSet()->FindBitmap(B_MESSAGE_TYPE,
|
||||||
R_LeafLogoBitmap);
|
R_LeafLogoBitmap);
|
||||||
if (logoBitmap != NULL) {
|
if (logoBitmap != NULL) {
|
||||||
sMinimumWindowWidth = std::max(sMinimumWindowWidth,
|
gMinimumWindowWidth = std::max(gMinimumWindowWidth,
|
||||||
2 * (logoBitmap->Bounds().Width() + 8));
|
2 * (logoBitmap->Bounds().Width() + 8));
|
||||||
fMinimumTrayWidth = sMinimumWindowWidth - kGutter - kDragRegionWidth;
|
fMinimumTrayWidth = gMinimumWindowWidth - kGutter - kDragRegionWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the time view
|
// Create the time view
|
||||||
@@ -1540,8 +1540,8 @@ TDragRegion::MouseMoved(BPoint where, uint32 code, const BMessage* message)
|
|||||||
BRect frame = screen.Frame();
|
BRect frame = screen.Frame();
|
||||||
|
|
||||||
float hDivider = frame.Width() / 6;
|
float hDivider = frame.Width() / 6;
|
||||||
hDivider = (hDivider < sMinimumWindowWidth + 10.0f)
|
hDivider = (hDivider < gMinimumWindowWidth + 10.0f)
|
||||||
? sMinimumWindowWidth + 10.0f : hDivider;
|
? gMinimumWindowWidth + 10.0f : hDivider;
|
||||||
float miniDivider = frame.top + kMiniHeight + 10.0f;
|
float miniDivider = frame.top + kMiniHeight + 10.0f;
|
||||||
float vDivider = frame.Height() / 2;
|
float vDivider = frame.Height() / 2;
|
||||||
#ifdef FULL_MODE
|
#ifdef FULL_MODE
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ const float kMinimumTrayWidth = kIconGap
|
|||||||
+ (kMinimumReplicantCount * kMaxReplicantWidth) + kGutter;
|
+ (kMinimumReplicantCount * kMaxReplicantWidth) + kGutter;
|
||||||
const float kMinimumTrayHeight = kGutter + kMaxReplicantHeight + kGutter;
|
const float kMinimumTrayHeight = kGutter + kMaxReplicantHeight + kGutter;
|
||||||
|
|
||||||
extern float sMinimumWindowWidth;
|
extern float gMinimumWindowWidth;
|
||||||
|
|
||||||
#ifdef DB_ADDONS
|
#ifdef DB_ADDONS
|
||||||
struct DeskbarItemInfo {
|
struct DeskbarItemInfo {
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ TTeamMenu::AttachedToWindow()
|
|||||||
int32 iconSize = static_cast<TBarApp*>(be_app)->IconSize();
|
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;
|
float width = gMinimumWindowWidth - iconSize - 4;
|
||||||
|
|
||||||
if (settings->sortRunningApps)
|
if (settings->sortRunningApps)
|
||||||
teamList.SortItems(CompareByName);
|
teamList.SortItems(CompareByName);
|
||||||
@@ -95,8 +95,7 @@ TTeamMenu::AttachedToWindow()
|
|||||||
// add items back
|
// add items back
|
||||||
BarTeamInfo* barInfo = (BarTeamInfo*)teamList.ItemAt(i);
|
BarTeamInfo* barInfo = (BarTeamInfo*)teamList.ItemAt(i);
|
||||||
TTeamMenuItem* item = new TTeamMenuItem(barInfo->teams,
|
TTeamMenuItem* item = new TTeamMenuItem(barInfo->teams,
|
||||||
barInfo->icon, barInfo->name, barInfo->sig,
|
barInfo->icon, barInfo->name, barInfo->sig, width, -1);
|
||||||
width, -1);
|
|
||||||
|
|
||||||
if (settings->trackerAlwaysFirst
|
if (settings->trackerAlwaysFirst
|
||||||
&& strcasecmp(barInfo->sig, kTrackerSignature) == 0) {
|
&& strcasecmp(barInfo->sig, kTrackerSignature) == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user