Commit 7687c366 authored by Andrzej Broński's avatar Andrzej Broński Committed by Nate Graham

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:

  # I wrote python script for finding all deprecation messages in docs: {F6614333}
  # I ran script and saved results to file
  # 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 ([[ https://developer.gnome.org/gtk3/stable/GtkCheckButton.html#GtkCheckButton--s-indicator-size | 1 ]], [[ https://developer.gnome.org/gtk3/stable/GtkExpander.html#GtkExpander--s-expander-size | 2 ]]) //min-width// and //min-height// should be used instead of them. I managed to do so with help of following URLs:
- https://mail.gnome.org/archives/commits-list/2015-December/msg04451.html
- https://gitlab.gnome.org/GNOME/gtk/merge_requests/208/diffs?commit_id=bd0badb5e950c913da2b22f4b8ea60ed3f872a03

Reviewers: #breeze, ngraham

Reviewed By: #breeze, ngraham

Subscribers: ngraham, plasma-devel

Tags: #breeze, #plasma

Differential Revision: https://phabricator.kde.org/D18999
parent 00e797aa
......@@ -9,24 +9,16 @@ $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
-GtkToolButton-icon-spacing: 4;
-GtkTextView-error-underline-color: $error_color;
-GtkButton-child-displacement-x: 0;
-GtkButton-child-displacement-y: 0;
-GtkCheckButton-indicator-size: 18;
-GtkCheckMenuItem-indicator-size: 18;
// The size for scrollbars. The slider is 2px smaller, but we keep it
// up so that the whole area is sensitive to button presses for the
// slider. The stepper button is larger in both directions, the slider
// only in the width
-GtkScrolledWindow-scrollbar-spacing: 0;
-GtkScrolledWindow-scrollbars-within-bevel: 0;
-GtkScrolled-window-overlay-scrolling: FALSE;
-GtkToolItemGroup-expander-size: 11;
-GtkExpander-expander-size: 16;
-GtkTreeView-expander-size: 11;
-GtkTreeView-horizontal-separator: 4;
......@@ -37,8 +29,6 @@ $ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
-GtkDialog-button-spacing: 4;
-GtkDialog-action-area-border: 0;
-GtkStatusbar-shadow-type: none;
outline-width: 0px;
}
......
......@@ -55,6 +55,9 @@ treeview.view {
}
&.expander {
// GtkTreeView uses the larger of the expander’s min-width and min-height
min-width: 16px;
min-height: 16px;
-gtk-icon-source: -gtk-icontheme('pan-end-symbolic');
color: v_color(text);
&:dir(rtl) { -gtk-icon-source: -gtk-icontheme('pan-start-symbolic'); };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment