[gnome-photos] Use header bars in dialogs



commit 8b800cfb4c87d7793567ce956c64275a4bd2c9e5
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jan 31 10:57:20 2014 +0100

    Use header bars in dialogs
    
    ... and use GTK_RESPONSE_CLOSE instead of GTK_RESPONSE_OK so that the
    close button is hidden.
    
    Currently, setting use-header-bar in a template UI definition does not
    work.
    
    Bump minimum GTK+ version to 3.11.5.

 configure.ac                            |    2 +-
 src/photos-dlna-renderers-dialog.c      |    6 +++++-
 src/photos-organize-collection-dialog.c |    5 +++--
 src/photos-properties-dialog.c          |    5 +++--
 src/photos-selection-toolbar.c          |    2 +-
 5 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5a141cb..0d3a114 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ GFBGRAPH_MIN_VERSION=0.2.1
 GLIB_MIN_VERSION=2.35.1
 GOA_MIN_VERSION=3.8.0
 GRILO_MIN_VERSION=0.2.6
-GTK_MIN_VERSION=3.11.4
+GTK_MIN_VERSION=3.11.5
 LIBEXIF_MIN_VERSION=0.6.14
 LIBRSVG_MIN_VERSION=2.26.0
 
diff --git a/src/photos-dlna-renderers-dialog.c b/src/photos-dlna-renderers-dialog.c
index 985f3d8..d1f077c 100644
--- a/src/photos-dlna-renderers-dialog.c
+++ b/src/photos-dlna-renderers-dialog.c
@@ -277,5 +277,9 @@ photos_dlna_renderers_dialog_new (GtkWindow *parent, const gchar *urn)
 {
   g_return_val_if_fail (GTK_IS_WINDOW (parent), NULL);
 
-  return g_object_new (PHOTOS_TYPE_DLNA_RENDERERS_DIALOG, "transient-for", parent, "urn", urn, NULL);
+  return g_object_new (PHOTOS_TYPE_DLNA_RENDERERS_DIALOG,
+                       "transient-for", parent,
+                       "urn", urn,
+                       "use-header-bar", TRUE,
+                       NULL);
 }
diff --git a/src/photos-organize-collection-dialog.c b/src/photos-organize-collection-dialog.c
index 7904d38..80084c0 100644
--- a/src/photos-organize-collection-dialog.c
+++ b/src/photos-organize-collection-dialog.c
@@ -74,8 +74,8 @@ photos_organize_collection_dialog_init (PhotosOrganizeCollectionDialog *self)
   priv = self->priv;
 
   gtk_dialog_add_button (GTK_DIALOG (self), _("_Add"), GTK_RESPONSE_ACCEPT);
-  ok_button = gtk_dialog_add_button (GTK_DIALOG (self), _("_OK"), GTK_RESPONSE_OK);
-  gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
+  ok_button = gtk_dialog_add_button (GTK_DIALOG (self), _("_OK"), GTK_RESPONSE_CLOSE);
+  gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_CLOSE);
 
   content_area = gtk_dialog_get_content_area (GTK_DIALOG (self));
   sw = gtk_scrolled_window_new (NULL, NULL);
@@ -127,5 +127,6 @@ photos_organize_collection_dialog_new (GtkWindow *parent)
                        /* Translators: "Organize" refers to photos in this context */
                        "title", C_("Dialog title", "Organize"),
                        "transient-for", parent,
+                       "use-header-bar", TRUE,
                        NULL);
 }
diff --git a/src/photos-properties-dialog.c b/src/photos-properties-dialog.c
index 7e4ec6f..cb4209f 100644
--- a/src/photos-properties-dialog.c
+++ b/src/photos-properties-dialog.c
@@ -614,8 +614,8 @@ photos_properties_dialog_init (PhotosPropertiesDialog *self)
   priv->item_mngr = photos_item_manager_dup_singleton ();
   priv->camera_cache = photos_camera_cache_dup_singleton ();
 
-  gtk_dialog_add_button (GTK_DIALOG (self), _("Done"), GTK_RESPONSE_OK);
-  gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
+  gtk_dialog_add_button (GTK_DIALOG (self), _("Done"), GTK_RESPONSE_CLOSE);
+  gtk_dialog_set_default_response (GTK_DIALOG (self), GTK_RESPONSE_CLOSE);
 }
 
 
@@ -653,5 +653,6 @@ photos_properties_dialog_new (GtkWindow *parent, const gchar *urn)
                        "title", _("Properties"),
                        "transient-for", parent,
                        "urn", urn,
+                       "use-header-bar", TRUE,
                        NULL);
 }
diff --git a/src/photos-selection-toolbar.c b/src/photos-selection-toolbar.c
index a1e4904..5aa3221 100644
--- a/src/photos-selection-toolbar.c
+++ b/src/photos-selection-toolbar.c
@@ -69,7 +69,7 @@ photos_selection_toolbar_dialog_response (GtkDialog *dialog, gint response_id, g
 {
   PhotosSelectionToolbar *self = PHOTOS_SELECTION_TOOLBAR (user_data);
 
-  if (response_id != GTK_RESPONSE_OK)
+  if (response_id != GTK_RESPONSE_CLOSE)
     return;
 
   gtk_widget_destroy (GTK_WIDGET (dialog));


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