From 14620423e840729e9a084678e465c52885cf4737 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Tue, 3 Jul 2018 18:55:31 +0100 Subject: [PATCH] themes: Restore default progressbar min sizes The min size on the oriented axis used to come from style props with default values in the source file, used if the theme did not provide a min size in CSS. When the style props were removed, so was any notion of a minimal size for proressbars' main axis, meaning that now progressbars without expand or any other source of min size were just tiny specks. The right place to do that was always the theme, so in our themes now, fix that by copying the old default values for the style properties; see: https://gitlab.gnome.org/GNOME/gtk/issues/1191#note_259393 https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/gtk/gtkprogressbar.c#L92 The result should be the same in that (A) the min size is now what it is in GTK+ 3 & (B) an app/user can override the theme exactly the same way. Close https://gitlab.gnome.org/GNOME/gtk/issues/1192 --- gtk/theme/Adwaita/_common.scss | 4 ++++ gtk/theme/Adwaita/gtk-contained-dark.css | 4 ++++ gtk/theme/Adwaita/gtk-contained.css | 4 ++++ gtk/theme/HighContrast/_common.scss | 4 ++++ gtk/theme/HighContrast/gtk-contained-inverse.css | 4 ++++ gtk/theme/HighContrast/gtk-contained.css | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss index beac635fcb..f9c6cec55b 100644 --- a/gtk/theme/Adwaita/_common.scss +++ b/gtk/theme/Adwaita/_common.scss @@ -3320,11 +3320,15 @@ scale { progressbar { // sizing &.horizontal { + trough { min-width: 150px; } + trough, progress { min-height: 2px; } } &.vertical { + trough { min-height: 80px; } + trough, progress { min-width: 2px; } } diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css index b3cb7ea8be..281d317c0c 100644 --- a/gtk/theme/Adwaita/gtk-contained-dark.css +++ b/gtk/theme/Adwaita/gtk-contained-dark.css @@ -1444,8 +1444,12 @@ scale.color.fine-tune.vertical:dir(rtl) slider { margin-right: -15px; margin-lef /***************** Progress bars * */ progressbar { font-size: smaller; color: rgba(238, 238, 236, 0.4); } +progressbar.horizontal trough { min-width: 150px; } + progressbar.horizontal trough, progressbar.horizontal progress { min-height: 2px; } +progressbar.vertical trough { min-height: 80px; } + progressbar.vertical trough, progressbar.vertical progress { min-width: 2px; } progressbar.horizontal progress { margin: 0 -1px; } diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css index f8ce8af8fb..f562db8947 100644 --- a/gtk/theme/Adwaita/gtk-contained.css +++ b/gtk/theme/Adwaita/gtk-contained.css @@ -1464,8 +1464,12 @@ scale.color.fine-tune.vertical:dir(rtl) slider { margin-right: -15px; margin-lef /***************** Progress bars * */ progressbar { font-size: smaller; color: rgba(46, 52, 54, 0.4); } +progressbar.horizontal trough { min-width: 150px; } + progressbar.horizontal trough, progressbar.horizontal progress { min-height: 2px; } +progressbar.vertical trough { min-height: 80px; } + progressbar.vertical trough, progressbar.vertical progress { min-width: 2px; } progressbar.horizontal progress { margin: 0 -1px; } diff --git a/gtk/theme/HighContrast/_common.scss b/gtk/theme/HighContrast/_common.scss index 4150fd82a0..dba4775e5d 100644 --- a/gtk/theme/HighContrast/_common.scss +++ b/gtk/theme/HighContrast/_common.scss @@ -2499,11 +2499,15 @@ progressbar { // moving bit &.horizontal { + trough { min-width: 150px; } trough, progress { min-height: 2px; } } + &.vertical { + trough { min-height: 80px; } trough, progress { min-width: 2px; } } + & progress { border-width: 1px; border-style: solid; diff --git a/gtk/theme/HighContrast/gtk-contained-inverse.css b/gtk/theme/HighContrast/gtk-contained-inverse.css index 1ac9d8db13..8d5e0ee435 100644 --- a/gtk/theme/HighContrast/gtk-contained-inverse.css +++ b/gtk/theme/HighContrast/gtk-contained-inverse.css @@ -1105,8 +1105,12 @@ progressbar trough:backdrop { border-color: #737373; background-color: #282828; progressbar.osd trough { background-color: transparent; box-shadow: none; border-width: 0; } +progressbar.horizontal trough { min-width: 150px; } + progressbar.horizontal trough, progressbar.horizontal progress { min-height: 2px; } +progressbar.vertical trough { min-height: 80px; } + progressbar.vertical trough, progressbar.vertical progress { min-width: 2px; } progressbar progress { border-width: 1px; border-style: solid; border-radius: 3px; border-color: #aaa; background-color: #ddd; box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.2); } diff --git a/gtk/theme/HighContrast/gtk-contained.css b/gtk/theme/HighContrast/gtk-contained.css index 1e6e2e6b40..498c11487d 100644 --- a/gtk/theme/HighContrast/gtk-contained.css +++ b/gtk/theme/HighContrast/gtk-contained.css @@ -1111,8 +1111,12 @@ progressbar trough:backdrop { border-color: #8d8d8d; background-color: #d7d7d7; progressbar.osd trough { background-color: transparent; box-shadow: none; border-width: 0; } +progressbar.horizontal trough { min-width: 150px; } + progressbar.horizontal trough, progressbar.horizontal progress { min-height: 2px; } +progressbar.vertical trough { min-height: 80px; } + progressbar.vertical trough, progressbar.vertical progress { min-width: 2px; } progressbar progress { border-width: 1px; border-style: solid; border-radius: 3px; border-color: #000; background-color: #000; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }