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;
|
float maxWidth;
|
||||||
|
|
||||||
if (fBarView->Vertical()) {
|
if (fBarView->Vertical()) {
|
||||||
minHeight = fBarView->TabHeight();
|
minHeight = fBarView->TabHeight() - 1;
|
||||||
maxHeight = B_SIZE_UNLIMITED;
|
maxHeight = B_SIZE_UNLIMITED;
|
||||||
minWidth = gMinimumWindowWidth;
|
minWidth = gMinimumWindowWidth;
|
||||||
maxWidth = gMaximumWindowWidth;
|
maxWidth = gMaximumWindowWidth;
|
||||||
@@ -704,15 +704,13 @@ TBarWindow::SetSizeLimits()
|
|||||||
// horizontal mini-mode
|
// horizontal mini-mode
|
||||||
minWidth = gMinimumWindowWidth;
|
minWidth = gMinimumWindowWidth;
|
||||||
maxWidth = B_SIZE_UNLIMITED;
|
maxWidth = B_SIZE_UNLIMITED;
|
||||||
minHeight = fBarView->TabHeight();
|
minHeight = fBarView->TabHeight() - 1;
|
||||||
maxHeight = std::max(fBarView->TabHeight(), kGutter
|
maxHeight = std::max(fBarView->TabHeight() - 1,
|
||||||
+ fBarView->ReplicantTray()->MaxReplicantHeight()
|
kGutter + fBarView->ReplicantTray()->MaxReplicantHeight() + kGutter);
|
||||||
+ kGutter);
|
|
||||||
} else {
|
} else {
|
||||||
// horizontal expando-mode
|
// horizontal expando-mode
|
||||||
const int32 max
|
const int32 max
|
||||||
= be_control_look->ComposeIconSize(kMaximumIconSize)
|
= be_control_look->ComposeIconSize(kMaximumIconSize).IntegerWidth() + 1;
|
||||||
.IntegerWidth() + 1;
|
|
||||||
const float iconPadding
|
const float iconPadding
|
||||||
= be_control_look->ComposeSpacing(kIconPadding);
|
= be_control_look->ComposeSpacing(kIconPadding);
|
||||||
|
|
||||||
|
|||||||
@@ -150,8 +150,7 @@ TReplicantTray::TReplicantTray(TBarView* barView)
|
|||||||
= std::max(gMinReplicantHeight, (float)static_cast<TBarApp*>(be_app)->TeamIconSize());
|
= std::max(gMinReplicantHeight, (float)static_cast<TBarApp*>(be_app)->TeamIconSize());
|
||||||
// but not bigger than TabHeight which depends on be_bold_font
|
// 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
|
// TODO this should only apply to mini-mode but we set it once here for all
|
||||||
fMaxReplicantHeight = std::min(fMaxReplicantHeight,
|
fMaxReplicantHeight = std::min(fMaxReplicantHeight, fBarView->TabHeight() - 1);
|
||||||
fBarView->TabHeight() - 4);
|
|
||||||
// TODO: depends on window size... (so use something like
|
// TODO: depends on window size... (so use something like
|
||||||
// max(129, height * 3), and restrict the minimum window width for it)
|
// max(129, height * 3), and restrict the minimum window width for it)
|
||||||
// Use bold font because it depends on the window tab height.
|
// Use bold font because it depends on the window tab height.
|
||||||
@@ -164,7 +163,7 @@ TReplicantTray::TReplicantTray(TBarView* barView)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create the time view
|
// 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
|
// if mini-mode set to tab height
|
||||||
// else if horizontal mode set to team menu item height
|
// else if horizontal mode set to team menu item height
|
||||||
if (fBarView->MiniState())
|
if (fBarView->MiniState())
|
||||||
height = std::max(fMinTrayHeight, fBarView->TabHeight());
|
height = std::max(fMinTrayHeight, fBarView->TabHeight() - 1);
|
||||||
else
|
else
|
||||||
height = fBarView->TeamMenuItemHeight();
|
height = fBarView->TeamMenuItemHeight();
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1179,7 @@ TReplicantTray::LocationForReplicant(int32 index, float replicantWidth)
|
|||||||
if (fBarView->Vertical() && !fBarView->Left())
|
if (fBarView->Vertical() && !fBarView->Left())
|
||||||
loc.x += gDragWidth; // move past dragger on 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 {
|
} else {
|
||||||
loc.x -= 2; // keeps everything lined up nicely
|
loc.x -= 2; // keeps everything lined up nicely
|
||||||
const int32 iconSize = static_cast<TBarApp*>(be_app)->TeamIconSize();
|
const int32 iconSize = static_cast<TBarApp*>(be_app)->TeamIconSize();
|
||||||
|
|||||||
Reference in New Issue
Block a user