[Sugar-devel] [PATCH sugar-artwork 2/2] Set background color for GtkTreeView rows with odd-even flags SL #3726

Benjamin Berg benzea at sugarlabs.org
Mon Jun 25 08:06:32 EDT 2012


On Mon, 2012-06-25 at 08:54 -0300, Manuel Quiñones wrote:
> This is only applied if the GtkTreeView has the "rules-hint" property
> set to True.

I haven't actually tried what exactly this looks like, but using #d5d5d5
for the row odd color seems good. And the patch itself looks sane
too :-)

> Signed-off-by: Manuel Quiñones <manuq at laptop.org>
Reviewed-by: Benjamin Berg <benzea at sugarlabs.org>

> ---
>  gtk3/theme/gtk-widgets.css.em |    7 +++++++
>  gtk3/theme/gtk.css            |    2 ++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/gtk3/theme/gtk-widgets.css.em b/gtk3/theme/gtk-widgets.css.em
> index 91c998c..f3e4fde 100644
> --- a/gtk3/theme/gtk-widgets.css.em
> +++ b/gtk3/theme/gtk-widgets.css.em
> @@ -215,6 +215,13 @@ GtkToggleButton.button:active GtkLabel {
>      background-color: @white;
>  }
>  
> +GtkTreeView row:nth-child(even) {
> +    background-color: @row_even;
> +}
> +GtkTreeView row:nth-child(odd) {
> +    background-color: @row_odd;
> +}
> +
>  .entry {
>      border-radius: $(2 * subcell_size)px;
>      border-width: $(thickness)px;
> diff --git a/gtk3/theme/gtk.css b/gtk3/theme/gtk.css
> index 7c95e5f..8b55cc6 100644
> --- a/gtk3/theme/gtk.css
> +++ b/gtk3/theme/gtk.css
> @@ -6,6 +6,8 @@
>  @define-color selection_grey #A6A6A6;
>  @define-color panel_grey #C0C0C0;
>  @define-color text_field_grey #E5E5E5;
> + at define-color row_even #E5E5E5;
> + at define-color row_odd #D5D5D5;
>  @define-color white #FFFFFF;
>  
>  /* Default color scheme */




More information about the Sugar-devel mailing list