From 7b7bf68d713451873ce3950954a87368fb322af5 Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 23 Oct 2017 21:11:02 -0700 Subject: [PATCH] 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 --- src/apps/deskbar/StatusView.cpp | 8 ++++---- src/apps/deskbar/StatusView.h | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp index 633935f6d7..db46c69b9d 100644 --- a/src/apps/deskbar/StatusView.cpp +++ b/src/apps/deskbar/StatusView.cpp @@ -229,9 +229,9 @@ TReplicantTray::GetPreferredSize(float* preferredWidth, float* preferredHeight) } else { // if last replicant overruns clock then resize to accomodate if (ReplicantCount() > 0) { - if (!fTime->IsHidden() - && fTime->Frame().left < fRightBottomReplicant.right + 12) { - width = fRightBottomReplicant.right + 12 + if (!fTime->IsHidden() && fTime->Frame().left + < fRightBottomReplicant.right + kClockMargin) { + width = fRightBottomReplicant.right + kClockMargin + fTime->Frame().Width(); } else width = fRightBottomReplicant.right + kIconGap + kGutter; @@ -1167,7 +1167,7 @@ TReplicantTray::LocationForReplicant(int32 index, float replicantWidth) // determine free space in this row BRect rowRect(loc.x, loc.y, loc.x + static_cast(be_app)->Settings()->width - - kDragRegionWidth * 2, + - kClockMargin, loc.y + kMaxReplicantHeight); if (row == 0 && !fTime->IsHidden()) { rowRect.right -= kClockMargin + fTime->Frame().Width() diff --git a/src/apps/deskbar/StatusView.h b/src/apps/deskbar/StatusView.h index 40d45bc203..14f06e5665 100644 --- a/src/apps/deskbar/StatusView.h +++ b/src/apps/deskbar/StatusView.h @@ -54,6 +54,7 @@ const int32 kIconGap = 2; const int32 kGutter = 1; const int32 kDragRegionWidth = 6; const int32 kTrayPadding = 3; +const int32 kClockMargin = 12; // 1 pixel for left gutter // space for replicant tray (6 items)