aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Berkman <jberkman@src.gnome.org>2001-07-16 22:23:48 +0800
committerJacob Berkman <jberkman@src.gnome.org>2001-07-16 22:23:48 +0800
commit6fdea01a3e077013593d1bb675cb4779ddab803c (patch)
tree8912f2fb9f0460127c2c8a1b46f528e9766d96df
parent89ddfcd774cd6ec3865d42d827eecc07dbf940d0 (diff)
downloadgsoc2013-evolution-6fdea01a3e077013593d1bb675cb4779ddab803c.tar.gz
gsoc2013-evolution-6fdea01a3e077013593d1bb675cb4779ddab803c.tar.zst
gsoc2013-evolution-6fdea01a3e077013593d1bb675cb4779ddab803c.zip
*** empty log message ***
svn path=/trunk/; revision=11126
-rw-r--r--widgets/misc/ChangeLog10
-rw-r--r--widgets/misc/e-dropdown-button.c37
-rw-r--r--widgets/misc/e-search-bar.c1
3 files changed, 27 insertions, 21 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index e992692c71..9bb10ced0b 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,13 @@
+2001-07-17 jacob berkman <jacob@ximian.com>
+
+ * e-search-bar.c (set_dropdown): don't unset _CAN_FOCUS
+
+ * e-dropdown-button.c (menu_deactivate_cb): un-toggle ourself
+ (impl_toggled): override the toggled rather than clicked signal.
+ if we are active, popup the menu; else, popdown
+
+ these fix ximian #2016
+
2001-07-02 Damon Chaplin <damon@ximian.com>
* e-calendar-item.c:
diff --git a/widgets/misc/e-dropdown-button.c b/widgets/misc/e-dropdown-button.c
index 1b90d03eb2..6beab161fa 100644
--- a/widgets/misc/e-dropdown-button.c
+++ b/widgets/misc/e-dropdown-button.c
@@ -90,7 +90,7 @@ menu_deactivate_cb (GtkMenuShell *menu_shell,
dropdown_button = E_DROPDOWN_BUTTON (data);
- gtk_button_clicked (GTK_BUTTON (dropdown_button));
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dropdown_button), FALSE);
return TRUE;
}
@@ -115,29 +115,25 @@ impl_destroy (GtkObject *object)
/* GtkWidget methods. */
-static int
-impl_button_press_event (GtkWidget *widget,
- GdkEventButton *event)
+static void
+impl_toggled (GtkToggleButton *toggle_button)
{
EDropdownButton *dropdown_button;
EDropdownButtonPrivate *priv;
- dropdown_button = E_DROPDOWN_BUTTON (widget);
- priv = dropdown_button->priv;
-
- gtk_menu_popup (GTK_MENU (priv->menu), NULL, NULL,
- menu_position_cb, dropdown_button,
- 1, GDK_CURRENT_TIME);
-
- gnome_popup_menu_do_popup (GTK_WIDGET (priv->menu), menu_position_cb, dropdown_button,
- event, NULL);
+ if (parent_class->toggled)
+ parent_class->toggled (toggle_button);
- if (! GTK_WIDGET_HAS_FOCUS (widget))
- gtk_widget_grab_focus (widget);
-
- gtk_button_clicked (GTK_BUTTON (widget));
+ dropdown_button = E_DROPDOWN_BUTTON (toggle_button);
+ priv = dropdown_button->priv;
- return TRUE;
+ if (toggle_button->active) {
+ gtk_menu_popup (GTK_MENU (priv->menu), NULL, NULL,
+ menu_position_cb, dropdown_button,
+ 1, GDK_CURRENT_TIME);
+ } else {
+ gtk_menu_popdown (GTK_MENU (priv->menu));
+ }
}
@@ -146,13 +142,14 @@ class_init (EDropdownButtonClass *klass)
{
GtkObjectClass *object_class;
GtkWidgetClass *widget_class;
+ GtkToggleButtonClass *toggle_class;
object_class = GTK_OBJECT_CLASS (klass);
widget_class = GTK_WIDGET_CLASS (klass);
+ toggle_class = GTK_TOGGLE_BUTTON_CLASS (klass);
object_class->destroy = impl_destroy;
-
- widget_class->button_press_event = impl_button_press_event;
+ toggle_class->toggled = impl_toggled;
parent_class = gtk_type_class (PARENT_TYPE);
}
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index 4d563208a2..e530e29591 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -153,7 +153,6 @@ set_dropdown (ESearchBar *esb,
gtk_widget_show_all (menu);
dropdown = e_dropdown_button_new (_("Sear_ch"), GTK_MENU (menu));
- GTK_WIDGET_UNSET_FLAGS (dropdown, GTK_CAN_FOCUS);
gtk_widget_show (dropdown);
if (esb->dropdown_holder == NULL) {