[gtk+] GtkPathBar: Set style classes on buttons
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkPathBar: Set style classes on buttons
- Date: Wed, 23 Jul 2014 16:44:36 +0000 (UTC)
commit 0d1d17107f69d4377a7d18be466ae3fa2816335b
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jul 23 12:42:27 2014 -0400
GtkPathBar: Set style classes on buttons
Set text-button/image-button on these, just like we do for
buttons everywhere else.
gtk/gtkpathbar.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index ec1f5ed..208a810 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1527,15 +1527,25 @@ gtk_path_bar_update_button_appearance (GtkPathBar *path_bar,
gboolean current_dir)
{
const gchar *dir_name = get_dir_name (button_data);
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (button_data->button);
+
+ gtk_style_context_remove_class (context, "text-button");
+ gtk_style_context_remove_class (context, "image-button");
if (button_data->label != NULL)
{
gtk_label_set_text (GTK_LABEL (button_data->label), dir_name);
+ if (button_data->image == NULL)
+ gtk_style_context_add_class (context, "text-button");
}
if (button_data->image != NULL)
{
set_button_image (path_bar, button_data);
+ if (button_data->label == NULL)
+ gtk_style_context_add_class (context, "image-button");
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button)) != current_dir)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]