[sound-juicer] Ensure Extract button is a constant size



commit 013cb9e377f5c6ff8d25c4a670c0c13a555284d9
Author: Phillip Wood <phillip wood dunelm org uk>
Date:   Sat Aug 17 10:33:35 2013 +0100

    Ensure Extract button is a constant size
    
    If the translation of 'Stop' was longer than that of 'Extract',
    'Pause' and 'Play' then the extract button would change size when it
    was clicked. Fix by adding fake buttons with both labels to a size
    group as for the play and select all buttons.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706188

 src/sj-main.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/src/sj-main.c b/src/sj-main.c
index d3ab735..48a40b4 100644
--- a/src/sj-main.c
+++ b/src/sj-main.c
@@ -2162,6 +2162,30 @@ startup_cb (GApplication *app, gpointer user_data)
     g_object_unref (G_OBJECT (size_group));
   }
 
+  { /* ensure that the extract/play button's size is constant */
+    GtkWidget *fake_button1, *fake_button2;
+    GtkSizeGroup *size_group;
+
+    size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
+
+    fake_button1 = gtk_button_new_with_label (_("E_xtract"));
+    gtk_button_set_use_underline (GTK_BUTTON (fake_button1), TRUE);
+    gtk_size_group_add_widget (size_group, fake_button1);
+    g_signal_connect_swapped (extract_button, "destroy",
+                              G_CALLBACK (gtk_widget_destroy),
+                              fake_button1);
+
+    fake_button2 = gtk_button_new_with_label (_("_Stop"));
+    gtk_button_set_use_underline (GTK_BUTTON (fake_button2), TRUE);
+    gtk_size_group_add_widget (size_group, fake_button2);
+    g_signal_connect_swapped (extract_button, "destroy",
+                              G_CALLBACK (gtk_widget_destroy),
+                              fake_button2);
+
+    gtk_size_group_add_widget (size_group, extract_button);
+    g_object_unref (G_OBJECT (size_group));
+  }
+
   { /* ensure that the select/unselect button's size is constant */
     GtkWidget *fake_button1, *fake_button2;
     GtkSizeGroup *size_group;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]