[gtk+] treeview: add GTK_STYLE_CLASS_SEPARATOR for tree view separators
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] treeview: add GTK_STYLE_CLASS_SEPARATOR for tree view separators
- Date: Fri, 2 Sep 2011 19:11:28 +0000 (UTC)
commit 640f06928f33e97441f5fc248962d20383f72f10
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Thu Sep 1 14:12:49 2011 -0400
treeview: add GTK_STYLE_CLASS_SEPARATOR for tree view separators
https://bugzilla.gnome.org/show_bug.cgi?id=657985
gtk/gtktreeview.c | 61 ++++++++++++++++++++++++++++++++++------------------
1 files changed, 40 insertions(+), 21 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index b833770..0ebc138 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5005,18 +5005,28 @@ gtk_tree_view_bin_draw (GtkWidget *widget,
expander_cell_width = cell_area.width;
if (is_separator)
- gtk_render_line (context, cr,
- cell_area.x,
- cell_area.y + cell_area.height / 2,
- cell_area.x + cell_area.width,
- cell_area.y + cell_area.height / 2);
+ {
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+
+ gtk_render_line (context, cr,
+ cell_area.x,
+ cell_area.y + cell_area.height / 2,
+ cell_area.x + cell_area.width,
+ cell_area.y + cell_area.height / 2);
+
+ gtk_style_context_restore (context);
+ }
else
- _gtk_tree_view_column_cell_render (column,
- cr,
- &background_area,
- &cell_area,
- flags,
- draw_focus);
+ {
+ _gtk_tree_view_column_cell_render (column,
+ cr,
+ &background_area,
+ &cell_area,
+ flags,
+ draw_focus);
+ }
+
if (gtk_tree_view_draw_expanders (tree_view)
&& (node->flags & GTK_RBNODE_IS_PARENT) == GTK_RBNODE_IS_PARENT)
{
@@ -14559,17 +14569,26 @@ gtk_tree_view_create_row_drag_icon (GtkTreeView *tree_view,
if (gtk_tree_view_column_cell_is_visible (column))
{
if (is_separator)
- gtk_render_line (context, cr,
- cell_area.x,
- cell_area.y + cell_area.height / 2,
- cell_area.x + cell_area.width,
- cell_area.y + cell_area.height / 2);
+ {
+ gtk_style_context_save (context);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
+
+ gtk_render_line (context, cr,
+ cell_area.x,
+ cell_area.y + cell_area.height / 2,
+ cell_area.x + cell_area.width,
+ cell_area.y + cell_area.height / 2);
+
+ gtk_style_context_restore (context);
+ }
else
- _gtk_tree_view_column_cell_render (column,
- cr,
- &background_area,
- &cell_area,
- 0, FALSE);
+ {
+ _gtk_tree_view_column_cell_render (column,
+ cr,
+ &background_area,
+ &cell_area,
+ 0, FALSE);
+ }
}
cell_offset += gtk_tree_view_column_get_width (column);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]