summaryrefslogtreecommitdiff
path: root/gtk/gtkappchooserdialog.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2015-02-26 20:55:54 -0500
committerMatthias Clasen <mclasen@redhat.com>2015-02-26 21:16:58 -0500
commit6855e1eec36033f84aa8d2f8cd2ab77ace474064 (patch)
tree0929d57252882fb1a91a29501ac7a927a7ab4ce0 /gtk/gtkappchooserdialog.c
parentc951740cf9cd12bf8f6d7ddb383eb39cc58fb3b7 (diff)
downloadgtk+-6855e1eec36033f84aa8d2f8cd2ab77ace474064.tar.gz
app chooser dialog: Prevent uneven button heights
The height of the text buttons depends on the font height, whereas the search button has a fixed-size icon in it... Prevent unevent heights by putting them all in a size group.
Diffstat (limited to 'gtk/gtkappchooserdialog.c')
-rw-r--r--gtk/gtkappchooserdialog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 204b415607..c58206356a 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -57,6 +57,7 @@
#include "gtkheaderbar.h"
#include "gtkdialogprivate.h"
#include "gtksearchbar.h"
+#include "gtksizegroup.h"
#include <string.h>
#include <glib/gi18n-lib.h>
@@ -80,6 +81,8 @@ struct _GtkAppChooserDialogPrivate {
GtkWidget *show_more_button;
GtkWidget *software_button;
+ GtkSizeGroup *buttons;
+
gboolean show_more_clicked;
gboolean dismissed;
};
@@ -494,6 +497,7 @@ setup_search (GtkAppChooserDialog *self)
header = gtk_dialog_get_header_bar (GTK_DIALOG (self));
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
+ gtk_size_group_add_widget (self->priv->buttons, button);
g_object_bind_property (button, "active",
self->priv->search_bar, "search-mode-enabled",
@@ -696,6 +700,7 @@ gtk_app_chooser_dialog_class_init (GtkAppChooserDialogClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, inner_box);
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, search_bar);
gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, search_entry);
+ gtk_widget_class_bind_template_child_private (widget_class, GtkAppChooserDialog, buttons);
gtk_widget_class_bind_template_callback (widget_class, show_more_button_clicked_cb);
gtk_widget_class_bind_template_callback (widget_class, software_button_clicked_cb);
}