[gtk+] GtkToolButton: Apply expected button style classes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkToolButton: Apply expected button style classes
- Date: Sat, 11 Oct 2014 12:29:42 +0000 (UTC)
commit 30738fbfdd1987bb20adaf09be04c1685f29afdb
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 11 08:28:55 2014 -0400
GtkToolButton: Apply expected button style classes
Add .image-button or .text-button to the button within,
so our css works as expected for toolbar buttons too.
gtk/gtktoolbutton.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 5b47a59..07344cd 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -592,7 +592,8 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
{
case GTK_TOOLBAR_ICONS:
if (icon)
- gtk_container_add (GTK_CONTAINER (button->priv->button), icon);
+ gtk_container_add (GTK_CONTAINER (button->priv->button), icon);
+ gtk_style_context_add_class (gtk_widget_get_style_context (button->priv->button), "image-button");
break;
case GTK_TOOLBAR_BOTH:
@@ -628,6 +629,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
case GTK_TOOLBAR_TEXT:
gtk_container_add (GTK_CONTAINER (button->priv->button), label);
+ gtk_style_context_add_class (gtk_widget_get_style_context (button->priv->button), "text-button");
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]