-
Notifications
You must be signed in to change notification settings - Fork 26
/
appearance__message-dialogs.patch
149 lines (139 loc) · 6.01 KB
/
appearance__message-dialogs.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Index: b/gtk/gtkdialog.c
===================================================================
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -700,12 +700,12 @@ update_spacings (GtkDialog *dialog)
/* don't set spacing when buttons are linked */
if (gtk_button_box_get_layout (GTK_BUTTON_BOX (priv->action_area)) != GTK_BUTTONBOX_EXPAND)
- gtk_box_set_spacing (GTK_BOX (priv->action_area), button_spacing);
+ gtk_box_set_spacing (GTK_BOX (priv->action_area), (button_spacing == 0) ? 6 : button_spacing);
if (!_gtk_container_get_border_width_set (GTK_CONTAINER (priv->action_area)))
{
gtk_container_set_border_width (GTK_CONTAINER (priv->action_area),
- action_area_border);
+ (action_area_border == 0) ? 5 : action_area_border);
_gtk_container_set_border_width_set (GTK_CONTAINER (priv->action_area), FALSE);
}
}
Index: b/gtk/gtkmessagedialog.c
===================================================================
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -37,6 +37,7 @@
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtktypebuiltins.h"
+#include "gtkcssprovider.h"
/**
* SECTION:gtkmessagedialog
@@ -327,7 +328,17 @@ gtk_message_dialog_init (GtkMessageDialo
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
G_GNUC_END_IGNORE_DEPRECATIONS
- gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
+ static gboolean style_added = FALSE;
+ if (!style_added)
+ {
+ style_added = TRUE;
+ GtkCssProvider *provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "messagedialog > *, messagedialog buttonbox.dialog-action-area, messagedialog box.dialog-action-box { margin: 0; margin-top: 0; padding: 0; }",
+ -1, NULL);
+ gtk_style_context_add_provider_for_screen (gtk_widget_get_screen (GTK_WIDGET (dialog)),
+ GTK_STYLE_PROVIDER (provider), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ }
settings = gtk_widget_get_settings (GTK_WIDGET (dialog));
g_object_get (settings, "gtk-keynav-use-caret", &use_caret, NULL);
@@ -372,6 +383,7 @@ setup_type (GtkMessageDialog *dialog,
{
GtkMessageDialogPrivate *priv = dialog->priv;
const gchar *name = NULL;
+ const gchar *icon = NULL;
AtkObject *atk_obj;
if (priv->message_type == type)
@@ -383,18 +395,22 @@ setup_type (GtkMessageDialog *dialog,
{
case GTK_MESSAGE_INFO:
name = _("Information");
+ icon = "dialog-information";
break;
case GTK_MESSAGE_QUESTION:
name = _("Question");
+ icon = "dialog-question";
break;
case GTK_MESSAGE_WARNING:
name = _("Warning");
+ icon = "dialog-warning";
break;
case GTK_MESSAGE_ERROR:
name = _("Error");
+ icon = "dialog-error";
break;
case GTK_MESSAGE_OTHER:
@@ -405,6 +421,12 @@ setup_type (GtkMessageDialog *dialog,
break;
}
+ if (icon)
+ {
+ GtkWidget *image = gtk_image_new_from_icon_name (icon, GTK_ICON_SIZE_DIALOG);
+ g_object_set (image, "visible", TRUE, NULL);
+ g_object_set (dialog, "image", image, NULL);
+ }
atk_obj = gtk_widget_get_accessible (GTK_WIDGET (dialog));
if (GTK_IS_ACCESSIBLE (atk_obj))
{
Index: b/gtk/ui/gtkmessagedialog.ui
===================================================================
--- a/gtk/ui/gtkmessagedialog.ui
+++ b/gtk/ui/gtkmessagedialog.ui
@@ -6,6 +6,7 @@
<property name="resizable">0</property>
<property name="type-hint">dialog</property>
<property name="skip-taskbar-hint">1</property>
+ <property name="border-width">5</property>
<child internal-child="headerbar">
<object class="GtkHeaderBar" id="headerbar1">
<property name="visible">1</property>
@@ -14,23 +15,25 @@
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="orientation">vertical</property>
- <property name="spacing">20</property>
- <property name="border-width">0</property>
+ <property name="spacing">8</property>
+ <property name="border-width">2</property>
<child>
<object class="GtkBox" id="box">
<property name="visible">1</property>
- <property name="margin-start">30</property>
- <property name="margin-end">30</property>
- <property name="spacing">30</property>
+ <property name="margin-start">2</property>
+ <property name="margin-end">2</property>
+ <property name="spacing">12</property>
+ <property name="border-width">5</property>
<child>
<object class="GtkBox" id="message_area">
<property name="visible">1</property>
<property name="orientation">vertical</property>
- <property name="spacing">10</property>
+ <property name="spacing">12</property>
<child>
<object class="GtkLabel" id="label">
<property name="visible">1</property>
- <property name="halign">center</property>
+ <property name="halign">start</property>
+ <property name="xalign">0</property>
<property name="valign">start</property>
<property name="wrap">1</property>
<property name="max-width-chars">60</property>
@@ -43,7 +46,8 @@
<object class="GtkLabel" id="secondary_label">
<property name="no-show-all">1</property>
<property name="margin-bottom">2</property>
- <property name="halign">center</property>
+ <property name="halign">start</property>
+ <property name="xalign">0</property>
<property name="valign">start</property>
<property name="wrap">1</property>
<property name="max-width-chars">60</property>