diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2002-10-20 22:29:57 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2002-10-20 22:29:57 +0000 |
commit | 4b08e835a4be1d0678a380832d10ff9c72618866 (patch) | |
tree | ea10c94897e4ae07f8bdee1a7f084c8e5356a166 /gtk/gtkmenubar.c | |
parent | 817ad6d3f81db85ce8be1f9ec5453dc992904b6d (diff) | |
download | gtk+-4b08e835a4be1d0678a380832d10ff9c72618866.tar.gz |
gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c, gtkmenushell.h,
Sun Oct 20 23:58:03 2002 Soeren Sandmann <sandmann@daimi.au.dk>
* gtkmenu.c, gtkmenubar.c, gtkmenuitem.c, gtkmenushell.c,
gtkmenushell.h, gtkmenushell.h
- make the delay before submenus appear below menu bars a
GtkSetting
- make the delay before submenus pops up a GtkSetting
- make the stay up triangle slightly larger
- don't pop up the first submenu immediately.
- make the default delay for submenus 225 ms, and 0 for menubars.
- make the default delay before popping down inside the stay-up
triangle 1000 ms
Fixes #74950
Diffstat (limited to 'gtk/gtkmenubar.c')
-rw-r--r-- | gtk/gtkmenubar.c | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index c76e55b8d1..766e6a2cd0 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -41,17 +41,20 @@ #define CHILD_SPACING 3 #define DEFAULT_IPADDING 1 -static void gtk_menu_bar_class_init (GtkMenuBarClass *klass); -static void gtk_menu_bar_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_menu_bar_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); -static void gtk_menu_bar_paint (GtkWidget *widget, - GdkRectangle *area); -static gint gtk_menu_bar_expose (GtkWidget *widget, - GdkEventExpose *event); -static void gtk_menu_bar_hierarchy_changed (GtkWidget *widget, - GtkWidget *old_toplevel); +static void gtk_menu_bar_class_init (GtkMenuBarClass *klass); +static void gtk_menu_bar_size_request (GtkWidget *widget, + GtkRequisition *requisition); +static void gtk_menu_bar_size_allocate (GtkWidget *widget, + GtkAllocation *allocation); +static void gtk_menu_bar_paint (GtkWidget *widget, + GdkRectangle *area); +static gint gtk_menu_bar_expose (GtkWidget *widget, + GdkEventExpose *event); +static void gtk_menu_bar_hierarchy_changed (GtkWidget *widget, + GtkWidget *old_toplevel); +static gint gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell); + + static GtkShadowType get_shadow_type (GtkMenuBar *menubar); static GtkMenuShellClass *parent_class = NULL; @@ -104,6 +107,7 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) widget_class->hierarchy_changed = gtk_menu_bar_hierarchy_changed; menu_shell_class->submenu_placement = GTK_TOP_BOTTOM; + menu_shell_class->get_popup_delay = gtk_menu_bar_get_popup_delay; binding_set = gtk_binding_set_by_class (class); gtk_binding_entry_add_signal (binding_set, @@ -164,6 +168,13 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) DEFAULT_IPADDING, G_PARAM_READABLE)); + gtk_settings_install_property (g_param_spec_int ("gtk-menu-bar-popup-delay", + _("Delay before drop down menus appear"), + _("Delay before the submenus of a menu bar appear"), + 0, + G_MAXINT, + 0, + G_PARAM_READWRITE)); } GtkWidget* @@ -575,6 +586,17 @@ get_shadow_type (GtkMenuBar *menubar) "shadow_type", &shadow_type, NULL); - return shadow_type; } + +static gint +gtk_menu_bar_get_popup_delay (GtkMenuShell *menu_shell) +{ + gint popup_delay; + + g_object_get (G_OBJECT (gtk_widget_get_settings (GTK_WIDGET (menu_shell))), + "gtk-menu-bar-popup-delay", &popup_delay, + NULL); + + return popup_delay; +} |