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