Opened 10 years ago

Closed 13 months ago

Last modified 13 months ago

#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:
Has a Patch: no 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)

Haiku.png (791.3 KB ) - added by augiedoggie 6 years ago.
just noticed this and decided to post an example of the problem :P

Download all attachments as: .zip

Change History (12)

comment:1 by jackburton, 9 years ago

How would you handle this ? Always open to the left if the parent opens to the left, until there is no space ?

comment:2 by axeld, 9 years ago

That's what I thought of, yes.

in reply to:  2 comment:3 by jackburton, 9 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.

comment:4 by stippi, 9 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 axeld, 9 years ago

We could even let it point in the other direction, though I don't know if that is really a good solution :-)

in reply to:  4 ; comment:6 by bonefish, 9 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.

in reply to:  6 comment:7 by jackburton, 9 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 augiedoggie, 6 years ago

Attachment: Haiku.png added

just noticed this and decided to post an example of the problem :P

comment:8 by axeld, 2 years ago

Owner: changed from axeld to nobody
Status: newassigned

comment:9 by closequarters, 13 months 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 waddlesplash, 13 months ago

Resolution: fixed
Status: assignedclosed

comment:11 by waddlesplash, 13 months ago

Merged in hrev52109.

Note: See TracTickets for help on using tickets.