* src/mimeview.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 27 Jul 2003 19:04:30 +0000 (19:04 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 27 Jul 2003 19:04:30 +0000 (19:04 +0000)
tweak it more to make icon list act like a check button group

ChangeLog.claws
configure.ac
src/mimeview.c

index c620123..0d0b815 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-27 [alfons]    0.9.3claws62
+
+       * src/mimeview.c
+               tweak it more to make icon list act like a check button group
+
 2003-07-27 [christoph] 0.9.3claws61
 
        * sync with 0.9.3cvs20
index 729c4e9..a34674b 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=61
+EXTRA_VERSION=62
 if test $EXTRA_VERSION -eq 0; then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws
 else
index 6927453..4c5ad28 100644 (file)
@@ -125,7 +125,7 @@ static void icon_selected               (MimeView       *mimeview,
 static gint icon_key_pressed            (GtkWidget      *button, 
                                         GdkEventKey    *event,
                                         MimeView       *mimeview);
-static void icon_toggled_cb            (GtkToggleButton *button,
+static void toggle_icon                        (GtkToggleButton *button,
                                         MimeView       *mimeview);
 static void icon_list_append_icon      (MimeView       *mimeview, 
                                         MimeInfo       *mimeinfo);
@@ -1293,9 +1293,17 @@ static gboolean icon_clicked_cb (GtkWidget *button, GdkEventButton *event, MimeV
 
        num      = GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(button), "icon_number"));
        partinfo = gtk_object_get_data(GTK_OBJECT(button), "partinfo");
-       if (event->button == 1) 
+       if (event->button == 1) 
                icon_selected(mimeview, num, partinfo);
+               
+               if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
+                       toggle_icon(GTK_TOGGLE_BUTTON(button), mimeview);
+               else
+                       gtk_signal_emit_stop_by_name(GTK_OBJECT(button), "button_press_event");
+       }               
+
        part_button_pressed(mimeview, event, partinfo);
+
        return TRUE;
 }
 
@@ -1338,21 +1346,18 @@ static gint icon_key_pressed(GtkWidget *button, GdkEventKey *event,
        return FALSE;
 }
 
-static void icon_toggled_cb(GtkToggleButton *button, MimeView *mimeview)
+static void toggle_icon(GtkToggleButton *button, MimeView *mimeview)
 {
        GList *child;
        
-       if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
-               return;
-       
        child = gtk_container_children(GTK_CONTAINER(mimeview->icon_vbox));
        for (; child != NULL; child = g_list_next(child)) {
-               if (GTK_IS_TOGGLE_BUTTON(child->data) &&  
-                   GTK_TOGGLE_BUTTON(child->data) != button)
-                       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(child->data)))
-                               gtk_toggle_button_set_active
-                                       (GTK_TOGGLE_BUTTON(child->data),
-                                        FALSE);
+               if (GTK_IS_TOGGLE_BUTTON(child->data) && 
+                   GTK_TOGGLE_BUTTON(child->data) != button &&
+                   gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(child->data)))
+                       gtk_toggle_button_set_active
+                               (GTK_TOGGLE_BUTTON(child->data),
+                                FALSE);
        }
 }
 
@@ -1451,8 +1456,6 @@ static void icon_list_append_icon (MimeView *mimeview, MimeInfo *mimeinfo)
                           GTK_SIGNAL_FUNC(icon_clicked_cb), mimeview);
        gtk_signal_connect(GTK_OBJECT(button), "key_press_event", 
                           GTK_SIGNAL_FUNC(icon_key_pressed), mimeview);
-       gtk_signal_connect(GTK_OBJECT(button), "toggled", 
-                          GTK_SIGNAL_FUNC(icon_toggled_cb), mimeview);
        gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
 
 }