[cheese] Connect thumbnail nav button signals
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cheese] Connect thumbnail nav button signals
- Date: Wed, 26 Oct 2011 18:04:58 +0000 (UTC)
commit 00b1e9e1ca5ebfbef5fe3cd9df05e68c378d2193
Author: David King <amigadave amigadave com>
Date: Wed Oct 26 19:49:07 2011 +0200
Connect thumbnail nav button signals
The thumb nav widget crashed when clicking the buttons to scroll the
thumbnail view. This was caused by connecting to the wrong signals:
âbutton-pressed-eventâ and âbutton-released-eventâ, rather than
âpressedâ and âreleasedâ. There was also some duplicate code for
creating the left button, which led to a GtkButton being leaked when
the thumb nav was created. Fixes bug 660686.
src/thumbview/eog-thumb-nav.c | 44 +++++++---------------------------------
1 files changed, 8 insertions(+), 36 deletions(-)
---
diff --git a/src/thumbview/eog-thumb-nav.c b/src/thumbview/eog-thumb-nav.c
index 8eab49d..d64e72c 100644
--- a/src/thumbview/eog-thumb-nav.c
+++ b/src/thumbview/eog-thumb-nav.c
@@ -356,13 +356,11 @@ eog_thumb_nav_constructor (GType type,
GObjectConstructParam *construct_params)
{
GObject *object;
- EogThumbNav *nav;
EogThumbNavPrivate *priv;
object = G_OBJECT_CLASS (eog_thumb_nav_parent_class)->constructor
(type, n_construct_properties, construct_params);
- nav = EOG_THUMB_NAV (object);
priv = EOG_THUMB_NAV_GET_PRIVATE (object);
if (priv->thumbview != NULL)
@@ -435,35 +433,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_left,
- "button-press-event",
+ "pressed",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_left,
- "button-release-event",
- G_CALLBACK (eog_thumb_nav_stop_scroll),
- nav);
-
- priv->button_left = gtk_button_new ();
- gtk_button_set_relief (GTK_BUTTON (priv->button_left), GTK_RELIEF_NONE);
-
- arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_ETCHED_IN);
- gtk_container_add (GTK_CONTAINER (priv->button_left), arrow);
-
- gtk_widget_set_size_request (GTK_WIDGET (priv->button_left), 25, 0);
-
- g_signal_connect (priv->button_left,
- "clicked",
- G_CALLBACK (eog_thumb_nav_button_clicked),
- nav);
-
- g_signal_connect (priv->button_left,
- "button-press-event",
- G_CALLBACK (eog_thumb_nav_start_scroll),
- nav);
-
- g_signal_connect (priv->button_left,
- "button-release-event",
+ "released",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -524,12 +499,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_right,
- "button-press-event",
+ "pressed",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_right,
- "button-release-event",
+ "released",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -547,12 +522,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_down,
- "button-press-event",
+ "pressed",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_down,
- "button-release-event",
+ "released",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -570,12 +545,12 @@ eog_thumb_nav_init (EogThumbNav *nav)
nav);
g_signal_connect (priv->button_up,
- "button-press-event",
+ "pressed",
G_CALLBACK (eog_thumb_nav_start_scroll),
nav);
g_signal_connect (priv->button_up,
- "button-release-event",
+ "released",
G_CALLBACK (eog_thumb_nav_stop_scroll),
nav);
@@ -605,7 +580,6 @@ eog_thumb_nav_new (GtkWidget *thumbview,
gboolean show_buttons)
{
EogThumbNav *nav;
- EogThumbNavPrivate *priv;
nav = g_object_new (EOG_TYPE_THUMB_NAV,
"show-buttons", show_buttons,
@@ -614,8 +588,6 @@ eog_thumb_nav_new (GtkWidget *thumbview,
"spacing", 0,
NULL);
- priv = nav->priv;
-
return GTK_WIDGET (nav);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]