[gnome-screenshot] screenshot: pack header bar buttons in a horiz size group
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screenshot] screenshot: pack header bar buttons in a horiz size group
- Date: Sun, 16 Feb 2014 17:11:56 +0000 (UTC)
commit f97df989778673c4eb98759352678453888e4e54
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Feb 16 09:04:02 2014 -0800
screenshot: pack header bar buttons in a horiz size group
src/screenshot-dialog.ui | 8 ++++++++
src/screenshot-interactive-dialog.c | 5 +++++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/src/screenshot-dialog.ui b/src/screenshot-dialog.ui
index f935031..9f184b7 100644
--- a/src/screenshot-dialog.ui
+++ b/src/screenshot-dialog.ui
@@ -159,4 +159,12 @@
</object>
</child>
</object>
+ <object class="GtkSizeGroup" id="header_bar_size_group">
+ <property name="mode">horizontal</property>
+ <widgets>
+ <widget name="cancel_button"/>
+ <widget name="copy_button"/>
+ <widget name="save_button"/>
+ </widgets>
+ </object>
</interface>
diff --git a/src/screenshot-interactive-dialog.c b/src/screenshot-interactive-dialog.c
index a55c41a..5197dea 100644
--- a/src/screenshot-interactive-dialog.c
+++ b/src/screenshot-interactive-dialog.c
@@ -482,6 +482,7 @@ screenshot_interactive_dialog_new (CaptureClickedCallback f, gpointer user_data)
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (button_box), button, TRUE);
}
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
button = gtk_button_new_with_mnemonic (_("Take _Screenshot"));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
@@ -492,6 +493,7 @@ screenshot_interactive_dialog_new (CaptureClickedCallback f, gpointer user_data)
data->callback = f;
data->user_data = user_data;
g_signal_connect (button, "clicked", G_CALLBACK (capure_button_clicked_cb), data);
+ gtk_size_group_add_widget (size_group, button);
gtk_header_bar_pack_end (GTK_HEADER_BAR (header_bar), button);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
@@ -501,10 +503,13 @@ screenshot_interactive_dialog_new (CaptureClickedCallback f, gpointer user_data)
button = gtk_button_new_with_mnemonic (_("_Cancel"));
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
+ gtk_size_group_add_widget (size_group, button);
gtk_header_bar_pack_start (GTK_HEADER_BAR (header_bar), button);
g_signal_connect_swapped (button, "clicked",
G_CALLBACK (gtk_widget_destroy), dialog);
+ g_object_unref (size_group);
+
gtk_widget_show_all (dialog);
return dialog;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]