mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
page setup dialog: Use headerbar
Make the page setup dialog use a headerbar when desired. https://bugzilla.gnome.org/show_bug.cgi?id=720059
This commit is contained in:
parent
bb951fe783
commit
f2d6ed3290
@ -43,6 +43,7 @@
|
||||
#include "gtkprintbackend.h"
|
||||
#include "gtkpapersize.h"
|
||||
#include "gtkprintutils.h"
|
||||
#include "gtkdialogprivate.h"
|
||||
|
||||
/**
|
||||
* SECTION:gtkpagesetupunixdialog
|
||||
@ -190,6 +191,19 @@ gtk_page_setup_unix_dialog_init (GtkPageSetupUnixDialog *dialog)
|
||||
priv->print_backends = NULL;
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (dialog));
|
||||
gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (dialog));
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
|
||||
_("_Cancel"), GTK_RESPONSE_CANCEL,
|
||||
_("_Apply"), GTK_RESPONSE_OK,
|
||||
NULL);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
||||
GTK_RESPONSE_OK,
|
||||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
/* Do this in code, we want the translatable strings without the markup */
|
||||
gtk_list_store_append (priv->printer_list, &iter);
|
||||
@ -213,12 +227,6 @@ gtk_page_setup_unix_dialog_init (GtkPageSetupUnixDialog *dialog)
|
||||
/* Load data */
|
||||
_gtk_print_load_custom_papers (priv->custom_paper_list);
|
||||
load_print_backends (dialog);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
gtk_dialog_set_alternative_button_order (GTK_DIALOG (dialog),
|
||||
GTK_RESPONSE_OK,
|
||||
GTK_RESPONSE_CANCEL,
|
||||
-1);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -28,53 +28,12 @@
|
||||
<property name="border_width">5</property>
|
||||
<property name="resizable">False</property>
|
||||
<property name="type_hint">dialog</property>
|
||||
<property name="title" translatable="yes">Page Setup</property>
|
||||
<child internal-child="vbox">
|
||||
<object class="GtkBox" id="dialog-vbox1">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">2</property>
|
||||
<child internal-child="action_area">
|
||||
<object class="GtkButtonBox" id="dialog-action_area1">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="layout_style">end</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="cancel_button">
|
||||
<property name="label" translatable="yes">_Cancel</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="apply_button">
|
||||
<property name="label" translatable="yes">_Apply</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="can_default">True</property>
|
||||
<property name="has_default">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="pack_type">end</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="visible">True</property>
|
||||
@ -400,14 +359,10 @@
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<action-widgets>
|
||||
<action-widget response="-6">cancel_button</action-widget>
|
||||
<action-widget response="-5">apply_button</action-widget>
|
||||
</action-widgets>
|
||||
</template>
|
||||
</interface>
|
||||
|
@ -1,5 +1,4 @@
|
||||
N_("_Cancel");
|
||||
N_("_Apply");
|
||||
N_("Page Setup");
|
||||
N_("_Format for:");
|
||||
N_("_Paper size:");
|
||||
N_("_Orientation:");
|
||||
|
Loading…
Reference in New Issue
Block a user