[gtk+] csd: Use symbolic icons for window buttons
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] csd: Use symbolic icons for window buttons
- Date: Wed, 10 Apr 2013 10:13:51 +0000 (UTC)
commit c402e892998f5c7c30b16248399380f999846c86
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Apr 10 06:13:26 2013 -0400
csd: Use symbolic icons for window buttons
With symbolic icons, we can recolor the icons as needed, and we
can use icon shadows, etc.
gtk/gtkwindow.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 49212f8..3fadcd1 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5056,6 +5056,7 @@ update_window_buttons (GtkWindow *window)
for (j = 0; t[j]; j++)
{
GtkWidget *button = NULL;
+ GtkWidget *image = NULL;
if (strcmp (t[j], "icon") == 0)
{
@@ -5076,8 +5077,9 @@ update_window_buttons (GtkWindow *window)
priv->gdk_type_hint == GDK_WINDOW_TYPE_HINT_NORMAL)
{
button = gtk_button_new ();
- gtk_container_add (GTK_CONTAINER (button),
- gtk_image_new_from_icon_name ("window-minimize",
GTK_ICON_SIZE_MENU));
+ 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);
gtk_style_context_add_class (gtk_widget_get_style_context (button),
"window-minimize-button");
gtk_widget_set_can_focus (button, FALSE);
gtk_widget_show_all (button);
@@ -5098,10 +5100,11 @@ update_window_buttons (GtkWindow *window)
maximized = gdk_window_get_state (win) & GDK_WINDOW_STATE_MAXIMIZED;
else
maximized = FALSE;
- icon_name = maximized ? "window-restore" : "window-maximize";
+ icon_name = maximized ? "window-restore-symbolic" : "window-maximize-symbolic";
button = gtk_button_new ();
- gtk_container_add (GTK_CONTAINER (button),
- gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU));
+ 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);
gtk_style_context_add_class (gtk_widget_get_style_context (button),
"window-maximize-button");
gtk_widget_set_can_focus (button, FALSE);
gtk_widget_show_all (button);
@@ -5114,8 +5117,9 @@ update_window_buttons (GtkWindow *window)
priv->gdk_type_hint == GDK_WINDOW_TYPE_HINT_NORMAL)
{
button = gtk_button_new ();
- gtk_container_add (GTK_CONTAINER (button),
- gtk_image_new_from_icon_name ("window-delete", GTK_ICON_SIZE_MENU));
+ image = gtk_image_new_from_icon_name ("window-delete-symbolic", GTK_ICON_SIZE_MENU);
+ g_object_set (image, "use-fallback", TRUE, NULL);
+ gtk_container_add (GTK_CONTAINER (button), image);
gtk_style_context_add_class (gtk_widget_get_style_context (button),
"window-close-button");
gtk_widget_set_can_focus (button, FALSE);
gtk_widget_show_all (button);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]