diff options
author | Soeren Sandmann <sandmann@redhat.com> | 2005-03-19 06:31:42 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2005-03-19 06:31:42 +0000 |
commit | b39b0bfc0471258285169113bc176320b0b5ae71 (patch) | |
tree | a299d2834583f4d752f3b35e12ea4f99cf29c6fa /gtk | |
parent | b8663e868f9769bd11ad703af630794c37de7b7b (diff) | |
download | gtk+-b39b0bfc0471258285169113bc176320b0b5ae71.tar.gz |
Make right-clicks not pop up the menu.
Fri Mar 18 23:59:49 2005 Soeren Sandmann <sandmann@redhat.com>
* gtk/gtkmenutoolbutton.c (arrow_button_button_press_event_cb):
Make right-clicks not pop up the menu.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkmenutoolbutton.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gtk/gtkmenutoolbutton.c b/gtk/gtkmenutoolbutton.c index ad6932630f..7881d99d75 100644 --- a/gtk/gtkmenutoolbutton.c +++ b/gtk/gtkmenutoolbutton.c @@ -261,6 +261,9 @@ button_state_changed_cb (GtkWidget *widget, GtkWidget *other; GtkStateType state = GTK_WIDGET_STATE (widget); + if (state == GTK_STATE_INSENSITIVE) + return; + priv = GTK_MENU_TOOL_BUTTON_GET_PRIVATE (button); other = (widget == priv->arrow_button) ? priv->button : priv->arrow_button; @@ -381,10 +384,17 @@ arrow_button_button_press_event_cb (GtkWidget *widget, GdkEventButton *event, GtkMenuToolButton *button) { - popup_menu_under_arrow (button, event); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); + if (event->button == 1) + { + popup_menu_under_arrow (button, event); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE); - return TRUE; + return TRUE; + } + else + { + return FALSE; + } } static void @@ -426,10 +436,12 @@ gtk_menu_tool_button_init (GtkMenuToolButton *button) button->priv->arrow_button = arrow_button; button->priv->box = box; +#if 0 g_signal_connect (real_button, "state_changed", G_CALLBACK (button_state_changed_cb), button); g_signal_connect (arrow_button, "state_changed", G_CALLBACK (button_state_changed_cb), button); +#endif g_signal_connect (arrow_button, "toggled", G_CALLBACK (arrow_button_toggled_cb), button); g_signal_connect (arrow_button, "button_press_event", |