⛏️ index : haiku.git

author John Scipione <jscipione@gmail.com> 2023-03-18 17:13:54.0 -04:00:00
committer Alex von Gluck IV <kallisti5@unixzen.com> 2023-04-10 17:32:45.0 +00:00:00
commit
8a68624821ba6d467e7174a30b83d5b970a8759a [patch]
tree
cc99b677b917a51e604817ffe2917ea35e57f33c
parent
a992c1aa4248dc970d852be9c13b67faea133f6c
download
8a68624821ba6d467e7174a30b83d5b970a8759a.tar.gz

Deskbar: Limit app bar width by BarMenuBar width

... in horizontal mode instead of (mis)calculating it.

Fixes #18299

Change-Id: I33bddd5f985677f7730f0025291fdfae90f4cb76
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6214
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
(cherry picked from commit 7ee7b33be6221e299d5938c58560f83a94204889)
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6337
Reviewed-by: John Scipione <jscipione@gmail.com>

Diff

 src/apps/deskbar/BarView.cpp        |  6 ++----
 src/apps/deskbar/ExpandoMenuBar.cpp |  9 ++++++---
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/src/apps/deskbar/BarView.cpp b/src/apps/deskbar/BarView.cpp
index e0f62cd..19c2dae 100644
--- a/src/apps/deskbar/BarView.cpp
+++ b/src/apps/deskbar/BarView.cpp
@@ -617,10 +617,8 @@
		// top or bottom
		expandoFrame.top = 0;
		expandoFrame.bottom = TeamMenuItemHeight();
		expandoFrame.left = gMinimumWindowWidth / 2 + be_control_look->ComposeSpacing(kIconPadding);
		expandoFrame.right = screenFrame.Width();
		if (fTrayLocation != 0 && fDragRegion != NULL)
			expandoFrame.right -= fDragRegion->Frame().Width() + 1;
		expandoFrame.left = screenFrame.left + fBarMenuBar->Frame().Width();
		expandoFrame.right = screenFrame.right - fDragRegion->Frame().Width() - 1;
	}

	fInlineScrollView->DetachScrollers();
diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp
index 59afee2..d5cd5a3 100644
--- a/src/apps/deskbar/ExpandoMenuBar.cpp
+++ b/src/apps/deskbar/ExpandoMenuBar.cpp
@@ -56,7 +56,7 @@
#include "icons.h"

#include "BarApp.h"
#include "BarMenuTitle.h"
#include "BarMenuBar.h"
#include "BarView.h"
#include "BarWindow.h"
#include "DeskbarMenu.h"
@@ -71,8 +71,6 @@
#include "WindowMenuItem.h"


const float kDeskbarMenuWidth = gMinimumWindowWidth / 2;

const uint32 kMinimizeTeam = 'mntm';
const uint32 kBringTeamToFront = 'bftm';

@@ -943,8 +941,9 @@
float
TExpandoMenuBar::MaxHorizontalWidth()
{
	return (fBarView->DragRegion()->Frame().left - 1) -
		(kDeskbarMenuWidth + be_control_look->ComposeSpacing(kIconPadding));
	return (BScreen(Window())).Frame().Width()
		- fBarView->DragRegion()->Frame().Width() - 1
		- fBarView->BarMenuBar()->Frame().Width();
}