summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2013-08-17 10:33:35 +0100
committerPhillip Wood <phillip.wood@dunelm.org.uk>2013-08-20 15:36:01 +0100
commit013cb9e377f5c6ff8d25c4a670c0c13a555284d9 (patch)
treebf9e396f1ad837f09d89f55fd0be842fe42ba640
parentc3913c5a4935aa549f603a17774c5ba18a1acca5 (diff)
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
-rw-r--r--src/sj-main.c24
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;