[gnome-control-center] background: Use header bar in the chooser dialog
- From: Yosef Or Boczko <yoseforb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Use header bar in the chooser dialog
- Date: Mon, 28 Apr 2014 14:37:05 +0000 (UTC)
commit 00b03c5f4e9f87ea91d42d827ff13a89ee2b3e3d
Author: Yosef Or Boczko <yoseforb src gnome org>
Date: Mon Mar 3 14:40:17 2014 +0200
background: Use header bar in the chooser dialog
https://bugzilla.gnome.org/show_bug.cgi?id=724299
panels/background/cc-background-chooser-dialog.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/panels/background/cc-background-chooser-dialog.c
b/panels/background/cc-background-chooser-dialog.c
index 167cc94..f870dce 100644
--- a/panels/background/cc-background-chooser-dialog.c
+++ b/panels/background/cc-background-chooser-dialog.c
@@ -256,6 +256,7 @@ cc_background_chooser_dialog_init (CcBackgroundChooserDialog *chooser)
GtkWidget *vbox;
GtkWidget *button1;
GtkWidget *button;
+ GtkWidget *headerbar;
GtkWidget *hbox;
GtkWidget *grid;
GtkWidget *img;
@@ -292,11 +293,13 @@ cc_background_chooser_dialog_init (CcBackgroundChooserDialog *chooser)
gtk_grid_set_column_spacing (GTK_GRID (grid), 0);
gtk_container_add (GTK_CONTAINER (vbox), grid);
+ headerbar = gtk_dialog_get_header_bar (GTK_DIALOG (chooser));
+
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER);
gtk_widget_set_hexpand (hbox, TRUE);
- gtk_container_add (GTK_CONTAINER (grid), hbox);
+ gtk_header_bar_set_custom_title (GTK_HEADER_BAR (headerbar), hbox);
context = gtk_widget_get_style_context (hbox);
gtk_style_context_add_class (context, "linked");
@@ -325,6 +328,8 @@ cc_background_chooser_dialog_init (CcBackgroundChooserDialog *chooser)
g_signal_connect (button, "toggled", G_CALLBACK (on_view_toggled), chooser);
g_object_set_data (G_OBJECT (button), "source", priv->colors_source);
+ gtk_widget_show_all (hbox);
+
priv->sw_content = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->sw_content), GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (priv->sw_content), GTK_SHADOW_IN);
@@ -448,7 +453,7 @@ cc_background_chooser_dialog_class_init (CcBackgroundChooserDialogClass *klass)
GtkWidget *
cc_background_chooser_dialog_new (void)
{
- return g_object_new (CC_TYPE_BACKGROUND_CHOOSER_DIALOG, NULL);
+ return g_object_new (CC_TYPE_BACKGROUND_CHOOSER_DIALOG, "use-header-bar", TRUE, NULL);
}
CcBackgroundItem *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]