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 96557 - Add style properties for submenu offsets
Add style properties for submenu offsets
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.1.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2002-10-22 23:53 UTC by Owen Taylor
Modified: 2011-02-04 16:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.32 KB, patch)
2003-07-10 00:38 UTC, Soren Sandmann Pedersen
none Details | Review
new patch (4.49 KB, patch)
2003-07-12 22:14 UTC, Soren Sandmann Pedersen
none Details | Review

Description Owen Taylor 2002-10-22 23:53:55 UTC
The distance that submenus are offset from the menu item in 
the parent horizontally and vertically probably be a configurable 
properties. The default vertical offset should also almost 
certainly be smaller  than it is now (right now it is 0.25 of 
the menu item height; I don't think supporting a 
menu-item-height-relative offset like this is really necessary)

See bug 51042 and 
http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=66259.
Comment 1 Soren Sandmann Pedersen 2003-07-10 00:37:51 UTC
I am attaching a patch that adds these two properties. Note that menus
in the gnome menu panel that are too tall for the screen, are not
affected by this patch. 

This probably has to do with the function

     panel_make_sure_menu_within_screen (GtkMenu *menu)

in gnome-panel/menu.c writing another function into
menu->position_func. I haven't investigated further than that.

The horizontal_offset is measured in pixels from the edge of the
parent menu; the vertical_offset is measured in pixels from the top
edge of the parent menu item.

The default values for the h- and v-offset are -2 and -3 respectively.
With the default theme this positions submenus so that the bevels just
overlap and so that the blue selections match up if the items have the
same height.
Comment 2 Soren Sandmann Pedersen 2003-07-10 00:38:44 UTC
Created attachment 18186 [details] [review]
patch
Comment 3 Owen Taylor 2003-07-10 21:23:37 UTC
Looks good to me. My only question is whether the value 
'0' for vertical-offset should mean that the menu items
are aligned. The current '0' seems to be a bit meaningless,
if you have to use '-3' to get alignment.
Comment 4 Soren Sandmann Pedersen 2003-07-12 22:12:45 UTC
You are probably right. Here is a new patch.
Comment 5 Soren Sandmann Pedersen 2003-07-12 22:14:08 UTC
Created attachment 18246 [details] [review]
new patch
Comment 6 Owen Taylor 2003-07-12 23:09:10 UTC
Looks fine to me
Comment 7 Soren Sandmann Pedersen 2003-07-12 23:22:28 UTC
Sun Jul 13 01:37:51 2003  Soeren Sandmann  <sandmann@daimi.au.dk>

	* gtk/gtkmenu.c (gtk_menu_class_init): new properties
	"horizontal-offset" and "vertical-offset" that determines the
	position of the menu when it is a submenu. 

	* gtk/gtkmenuitem.c (gtk_menu_item_position_menu): position
	submenus according to new vertical- and horizontal-offset
	properties.