This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

1. Overview

Menus are used for most drop down lists. This usually includes comboboxes, etc.

2. Style Properties

Name

Default

Description

vertical-padding

1

Extra space at the top and bottom of the menu

horizontal-padding

0

Extra space at the left and right edges of the menu (new in GTK 2.10)

vertical-offset

0

When the menu is a submenu, position it this number of pixels offset vertically

horizontal-offset

-2

When the menu is a submenu, position it this number of pixels offset horizontally

double-arrows

TRUE

When scrolling, always show both arrows. (new in GTK 2.10)

3. Geometry

geometry.png

scroll-arrow-vlength is a style property of GtkWidget.
arrow-size = 0.7 * (GtkWidget::scroll-arrow-vlength - 2 * ythickness)

One thing to note is that the menu may have an additional border around itself which is not theme controlled. It is set via the border-width property of GtkContainer and defaults to 0 pixel.

offsets.png

How the offsets are used.

4. Drawing

The menu background is drawn as a BOX with detail "menu" state NORMAL and shadow OUT.

The buttons for scrolling are also drawn with a detail of "menu" (WHY?), the shadow is OUT and the state is one of INSENSITIVE, NORMAL or PRELIGHT. Instead of the prelight state the ACTIVE state is used in touchscreen mode as then one needs to press the button (shadow stays OUT though WHY?). The arrow is drawn in the same state as the button. Though for some reason the details of the arrows are "menu_scroll_arrow_down" and "menu_scroll_arrow_up" (the _down and _up is kinda stupid IMHO ...)

5. Bugs

5.1. fixed

In the past there has been a bug a bug where the horizontal-padding is not taken into account for submenu placement. (gnomebug:344290)

6. GTK+ API Documentation

http://library.gnome.org/devel/gtk/stable/GtkMenu.html


2024-10-23 10:58