mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-16 15:14:17 +00:00
mount operation: Use headerbar
Make GtkMountOperation use a headerbar for its dialog when desired.
This commit is contained in:
parent
066810ac00
commit
dc749c5a27
@ -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);
|
||||
|
||||
@ -532,6 +539,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
_("Co_nnect"), GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_OK);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_dialog_set_alternative_button_order (dialog,
|
||||
GTK_RESPONSE_OK,
|
||||
@ -1395,6 +1403,7 @@ create_show_processes_dialog (GtkMountOperation *op,
|
||||
GtkCellRenderer *renderer;
|
||||
GtkListStore *list_store;
|
||||
gchar *s;
|
||||
gboolean use_header;
|
||||
|
||||
priv = op->priv;
|
||||
|
||||
@ -1405,7 +1414,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,
|
||||
"use-header-bar", use_header,
|
||||
NULL);
|
||||
|
||||
if (priv->parent_window != NULL)
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), priv->parent_window);
|
||||
|
Loading…
Reference in New Issue
Block a user