[gtk+] csd: Use a dedicated style class for window buttons
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] csd: Use a dedicated style class for window buttons
- Date: Sat, 29 Jun 2013 23:00:51 +0000 (UTC)
commit da55c86d3f3a47b401882bb68a9eaf6a83495f3f
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 29 18:09:11 2013 -0400
csd: Use a dedicated style class for window buttons
This allows themes to differentiate between regular buttons
in a title bar, and window buttons.
gtk/gtkwindow.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 5e73e18..b03018a 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5119,6 +5119,7 @@ update_window_buttons (GtkWindow *window)
if (strcmp (t[j], "icon") == 0)
{
button = gtk_image_new ();
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton");
gtk_widget_set_size_request (button, 20, 20);
gtk_widget_show (button);
if (icon != NULL)
@@ -5135,6 +5136,7 @@ update_window_buttons (GtkWindow *window)
priv->gdk_type_hint == GDK_WINDOW_TYPE_HINT_NORMAL)
{
button = gtk_button_new ();
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton");
image = gtk_image_new_from_icon_name ("window-minimize-symbolic", GTK_ICON_SIZE_MENU);
g_object_set (image, "use-fallback", TRUE, NULL);
gtk_container_add (GTK_CONTAINER (button), image);
@@ -5152,6 +5154,7 @@ update_window_buttons (GtkWindow *window)
icon_name = maximized ? "window-restore-symbolic" : "window-maximize-symbolic";
button = gtk_button_new ();
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton");
image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
g_object_set (image, "use-fallback", TRUE, NULL);
gtk_container_add (GTK_CONTAINER (button), image);
@@ -5167,6 +5170,7 @@ update_window_buttons (GtkWindow *window)
{
button = gtk_button_new ();
image = gtk_image_new_from_icon_name ("window-delete-symbolic", GTK_ICON_SIZE_MENU);
+ gtk_style_context_add_class (gtk_widget_get_style_context (button), "titlebutton");
g_object_set (image, "use-fallback", TRUE, NULL);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_set_can_focus (button, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]