From d05ac06ad3bb96d720680ce2681f64cc8b1d5f27 Mon Sep 17 00:00:00 2001 From: alfrix Date: Sat, 5 Feb 2022 13:55:53 -0300 Subject: [PATCH] Settings_panel: Prevent long translations from squashing the slider and improve switch to be more consistent --- panels/settings.py | 5 +++-- styles/base.css | 5 +++++ styles/colorized/style.css | 2 -- styles/material-dark/style.css | 5 ----- styles/material-darker/style.css | 1 - styles/material-light/style.css | 4 +--- styles/z-bolt/style.css | 1 - 7 files changed, 9 insertions(+), 14 deletions(-) diff --git a/panels/settings.py b/panels/settings.py index a94743fd..d0e330c7 100644 --- a/panels/settings.py +++ b/panels/settings.py @@ -139,8 +139,8 @@ class SettingsPanel(ScreenPanel): switch.set_active(self._config.get_config().getboolean(option['section'], opt_name)) switch.connect("notify::active", self.switch_config_option, option['section'], opt_name, option['callback'] if "callback" in option else None) - switch.set_property("width-request", round(self._gtk.get_image_width()*2.5)) - switch.set_property("height-request", round(self._gtk.get_image_height()*1.25)) + switch.set_property("width-request", round(self._gtk.get_font_size()*7)) + switch.set_property("height-request", round(self._gtk.get_font_size()*3.5)) box.add(switch) dev.add(box) elif option['type'] == "dropdown": @@ -162,6 +162,7 @@ class SettingsPanel(ScreenPanel): scale = Gtk.Scale(orientation=Gtk.Orientation.HORIZONTAL, adjustment=adj) scale.set_hexpand(True) scale.set_digits(0) + scale.set_property("width-request", round(self._screen.width/2.2)) scale.connect("value-changed", self.scale_moved, option['section'], opt_name) dev.add(scale) elif option['type'] == "printer": diff --git a/styles/base.css b/styles/base.css index 4ae25a9c..d7c28d6f 100644 --- a/styles/base.css +++ b/styles/base.css @@ -84,6 +84,11 @@ combobox arrow { min-width: 1em; } +switch { + border: 0; + border-radius: 3em; +} + switch slider { border: 0; } diff --git a/styles/colorized/style.css b/styles/colorized/style.css index 476eff38..4613e19f 100644 --- a/styles/colorized/style.css +++ b/styles/colorized/style.css @@ -81,8 +81,6 @@ combobox box button { switch { background-color: #073642; /* base02 */ - border-color: #073642; /* base02 */ - border-radius: 3em; } switch:checked { diff --git a/styles/material-dark/style.css b/styles/material-dark/style.css index 76c42153..480d39c2 100644 --- a/styles/material-dark/style.css +++ b/styles/material-dark/style.css @@ -81,17 +81,12 @@ combobox box button { switch { background-color: #1f1f1f; - border-color: #121212; } switch:checked { background-color: #849900; } -switch slider { - border: 0; -} - entry { background-color: #1f1f1f; border-color: rgba(0,0,0,0); diff --git a/styles/material-darker/style.css b/styles/material-darker/style.css index f73432ee..bcd14aa5 100644 --- a/styles/material-darker/style.css +++ b/styles/material-darker/style.css @@ -59,7 +59,6 @@ combobox box button { switch { background-color: #1e1e1e; - border-color: #303030; } switch:checked { diff --git a/styles/material-light/style.css b/styles/material-light/style.css index 623c6d6c..a6ad8d72 100644 --- a/styles/material-light/style.css +++ b/styles/material-light/style.css @@ -90,8 +90,6 @@ combobox box button { switch { background-color: #BDBDBD; - border-radius: 2em; - border-color: #BDBDBD } switch:checked { @@ -99,7 +97,7 @@ switch:checked { } switch slider { - border-color: #BDBDBD; + border: .1em solid #BDBDBD; } entry { diff --git a/styles/z-bolt/style.css b/styles/z-bolt/style.css index 9489b8ae..87b1a2df 100644 --- a/styles/z-bolt/style.css +++ b/styles/z-bolt/style.css @@ -55,7 +55,6 @@ combobox box button { switch { background-color: #20292F; - border: 0; } switch:checked {