[gtk+] all: add a "separator" style class
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] all: add a "separator" style class
- Date: Thu, 3 Mar 2011 22:50:00 +0000 (UTC)
commit d5c4a0f503e997b10586e74214422fcecb5e38c2
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Mar 2 22:55:25 2011 -0500
all: add a "separator" style class
gtk/gtkseparator.c | 4 ++++
gtk/gtkseparatormenuitem.c | 4 ++++
gtk/gtkseparatortoolitem.c | 5 +++++
gtk/gtkstylecontext.h | 7 +++++++
4 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkseparator.c b/gtk/gtkseparator.c
index 687139f..66c1888 100644
--- a/gtk/gtkseparator.c
+++ b/gtk/gtkseparator.c
@@ -101,6 +101,7 @@ static void
gtk_separator_init (GtkSeparator *separator)
{
GtkSeparatorPrivate *private;
+ GtkStyleContext *context;
separator->priv = G_TYPE_INSTANCE_GET_PRIVATE (separator,
GTK_TYPE_SEPARATOR,
@@ -110,6 +111,9 @@ gtk_separator_init (GtkSeparator *separator)
gtk_widget_set_has_window (GTK_WIDGET (separator), FALSE);
private->orientation = GTK_ORIENTATION_HORIZONTAL;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (separator));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
}
static void
diff --git a/gtk/gtkseparatormenuitem.c b/gtk/gtkseparatormenuitem.c
index b45873d..0a9569d 100644
--- a/gtk/gtkseparatormenuitem.c
+++ b/gtk/gtkseparatormenuitem.c
@@ -52,6 +52,10 @@ gtk_separator_menu_item_class_init (GtkSeparatorMenuItemClass *class)
static void
gtk_separator_menu_item_init (GtkSeparatorMenuItem *item)
{
+ GtkStyleContext *context;
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (item));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
}
/**
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index be45120..90ecf92 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -152,12 +152,17 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
static void
gtk_separator_tool_item_init (GtkSeparatorToolItem *separator_item)
{
+ GtkStyleContext *context;
+
separator_item->priv = G_TYPE_INSTANCE_GET_PRIVATE (separator_item,
GTK_TYPE_SEPARATOR_TOOL_ITEM,
GtkSeparatorToolItemPrivate);
separator_item->priv->draw = TRUE;
gtk_widget_set_has_window (GTK_WIDGET (separator_item), FALSE);
+
+ context = gtk_widget_get_style_context (GTK_WIDGET (separator_item));
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
}
static void
diff --git a/gtk/gtkstylecontext.h b/gtk/gtkstylecontext.h
index b0a278a..db19660 100644
--- a/gtk/gtkstylecontext.h
+++ b/gtk/gtkstylecontext.h
@@ -402,6 +402,13 @@ struct _GtkStyleContextClass
#define GTK_STYLE_CLASS_PANE_SEPARATOR "pane-separator"
/**
+ * GTK_STYLE_CLASS_SEPARATOR:
+ *
+ * A CSS class for a separator.
+ */
+#define GTK_STYLE_CLASS_SEPARATOR "separator"
+
+/**
* GTK_STYLE_CLASS_INFO:
*
* A widget class for an area displaying an informational message,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]