diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-11-02 05:21:08 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-11-02 05:21:08 +0800 |
commit | 7febd6005ba749c190f47bc2fd8cf962b3b0ade3 (patch) | |
tree | 1b499ee4bb90641a32aa538259f58556230c54b4 /lib/widgets | |
parent | 80ca35af0de41ace1590eda437536674953b88cb (diff) | |
download | gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.tar gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.tar.gz gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.tar.bz2 gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.tar.lz gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.tar.xz gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.tar.zst gsoc2013-epiphany-7febd6005ba749c190f47bc2fd8cf962b3b0ade3.zip |
Fix zoom control so that it shows tooltips again. Fixes bug #155826.
2004-11-01 Christian Persch <chpe@cvs.gnome.org>
* lib/widgets/ephy-zoom-control.c: (ephy_zoom_control_init),
(ephy_zoom_control_set_tooltip):
Fix zoom control so that it shows tooltips again. Fixes bug #155826.
Diffstat (limited to 'lib/widgets')
-rw-r--r-- | lib/widgets/ephy-zoom-control.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/widgets/ephy-zoom-control.c b/lib/widgets/ephy-zoom-control.c index 15d7bcda3..644401ea0 100644 --- a/lib/widgets/ephy-zoom-control.c +++ b/lib/widgets/ephy-zoom-control.c @@ -35,6 +35,7 @@ #define EPHY_ZOOM_CONTROL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_ZOOM_CONTROL, EphyZoomControlPrivate)) struct _EphyZoomControlPrivate { + GtkWidget *ebox; GtkComboBox *combo; float zoom; guint handler_id; @@ -121,7 +122,7 @@ ephy_zoom_control_init (EphyZoomControl *control) { EphyZoomControlPrivate *p; GtkComboBox *combo; - GtkWidget *box; + GtkWidget *vbox, *ebox; guint i; p = EPHY_ZOOM_CONTROL_GET_PRIVATE (control); @@ -129,7 +130,7 @@ ephy_zoom_control_init (EphyZoomControl *control) p->zoom = 1.0; - combo = GTK_COMBO_BOX (gtk_combo_box_new_text ()); + combo = p->combo = GTK_COMBO_BOX (gtk_combo_box_new_text ()); for (i = 0; i < n_zoom_levels; i++) { @@ -144,11 +145,18 @@ ephy_zoom_control_init (EphyZoomControl *control) i = ephy_zoom_get_zoom_level_index (p->zoom); gtk_combo_box_set_active (combo, i); - box = gtk_vbox_new (TRUE, 0); - gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET (combo), TRUE, FALSE, 0); - gtk_widget_show (box); + /* FIXME: remove this when combobox supports tooltip itself */ + ebox = p->ebox = gtk_event_box_new (); + /* We need enter/leave to do tooltips */ + gtk_widget_add_events (ebox, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK); + gtk_container_add (GTK_CONTAINER (ebox), GTK_WIDGET (combo)); + gtk_widget_show (ebox); - gtk_container_add (GTK_CONTAINER (control), box); + vbox = gtk_vbox_new (TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox), ebox, TRUE, FALSE, 0); + gtk_widget_show (vbox); + + gtk_container_add (GTK_CONTAINER (control), vbox); p->handler_id = g_signal_connect (combo, "changed", G_CALLBACK (combo_changed_cb), control); @@ -205,7 +213,7 @@ ephy_zoom_control_set_tooltip (GtkToolItem *tool_item, { EphyZoomControl *control = EPHY_ZOOM_CONTROL (tool_item); - gtk_tooltips_set_tip (tooltips, GTK_WIDGET (control->priv->combo), + gtk_tooltips_set_tip (tooltips, GTK_WIDGET (control->priv->ebox), tip_text, tip_private); return TRUE; |