Deskbar: Reduce window height by 1 in mini-mode
Adjust tray icons and clock to fit accordingly. Leaf menu height is reduced by 1 in vertical mode to match. This makes the overlap of maximized windows and Deskbar less noticeable, especially in horizontal mini-mode. Fixes #16231 Change-Id: I622d008ee093e018ebcb46e3c45647577f46184f Reviewed-on: https://review.haiku-os.org/c/haiku/+/8833 Tested-by: Commit checker robot <[email protected]> Reviewed-by: John Scipione <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
@@ -694,7 +694,7 @@ TBarWindow::SetSizeLimits()
|
||||
float maxWidth;
|
||||
|
||||
if (fBarView->Vertical()) {
|
||||
minHeight = fBarView->TabHeight();
|
||||
minHeight = fBarView->TabHeight() - 1;
|
||||
maxHeight = B_SIZE_UNLIMITED;
|
||||
minWidth = gMinimumWindowWidth;
|
||||
maxWidth = gMaximumWindowWidth;
|
||||
@@ -704,15 +704,13 @@ TBarWindow::SetSizeLimits()
|
||||
// horizontal mini-mode
|
||||
minWidth = gMinimumWindowWidth;
|
||||
maxWidth = B_SIZE_UNLIMITED;
|
||||
minHeight = fBarView->TabHeight();
|
||||
maxHeight = std::max(fBarView->TabHeight(), kGutter
|
||||
+ fBarView->ReplicantTray()->MaxReplicantHeight()
|
||||
+ kGutter);
|
||||
minHeight = fBarView->TabHeight() - 1;
|
||||
maxHeight = std::max(fBarView->TabHeight() - 1,
|
||||
kGutter + fBarView->ReplicantTray()->MaxReplicantHeight() + kGutter);
|
||||
} else {
|
||||
// horizontal expando-mode
|
||||
const int32 max
|
||||
= be_control_look->ComposeIconSize(kMaximumIconSize)
|
||||
.IntegerWidth() + 1;
|
||||
= be_control_look->ComposeIconSize(kMaximumIconSize).IntegerWidth() + 1;
|
||||
const float iconPadding
|
||||
= be_control_look->ComposeSpacing(kIconPadding);
|
||||
|
||||
|
||||
@@ -150,8 +150,7 @@ TReplicantTray::TReplicantTray(TBarView* barView)
|
||||
= std::max(gMinReplicantHeight, (float)static_cast<TBarApp*>(be_app)->TeamIconSize());
|
||||
// but not bigger than TabHeight which depends on be_bold_font
|
||||
// TODO this should only apply to mini-mode but we set it once here for all
|
||||
fMaxReplicantHeight = std::min(fMaxReplicantHeight,
|
||||
fBarView->TabHeight() - 4);
|
||||
fMaxReplicantHeight = std::min(fMaxReplicantHeight, fBarView->TabHeight() - 1);
|
||||
// TODO: depends on window size... (so use something like
|
||||
// max(129, height * 3), and restrict the minimum window width for it)
|
||||
// Use bold font because it depends on the window tab height.
|
||||
@@ -164,7 +163,7 @@ TReplicantTray::TReplicantTray(TBarView* barView)
|
||||
}
|
||||
|
||||
// Create the time view
|
||||
fTime = new TTimeView(fMinimumTrayWidth, fMaxReplicantHeight - 1, fBarView);
|
||||
fTime = new TTimeView(fMinimumTrayWidth, fMaxReplicantHeight + 1, fBarView);
|
||||
}
|
||||
|
||||
|
||||
@@ -267,7 +266,7 @@ TReplicantTray::GetPreferredSize(float* preferredWidth, float* preferredHeight)
|
||||
// if mini-mode set to tab height
|
||||
// else if horizontal mode set to team menu item height
|
||||
if (fBarView->MiniState())
|
||||
height = std::max(fMinTrayHeight, fBarView->TabHeight());
|
||||
height = std::max(fMinTrayHeight, fBarView->TabHeight() - 1);
|
||||
else
|
||||
height = fBarView->TeamMenuItemHeight();
|
||||
}
|
||||
@@ -1180,7 +1179,7 @@ TReplicantTray::LocationForReplicant(int32 index, float replicantWidth)
|
||||
if (fBarView->Vertical() && !fBarView->Left())
|
||||
loc.x += gDragWidth; // move past dragger on left
|
||||
|
||||
loc.y = floorf((fBarView->TabHeight() - fMaxReplicantHeight) / 2) - 1;
|
||||
loc.y = floorf((fBarView->TabHeight() - 1 - fMaxReplicantHeight) / 2);
|
||||
} else {
|
||||
loc.x -= 2; // keeps everything lined up nicely
|
||||
const int32 iconSize = static_cast<TBarApp*>(be_app)->TeamIconSize();
|
||||
|
||||
Reference in New Issue
Block a user