treeview: don't use wide-separators/separator-height
Those style properties are on their way out; instead, use min-height with the separator style class to obtain the height.
This commit is contained in:
parent
2eb7e6a85a
commit
64a06adfc0
@ -24,6 +24,7 @@
|
|||||||
#include "gtktreeview.h"
|
#include "gtktreeview.h"
|
||||||
|
|
||||||
#include "gtkadjustmentprivate.h"
|
#include "gtkadjustmentprivate.h"
|
||||||
|
#include "gtkcssnumbervalueprivate.h"
|
||||||
#include "gtkrbtree.h"
|
#include "gtkrbtree.h"
|
||||||
#include "gtktreednd.h"
|
#include "gtktreednd.h"
|
||||||
#include "gtktreeprivate.h"
|
#include "gtktreeprivate.h"
|
||||||
@ -6239,6 +6240,32 @@ node_is_visible (GtkTreeView *tree_view,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gint
|
||||||
|
get_separator_height (GtkTreeView *tree_view)
|
||||||
|
{
|
||||||
|
GtkStyleContext *context;
|
||||||
|
GtkCssStyle *style;
|
||||||
|
gdouble d;
|
||||||
|
gint min_size;
|
||||||
|
|
||||||
|
context = gtk_widget_get_style_context (GTK_WIDGET (tree_view));
|
||||||
|
gtk_style_context_save (context);
|
||||||
|
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
|
||||||
|
|
||||||
|
style = gtk_style_context_lookup_style (context);
|
||||||
|
d = _gtk_css_number_value_get
|
||||||
|
(gtk_css_style_get_value (style, GTK_CSS_PROPERTY_MIN_HEIGHT), 100);
|
||||||
|
|
||||||
|
if (d < 1)
|
||||||
|
min_size = ceil (d);
|
||||||
|
else
|
||||||
|
min_size = floor (d);
|
||||||
|
|
||||||
|
gtk_style_context_restore (context);
|
||||||
|
|
||||||
|
return min_size;
|
||||||
|
}
|
||||||
|
|
||||||
/* Returns TRUE if it updated the size
|
/* Returns TRUE if it updated the size
|
||||||
*/
|
*/
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -6259,8 +6286,6 @@ validate_row (GtkTreeView *tree_view,
|
|||||||
gboolean is_separator = FALSE;
|
gboolean is_separator = FALSE;
|
||||||
gboolean draw_vgrid_lines, draw_hgrid_lines;
|
gboolean draw_vgrid_lines, draw_hgrid_lines;
|
||||||
gint grid_line_width;
|
gint grid_line_width;
|
||||||
gboolean wide_separators;
|
|
||||||
gint separator_height;
|
|
||||||
gint expander_size;
|
gint expander_size;
|
||||||
|
|
||||||
/* double check the row needs validating */
|
/* double check the row needs validating */
|
||||||
@ -6274,8 +6299,6 @@ validate_row (GtkTreeView *tree_view,
|
|||||||
"horizontal-separator", &horizontal_separator,
|
"horizontal-separator", &horizontal_separator,
|
||||||
"vertical-separator", &vertical_separator,
|
"vertical-separator", &vertical_separator,
|
||||||
"grid-line-width", &grid_line_width,
|
"grid-line-width", &grid_line_width,
|
||||||
"wide-separators", &wide_separators,
|
|
||||||
"separator-height", &separator_height,
|
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
draw_vgrid_lines =
|
draw_vgrid_lines =
|
||||||
@ -6329,10 +6352,7 @@ validate_row (GtkTreeView *tree_view,
|
|||||||
|
|
||||||
if (is_separator)
|
if (is_separator)
|
||||||
{
|
{
|
||||||
if (wide_separators)
|
height = get_separator_height (tree_view);
|
||||||
height = separator_height;
|
|
||||||
else
|
|
||||||
height = 2;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1352,9 +1352,12 @@ treeview.view {
|
|||||||
&:backdrop { color: $backdrop_insensitive_color; }
|
&:backdrop { color: $backdrop_insensitive_color; }
|
||||||
}
|
}
|
||||||
|
|
||||||
&.separator:backdrop {
|
&.separator {
|
||||||
|
min-height: 2px;
|
||||||
|
&:backdrop {
|
||||||
color: transparentize(black, 0.9);
|
color: transparentize(black, 0.9);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
&:backdrop {
|
&:backdrop {
|
||||||
border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
|
border-left-color: mix($backdrop_fg_color, $backdrop_bg_color, 50%);
|
||||||
|
@ -1998,6 +1998,8 @@ treeview.view {
|
|||||||
color: #648eba; }
|
color: #648eba; }
|
||||||
treeview.view:disabled:backdrop {
|
treeview.view:disabled:backdrop {
|
||||||
color: #5d6767; }
|
color: #5d6767; }
|
||||||
|
treeview.view.separator {
|
||||||
|
min-height: 2px; }
|
||||||
treeview.view.separator:backdrop {
|
treeview.view.separator:backdrop {
|
||||||
color: rgba(0, 0, 0, 0.1); }
|
color: rgba(0, 0, 0, 0.1); }
|
||||||
treeview.view:backdrop {
|
treeview.view:backdrop {
|
||||||
|
@ -1998,6 +1998,8 @@ treeview.view {
|
|||||||
color: #80b1e4; }
|
color: #80b1e4; }
|
||||||
treeview.view:disabled:backdrop {
|
treeview.view:disabled:backdrop {
|
||||||
color: #c3c3c0; }
|
color: #c3c3c0; }
|
||||||
|
treeview.view.separator {
|
||||||
|
min-height: 2px; }
|
||||||
treeview.view.separator:backdrop {
|
treeview.view.separator:backdrop {
|
||||||
color: rgba(0, 0, 0, 0.1); }
|
color: rgba(0, 0, 0, 0.1); }
|
||||||
treeview.view:backdrop {
|
treeview.view:backdrop {
|
||||||
|
Loading…
Reference in New Issue
Block a user