From b5c9fb399a7e8fe0e51d535a12bae027b49a9d0d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Wed, 18 Mar 2020 14:53:48 -0400 Subject: [PATCH] Deskbar: Increase MenuBar width by 1px MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... so that you can click it on the screen edge in vertical mode on the right side. The BarMenuBar was 1px too narrow and didn't take up the last pixel of its parent BarView container and therefore wouldn't open the menu on click on the last pixel. MenuBar width is increased by 1px in all modes but you probably won't be able to notice the difference in other modes. NULL comparison style fix and floorf call to prevent non-integer width are included. Fixes #15813 Change-Id: Ic5ebef5a63846a397a55358a111e33987538c455 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2377 Reviewed-by: Axel Dörfler --- src/apps/deskbar/BarMenuBar.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/apps/deskbar/BarMenuBar.cpp b/src/apps/deskbar/BarMenuBar.cpp index 164945f7aa..e85fcc222a 100644 --- a/src/apps/deskbar/BarMenuBar.cpp +++ b/src/apps/deskbar/BarMenuBar.cpp @@ -156,16 +156,14 @@ TBarMenuBar::SmartResize(float width, float height) } else ResizeTo(width, height); - width -= 1; - if (fSeparatorItem != NULL) fDeskbarMenuItem->SetContentSize(width - kSepItemWidth, height); else { int32 count = CountItems(); - if (fDeskbarMenuItem) - fDeskbarMenuItem->SetContentSize(width / count, height); - if (fAppListMenuItem) - fAppListMenuItem->SetContentSize(width / count, height); + if (fDeskbarMenuItem != NULL) + fDeskbarMenuItem->SetContentSize(floorf(width / count), height); + if (fAppListMenuItem != NULL) + fAppListMenuItem->SetContentSize(floorf(width / count), height); } InvalidateLayout();