This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 48023 - Text for BooleanStateAction too far to the right
Summary: Text for BooleanStateAction too far to the right
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2004-08-26 20:00 UTC by ivan
Modified: 2008-12-22 15:49 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ivan 2004-08-26 20:00:50 UTC
The default menu presenter for BooleanStateAction
puts the text of the menu item too far to the right.
The resulting hole blank space is ugly.

This is visible for example in the main View
menu with ShowLineNumbers and ShowEditorToolbar.

I noticed when looking at 3.5's Window menu, where 
there were radio buttons with icons, that the
blank space for BSAs seems to correspond to a
place for these icons, even though there might
not be an icon. Perhaps the value of getIcon()
should be considered in this padding?

Of course there's the whole question of aligning
the texts of menu items when all combinations of
icons or no icons and control widgets or not are
present in the menu, but I'll leave that to
your own initiative.
Comment 1 Jiri Rechtacek 2004-08-27 15:41:18 UTC
Jano, please for consideration. Thanks
Comment 2 jrojcek 2004-08-27 15:56:16 UTC
This is mostly about the Editor menu items.
Comment 3 ivan 2004-08-27 21:01:12 UTC
Editor menus?
It's a generic menu issue. I used the View-><editor-options>
just as an example.
It's how a BooleanStateAction draws itself.
OTOH notice how output2 constructs it's own raw menu w/o
actions and avoids this problem. I wonder if that was to get
around this very problem.
Comment 4 _ tboudreau 2004-08-27 22:04:51 UTC
It wasn't - I just needed a popup menu so I used a JPopupMenu, au
natural.  

But we do have a problem currently with huge spaces on the left side
in menus - it's okay on windows, but really noticable on the mac, for
instance.  If we don't want icons in menus, since we use menu
subclasses anyway, far better to just strip the icons out than to use
empty 16x16 icons just in case somebody forgets and provides one.
Comment 5 jrojcek 2004-10-19 14:02:26 UTC
There are 4 types of menu items that can be reasonable aligned:

* label
* label with icon
* label with checkbox
* label with radio button
(other combinations should not be supported)

Such menu items should be aligned into two columns: icon column, label column. The icon 
column is for an icon or checkbox or radio button. The label column is for a label. The 
icons, checkboxes or radio buttons are centered in the icon column. The labels are aligned 
to the left in the label column.

In ascii art it would look like this:

| Menu |
-------
    Label
[i] Label with Icon
(o) Label with Radio Button
[x] Label with Checkbox
Comment 6 Jiri Rechtacek 2004-10-19 15:01:37 UTC
The editor menus are not instances of BooleanStateAction(), the editor
should solve its problems with action presenters. The
BooleanStateAction uses standard JDK presenters e.g. JMenuItem() for a
menu presenter.
Is there a another example of wrong layout of BooleanStateAction?
Comment 7 ivan 2004-10-21 01:31:29 UTC
A grep through all the sources reveals a BooleanStateAction
in the http monitor module. 
The context menu for "All Records" Node has a "Show Time Stamp"
action which illustrates the alignment problem.
Comment 8 Jiri Rechtacek 2004-10-22 08:23:37 UTC
Ivan, thanks, it's easy visible in monitor module.
Maybe problem with setup JCheckBoxMenuItem in openide/awt/Actions for
BooleanStateAction. I'm going to investigate more.
Comment 9 _ tboudreau 2004-10-25 00:24:57 UTC
BTW, on MacOS, the way main menus look is pretty ugly - you have this really huge gap on 
the left side where the icon should be.

A better way to fix the whole missing icons problem might be in org.openide.awt.MenuBar, 
to have it simply remove menu item icons - then the actions could still have an icon when 
used in the toolbar - I know there's an open issue about that problem.
Comment 10 Jiri Rechtacek 2004-10-28 15:02:07 UTC
fixed in main trunk;
RCS file: /cvs/openide/src/org/openide/resources/actions/gap.gif,v
done
Checking in src/org/openide/resources/actions/gap.gif;
/cvs/openide/src/org/openide/resources/actions/gap.gif,v  <--  gap.gif
initial revision: 1.1
done
Processing log script arguments...
More commits to come...
Checking in src/org/openide/awt/Actions.java;
/cvs/openide/src/org/openide/awt/Actions.java,v  <--  Actions.java
new revision: 1.104; previous revision: 1.103
done
Comment 11 Jesse Glick 2004-10-28 19:36:23 UTC
Boy this is an ugly fix... isn't it the responsibility of the L&F to
make sure different kinds of menu items line up cleanly despite
presence vs. absence of icons and use of checkboxes or radio buttons?
Comment 12 Marian Mirilovic 2005-12-20 15:48:01 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. Thanks in advance.