Fix treeview background, fixes #4855
This also therefore fixes #4857
This also introduces the requirement of using gi.repository.Gtk
during build time of sugar artwork.
Sam Parkinson
8 years ago
0 | 0 | ${ |
1 | 1 | import math |
2 | from gi.repository import Gtk | |
3 | ||
4 | gtk_major = int(Gtk.get_major_version()) | |
5 | gtk_minor = int(Gtk.get_minor_version()) | |
6 | treeview_pseudo_element = gtk_major >= 3 and gtk_minor > 8 | |
2 | 7 | |
3 | 8 | def my_floor(num): |
4 | 9 | return int(math.floor(num)) |
220 | 225 | border-width: 0px; |
221 | 226 | } |
222 | 227 | |
223 | GtkTreeView row:nth-child(even) { | |
228 | $[if treeview_pseudo_element] GtkTreeView row:even | |
229 | $[else] GtkTreeView row:nth-child(even) | |
230 | $[end if] { | |
224 | 231 | background-color: @row_even; |
225 | 232 | } |
226 | GtkTreeView row:nth-child(odd) { | |
233 | $[if treeview_pseudo_element] GtkTreeView row:odd | |
234 | $[else] GtkTreeView row:nth-child(odd) | |
235 | $[end if] { | |
227 | 236 | background-color: @row_odd; |
228 | 237 | } |
229 | 238 |