diff options
author | Gordon Norman Squash <gordsqsh@protonmail.com> | 2024-09-29 18:43:44 -0400 |
---|---|---|
committer | Gordon Norman Squash <gordsqsh@protonmail.com> | 2024-09-29 18:43:44 -0400 |
commit | 59e1d8332530d70c0ed9fabd01b896b83efc72b5 (patch) | |
tree | bc9dcec3c5b0ed4295eeff378856779889dca1a9 /data | |
parent | License changed to LGPL-2 to match GTK license (diff) | |
download | gtk3-classic-module-59e1d8332530d70c0ed9fabd01b896b83efc72b5.tar.gz gtk3-classic-module-59e1d8332530d70c0ed9fabd01b896b83efc72b5.tar.bz2 gtk3-classic-module-59e1d8332530d70c0ed9fabd01b896b83efc72b5.zip |
Draw tree view rows in alternating colours ('zebra stripes')
NOTE:
Please see the README and the file `data/zebra-stripes.css` for information
on how to actually activate the zebra stripes.
Diffstat (limited to 'data')
-rw-r--r-- | data/zebra-stripes.css | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/data/zebra-stripes.css b/data/zebra-stripes.css index 5f13d79..e89c09d 100644 --- a/data/zebra-stripes.css +++ b/data/zebra-stripes.css @@ -1,16 +1,31 @@ -/* TODO: This is currently unused, but when alternating treeview row colours - * are restored, this will be the default CSS code to activate them if the - * current theme doesn't provide its own code for this. +/* This file enables alternating light and dark row colours ('zebra stripes') + * in tree view widgets. These are general good default colours for light + * themes. You can enable zebra stripes by copying this file to your + * ~/.config/gtk-3.0/gtk.css file, or you can implement similar code in your + * theme CSS. + * + * Note the extra CSS selectors which theme only tree views with more than + * one column; generally speaking, zebra stripes are only necessary when the + * list or tree contains more than one column. If you really want zebra + * stripes on all tree views, regardless of column count, remove the extra + * selectors for ':not(.first):not(.last)', '.first:not(.last)', and + * ':not(.first).last'. */ -treeview:not(:selected).odd.sorted, -treeview:not(:selected).even:not(.sorted) +treeview.cell:not(.first):not(.last):not(:selected).odd.sorted, +treeview.cell.first:not(.last):not(:selected).odd.sorted, +treeview.cell:not(.first).last:not(:selected).odd.sorted, +treeview.cell:not(.first):not(.last):not(:selected).even:not(.sorted), +treeview.cell.first:not(.last):not(:selected).even:not(.sorted), +treeview.cell:not(.first).last:not(:selected).even:not(.sorted) { background: alpha(black, 0.07); } -treeview:not(:selected).even.sorted +treeview.cell:not(.first):not(.last):not(:selected).even.sorted, +treeview.cell.first:not(.last):not(:selected).even.sorted, +treeview.cell:not(.first).last:not(:selected).even.sorted { background: alpha(black, 0.13); } |