#4859 closed enhancement (fixed)
Sub-menus should keep the opening direction of their parents
Reported by: | axeld | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Kits/Interface Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
When opening a sub-menu, it should open in the same direction as its parent did.
For example, if the Deskbar is in the top right corner, the first level menus all open to the left, as there is no space on the usual right side. However, the sub-menus sometimes open on the left, sometimes on the right, depending on their width. This is very confusing; the menus shouldn't change their opening direction.
Attachments (1)
Change History (12)
comment:1 by , 15 years ago
comment:3 by , 15 years ago
Replying to axeld:
That's what I thought of, yes.
Would probably require adding some fields to BMenu, I guess. And complicating the code some more. Oh yeah.
follow-up: 6 comment:4 by , 15 years ago
Hm, the whole parent menu tree and all their frames should be accessible from submenus. The existing implementation which layouts the screen frame of a submenu relative to it's parent and menu item can just take this into account, no? What's more troubling is that the arrows, which indicate a submenu, will point in the wrong direction, for submenus that open to the left.
comment:5 by , 15 years ago
We could even let it point in the other direction, though I don't know if that is really a good solution :-)
follow-up: 7 comment:6 by , 15 years ago
Replying to stippi:
Hm, the whole parent menu tree and all their frames should be accessible from submenus. The existing implementation which layouts the screen frame of a submenu relative to it's parent and menu item can just take this into account, no?
Generally I don't find it nice when objects play with their parents. I'd rather give a menu a preferred submenu opening direction attribute. A menu could then simply set that (to the actual direction) on a submenu it is about to open.
Replying to axeld:
We could even let it point in the other direction, though I don't know if that is really a good solution :-)
When coming close to a screen border that would mean that the arrows could point in different directions. As a solution the code could choose a common direction that would work for all submenus.
comment:7 by , 15 years ago
Replying to bonefish:
Generally I don't find it nice when objects play with their parents. I'd rather give a menu a preferred submenu opening direction attribute. A menu could then simply set that (to the actual direction) on a submenu it is about to open.
Indeed playing with parents it's not nice. To tell the truth, though, BMenus play with parents, childs, and whatever they wants, already. It's not a reason to make the situation worse, though, and your solution seems to be nice.
When coming close to a screen border that would mean that the arrows could point in different directions. As a solution the code could choose a common direction that would work for all submenus.
The arrow, though, is drawn by BMenuItem, so the thing gets more complex.
by , 12 years ago
just noticed this and decided to post an example of the problem :P
comment:8 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:9 by , 6 years ago
Enhancement patch posted at: https://review.haiku-os.org/#/c/haiku/+/338/
My patch ensures that menus that are initially drawn to the left when they would otherwise not fit on the screen if drawn right, will have their submenus also drawn left, and so on. Essentially it ensures hierarchical menus open the same direction until they hit the far side of the screen. My patch does not do anything with regards to the menu item "arrow", which still points to the right regardless of the menu opening direction.
comment:10 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
How would you handle this ? Always open to the left if the parent opens to the left, until there is no space ?