[gtk+] Use suggested-action style
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use suggested-action style
- Date: Sun, 26 Jan 2014 15:44:27 +0000 (UTC)
commit 9347d27040b6d2d1b90dd63ecb8f097d75d5d3dd
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Jan 26 10:41:26 2014 -0500
Use suggested-action style
When using header bars, make the default button in
GtkDialog use the suggested-action style.
gtk/gtkdialog.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index b000daa..2d1f069 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -428,7 +428,10 @@ add_action_widgets (GtkDialog *dialog)
g_object_unref (child);
if (has_default)
- gtk_widget_grab_default (child);
+ {
+ gtk_widget_grab_default (child);
+ gtk_style_context_add_class (gtk_widget_get_style_context (child), "suggested-action");
+ }
}
g_list_free (children);
}
@@ -1104,7 +1107,11 @@ gtk_dialog_set_default_response (GtkDialog *dialog,
ResponseData *rd = get_response_data (widget, FALSE);
if (rd && rd->response_id == response_id)
- gtk_widget_grab_default (widget);
+ {
+ gtk_widget_grab_default (widget);
+ if (dialog->priv->constructed && dialog->priv->use_header_bar == 1)
+ gtk_style_context_add_class (gtk_widget_get_style_context (widget), "suggested-action");
+ }
tmp_list = g_list_next (tmp_list);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]