Deskbar: create new constant kClockMargin and use it
defines the (minimum) margin between clock and replicant icons Was used in a couple different forms, now all in 1 constant
This commit is contained in:
parent
a44504a168
commit
7b7bf68d71
@ -229,9 +229,9 @@ TReplicantTray::GetPreferredSize(float* preferredWidth, float* preferredHeight)
|
|||||||
} else {
|
} else {
|
||||||
// if last replicant overruns clock then resize to accomodate
|
// if last replicant overruns clock then resize to accomodate
|
||||||
if (ReplicantCount() > 0) {
|
if (ReplicantCount() > 0) {
|
||||||
if (!fTime->IsHidden()
|
if (!fTime->IsHidden() && fTime->Frame().left
|
||||||
&& fTime->Frame().left < fRightBottomReplicant.right + 12) {
|
< fRightBottomReplicant.right + kClockMargin) {
|
||||||
width = fRightBottomReplicant.right + 12
|
width = fRightBottomReplicant.right + kClockMargin
|
||||||
+ fTime->Frame().Width();
|
+ fTime->Frame().Width();
|
||||||
} else
|
} else
|
||||||
width = fRightBottomReplicant.right + kIconGap + kGutter;
|
width = fRightBottomReplicant.right + kIconGap + kGutter;
|
||||||
@ -1167,7 +1167,7 @@ TReplicantTray::LocationForReplicant(int32 index, float replicantWidth)
|
|||||||
// determine free space in this row
|
// determine free space in this row
|
||||||
BRect rowRect(loc.x, loc.y,
|
BRect rowRect(loc.x, loc.y,
|
||||||
loc.x + static_cast<TBarApp*>(be_app)->Settings()->width
|
loc.x + static_cast<TBarApp*>(be_app)->Settings()->width
|
||||||
- kDragRegionWidth * 2,
|
- kClockMargin,
|
||||||
loc.y + kMaxReplicantHeight);
|
loc.y + kMaxReplicantHeight);
|
||||||
if (row == 0 && !fTime->IsHidden()) {
|
if (row == 0 && !fTime->IsHidden()) {
|
||||||
rowRect.right -= kClockMargin + fTime->Frame().Width()
|
rowRect.right -= kClockMargin + fTime->Frame().Width()
|
||||||
|
@ -54,6 +54,7 @@ const int32 kIconGap = 2;
|
|||||||
const int32 kGutter = 1;
|
const int32 kGutter = 1;
|
||||||
const int32 kDragRegionWidth = 6;
|
const int32 kDragRegionWidth = 6;
|
||||||
const int32 kTrayPadding = 3;
|
const int32 kTrayPadding = 3;
|
||||||
|
const int32 kClockMargin = 12;
|
||||||
|
|
||||||
// 1 pixel for left gutter
|
// 1 pixel for left gutter
|
||||||
// space for replicant tray (6 items)
|
// space for replicant tray (6 items)
|
||||||
|
Loading…
Reference in New Issue
Block a user