Remove ignored style properties from CSS

Authored by andrzej1_1 on Feb 15 2019, 4:50 PM.

Description

Remove ignored style properties from CSS

Summary:
When I was running GTK3 application pavucontrol, I was getting warnings:

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:127:35: The style property GtkButton:child-displacement-x is deprecated and shouldn't be used anymore. It will be removed in a future version

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:128:35: The style property GtkButton:child-displacement-y is deprecated and shouldn't be used anymore. It will be removed in a future version

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:129:34: The style property GtkCheckButton:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:130:36: The style property GtkCheckMenuItem:indicator-size is deprecated and shouldn't be used anymore. It will be removed in a future version

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:132:46: The style property GtkScrolledWindow:scrollbars-within-bevel is deprecated and shouldn't be used anymore. It will be removed in a future version

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:135:30: The style property GtkExpander:expander-size is
deprecated and shouldn't be used anymore. It will be removed in a future version

(pavucontrol:10863): Gtk-WARNING **: 10:09:55.669: Theme parsing error: gtk.css:142:29: The style property GtkStatusbar:shadow-type is deprecated and shouldn't be used anymore. It will be removed in a future version

This was annoying, so I decided to fix it. Firstly I thought it is a application problem, but then I discovered it is breeze-gtk issue. For example GTK3 documentation states that:

GtkStatusbar:shadow-type has been deprecated since version 3.20 and should not be used in newly-written code.

Use CSS properties to determine the appearance, the value of this style property is ignored.

So if some styles are ignored, I can remove them and get rid of part of warnings:

  1. I wrote python script for finding all deprecation messages in docs:
  2. I ran script and saved results to file
  3. I used it to find all ignored properties in CSS:
$ find-deprecated-styles.py > /tmp/gtk-deprecated.txt
$ cd breeze-gtk/src/gtk320/
$ cat /tmp/gtk-deprecated.txt | sed -n 's/^ \* \([^ ]*\).*the value of this style property is ignored.*$/\1/p' | tr : -  | while read style; do grep -Rn $style; done
widgets/_base.scss:40:  -GtkStatusbar-shadow-type: none;
widgets/_base.scss:12:  -GtkButton-child-displacement-x: 0;
widgets/_base.scss:13:  -GtkButton-child-displacement-y: 0;
widgets/_base.scss:16:  -GtkCheckMenuItem-indicator-size: 18;
widgets/_base.scss:24:  -GtkScrolledWindow-scrollbars-within-bevel: 0;

Then I just removed them.

Edit:
I checked and there was two more deprecated styles, which require a little work:

$ cat /tmp/gtk-deprecated.txt | sed -n 's/^ \* \([^ ]*\).*CSS.*$/\1/p' | tr : -  | while read style; do gre
p -Rn $style; done
widgets/_base.scss:24:  -GtkExpander-expander-size: 16;
widgets/_base.scss:12:  -GtkCheckButton-indicator-size: 18;

According to documentation (1, 2) min-width and min-height should be used instead of them. I managed to do so with help of following URLs:

Reviewers: Breeze, ngraham

Reviewed By: Breeze, ngraham

Subscribers: ngraham, plasma-devel

Tags: Breeze, Plasma

Differential Revision: https://phabricator.kde.org/D18999

Details

Committed
ngrahamFeb 15 2019, 4:57 PM
Reviewer
Breeze
Differential Revision
D18999: Remove ignored style properties from CSS
Parents
R98:00e797aa8c5c: Merge branch 'Plasma/5.15'
Branches
Unknown
Tags
Unknown