Opened 9 years ago

Closed 6 years ago

Last modified 6 years ago

#6610 closed bug (fixed)

[Interface Kit] it should be possible to open disabled menus

Reported by: diver Owned by: jscipione
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc: jessica.l.hamilton@…
Blocked By: #4147 Blocking:
Has a Patch: yes Platform: All

Description

BeOS R5 has a useful feature which allows you top open disabled menus.



Currently it is not possible in Haiku.

After implementing this feature it would be possible to revert hrev38440.

Attachments (5)

StyledEdit.png (21.7 KB) - added by diver 9 years ago.
MediaPlayer.png (7.6 KB) - added by diver 9 years ago.
0002-MediaPlayer-revert-hrev38440.patch (1.5 KB) - added by jessicah 6 years ago.
0001-BMenu-allow-to-top-open-disabled-menus-in-a-menubar..patch (1.4 KB) - added by jessicah 6 years ago.
StyledEdit-Font-menu.png (23.2 KB) - added by diver 6 years ago.

Download all attachments as: .zip

Change History (23)

Changed 9 years ago by diver

Attachment: StyledEdit.png added

Changed 9 years ago by diver

Attachment: MediaPlayer.png added

comment:1 Changed 6 years ago by jessicah

Cc: jessica.l.hamilton@… added

I'll give this one a try :)

comment:2 Changed 6 years ago by jscipione

Owner: changed from axeld to jscipione
Status: newassigned

comment:3 Changed 6 years ago by jessicah

Has a Patch: set

Changed 6 years ago by jessicah

comment:4 Changed 6 years ago by jscipione

Patch 0001 looks good but could you put the item->Frame.Contains(where) condition first and also put curly braces around the if block because the condition spans multiple lines.

comment:5 Changed 6 years ago by jessicah

Damn, I had the braces there the first time! I went through the style guide twice to try and see if I needed the braces or not. "omit braces for single line statements, place statement on a new line" needs to have an exception for the multi-line condition in the guide then... will amend :)

comment:6 Changed 6 years ago by jscipione

Ok so, I did some research and there appears to be some debate about whether or not having a multi-line conditional makes an if statement multi line or not. Discussion is here: http://www.freelists.org/post/haiku-commits/r36596-haikutrunksrcappspackageinstaller,2

Since neither the coding guidelines nor the ensuing discussion reached any consensus I guess it is ambiguous. I also managed to find some code that omitted the braces with a multi-line. So disregard that part apparently the issue is not so cut and dry.

comment:7 Changed 6 years ago by jessicah

Updated the patch anyway. Changed the dynamic_cast to be similar to other examples in the code, and also made it work for keyboard navigation for feature parity.

comment:8 Changed 6 years ago by jscipione

Ok this looks good now. Will test and apply tomorrow.

comment:9 Changed 6 years ago by jscipione

Blocked By: 4147 added

(In #4147) This fix for this bug was not right because it caused #6610

comment:10 Changed 6 years ago by jscipione

Unfortunately this patch does not match the behavior of BeOS R5. It allows for a disabled menu bar to be opened but does not allow disabled submenus of menu bars to be opened as BeOS R5 did.

comment:11 Changed 6 years ago by jscipione

Resolution: fixed
Status: assignedclosed

Fixed in hrev45977

comment:12 Changed 6 years ago by jscipione

The 0002 patch applied in hrev45979 reverting the non-style parts of hrev38440 that are no longer needed now that this bug is fixed. Thanks for all your help jessicah. Please chime in here and let me know if there is any changes that I overlooked or are not correct.

comment:13 Changed 6 years ago by diver

Thanks! However, is there a reason in enabling menus with submenus on mouse over?

comment:14 Changed 6 years ago by jscipione

diver, what do you mean by "enabling menus with submenus on mouse over"?

If by "enabling" you mean allowing you to navigate but not select submenus then the reason is two-fold:

  1. BeOS R5 did it.
  2. There is a usability principle which states that you should never hide functionality from the user, only disabled it. That way the user knows what is possible and what is not and is given feedback for what conditions must occurs for things become available or become unavailable.

If by "enabling" you mean that you can actually select the submenu menu item and make it have effect on the program then I have made a mistake.

comment:15 Changed 6 years ago by diver

I mean that on mouse over menuitem's text color changes from gray to black which might lead to a false impression that this menu have effect on the program:

Changed 6 years ago by diver

Attachment: StyledEdit-Font-menu.png added

comment:16 Changed 6 years ago by jscipione

Ahh, okay, you're right, that isn't correct, the text should be grey still to show that it is disabled.

comment:17 Changed 6 years ago by jscipione

In hrev45981 I've updated the high color (the color of the text and arrow) of the disabled submenu items to appear disabled like the disabled leaf menu items. It was a little tricky because I had to tint the color differently based on the background color for each case and also had to make it work in case your selected background color was light instead of dark.

comment:18 Changed 6 years ago by diver

It looks ok now, thanks! This ticket can be closed.

Note: See TracTickets for help on using tickets.