150 lines
6.0 KiB
Diff
150 lines
6.0 KiB
Diff
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 = "gtk-dialog-info";
|
|
break;
|
|
|
|
case GTK_MESSAGE_QUESTION:
|
|
name = _("Question");
|
|
+ icon = "gtk-dialog-question";
|
|
break;
|
|
|
|
case GTK_MESSAGE_WARNING:
|
|
name = _("Warning");
|
|
+ icon = "gtk-dialog-warning";
|
|
break;
|
|
|
|
case GTK_MESSAGE_ERROR:
|
|
name = _("Error");
|
|
+ icon = "gtk-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>
|