After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 110775 - Removing the space between menu items in menu bar
Removing the space between menu items in menu bar
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkMenu
unspecified
Other Linux
: Normal trivial
: ---
Assigned To: gtk-bugs
gtk-bugs
: 118360 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-04-14 16:49 UTC by Richardve
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The patch (1.80 KB, patch)
2003-04-14 16:51 UTC, Richardve
none Details | Review
Patch to remove child spacing (1.48 KB, patch)
2003-07-01 18:53 UTC, Soren Sandmann Pedersen
none Details | Review
New patch that keeps that space between items (3.09 KB, patch)
2004-02-21 17:41 UTC, Soren Sandmann Pedersen
none Details | Review

Description Richardve 2003-04-14 16:49:16 UTC
Gtk+ has some weird spacing between every menu item in a menu bar, as shown
on the following screenshot:

http://home.quicknet.nl/qn/prive/rm.vaneijbergen/mitem-spc-before.png
(where the white rectangle shows the space between the 2 items)

This feels quite icky, doesn't look really nice and it makes the menu bar
feel more like it's patched together instead of being a 'complete' widget.

So I would like to propose to remove this space (currently hardcoded to 3
pixels wide on each side of an item) and add it into the menu (bar) item
itself instead, like shown in this screenshot:

http://home.quicknet.nl/qn/prive/rm.vaneijbergen/mitem-spc-after.png

This makes that the selection of a menu item jumps straight from one to the
other item, instead of waiting until the mouse pointer is 6 pixels further
on the menu bar.

I'm attaching a quick patch that modifies GtkMenubar and GtkMenuItem to do
what I described above.
This patch, however, is not meant to be applied (not yet, at least) and
uses the hardcoded value of 3 to add the space on both sides of a menu item
(and accidentily adds that to normal menu items as well, shouldn't happen
of course).

The patch is hacky because I need this (previously hardcoded) value not
only in GtkMenuItem but in GtkMenubar as well.

Would it be acceptable to use a new (style) property for a final patch (and
at the same time getting access to that value in both GtkMenuItem and
GtkMenubar)?
Comment 1 Richardve 2003-04-14 16:51:26 UTC
Created attachment 15717 [details] [review]
The patch
Comment 2 Owen Taylor 2003-05-20 02:58:56 UTC
I think the change probably makes sense

 * Are you proposing addng the space on the left as well? If
   not, the menu items need to know where in their menu
   they are drawing
 
 * It's probably cleanest to do the change as:
 
  - Remove BORDER_SPACING from GtkMenuBar entirely
  - Add an extra-horizontal-padding style property to
    GTK+ that gets added on both sides if submenu_placement
    is GTK_TOP_BOTTOM.
 
  Probably still the same thing if you don't want the
  padding on the extreme left/right ... you just need
  to make the GtkMenuItem figure out where in the
  menu bar it is. (get the parent, make sure it is a 
  GtkMenuShell, find itself in menu_shell->children)
Comment 3 Richardve 2003-05-27 22:53:40 UTC
Yes, I'm proposing to add the space on the left as well (think it
looks better that way)

New patch with horizontal padding available in a few days.. (probably
by Saturday or so)
Comment 4 Soren Sandmann Pedersen 2003-06-05 23:34:50 UTC
My patch from bug 96236 adds among other things a new
GtkMenuItem::horizontal-padding style property.
Comment 5 Soren Sandmann Pedersen 2003-07-01 18:48:33 UTC
Can't we just remove CHILD_SPACING? I don't really think it's
necessary to add extra space around menu items.
Comment 6 Soren Sandmann Pedersen 2003-07-01 18:53:47 UTC
Created attachment 17962 [details] [review]
Patch to remove child spacing
Comment 7 Soren Sandmann Pedersen 2003-07-26 11:24:59 UTC
*** Bug 118360 has been marked as a duplicate of this bug. ***
Comment 8 Soren Sandmann Pedersen 2004-02-21 17:41:00 UTC
Created attachment 24630 [details] [review]
New patch that  keeps that space between items
Comment 9 Soren Sandmann Pedersen 2004-02-26 22:28:55 UTC
Thu Feb 26 23:26:00 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkstatusbar.c (set_grip_cursor): New function. Use resize
	cursors for resize grips. (Bug #129621)

	* gtk/gtktoolbar.c (gtk_toolbar_get_relief_style): Documentation
	fix - patch by Torsten Schoenfeld.

	* gtk/gtkmenubar.c (gtk_menu_bar_size_request): don't request
	space between the items. (Bug #110775)

	* gtk/gtkrc.c (_gtk_rc_init): Provide extra horizontal padding
	inside menu items that are inside a menu bar. (Bug #110775)
	
	* configure.in (HAVE_XCURSOR): Make XCurosr part of GDK_EXTRA_,
	not GDK_PACKAGES, to prevent applications from getting linked to
	it (Bug #119804)

	* gtk/gtkmenubar.c (gtk_menu_bar_size_allocate): Put the vertical
	ipadding inside the item. (Bug #61843)