[gtk+/dialogs: 23/25] mount operation: Use headerbar



commit 36e8121fc44c2d499193fc5662550a78fcb9a3f2
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jan 15 06:23:38 2014 -0500

    mount operation: Use headerbar
    
    Make GtkMountOperation use a headerbar for its dialog
    when desired.

 gtk/gtkmountoperation.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 65f994c..6e63fa3 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -48,6 +48,7 @@
 #include "gtkicontheme.h"
 #include "gtkmenuitem.h"
 #include "gtkmain.h"
+#include "gtksettings.h"
 
 #include <glib/gprintf.h>
 
@@ -503,10 +504,16 @@ gtk_mount_operation_ask_password_do_gtk (GtkMountOperation *operation,
   gchar *primary;
   const gchar *secondary;
   PangoAttrList *attrs;
+  gboolean use_header;
 
   priv = operation->priv;
 
-  widget = gtk_dialog_new ();
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header,
+                NULL);
+  widget = g_object_new (GTK_TYPE_DIALOG,
+                         "use-header-bar", use_header,
+                         NULL);
   dialog = GTK_DIALOG (widget);
   window = GTK_WINDOW (widget);
 
@@ -1392,6 +1399,7 @@ create_show_processes_dialog (GtkMountOperation *op,
   GtkCellRenderer *renderer;
   GtkListStore *list_store;
   gchar *s;
+  gboolean use_header;
 
   priv = op->priv;
 
@@ -1402,7 +1410,12 @@ create_show_processes_dialog (GtkMountOperation *op,
       primary = g_strndup (message, primary - message);
     }
 
-  dialog = gtk_dialog_new ();
+  g_object_get (gtk_settings_get_default (),
+                "gtk-dialogs-use-header", &use_header,
+                NULL);
+  dialog = g_object_new (GTK_TYPE_DIALOG,
+                         "gtk-dialogs-use-header", use_header,
+                         NULL);
 
   if (priv->parent_window != NULL)
     gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);


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