Deskbar: Increase MenuBar width by 1px
... 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 <axeld@pinc-software.de>
This commit is contained in:
parent
cbb517abfd
commit
b5c9fb399a
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user