From 02906acd0c6b58b8cc9a8393acfc4f10ba59fb51 Mon Sep 17 00:00:00 2001 From: conradolandia Date: Fri, 27 Oct 2023 12:55:40 -0500 Subject: [PATCH 1/2] Update qdarkstyle to 3.2 --- binder/environment.yml | 2 +- requirements/main.yml | 2 +- setup.py | 2 +- spyder/dependencies.py | 2 +- spyder/utils/icon_manager.py | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/binder/environment.yml b/binder/environment.yml index a1f7a0589d9..dade0ae164d 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -34,7 +34,7 @@ dependencies: - python-lsp-server >=1.8.0,<1.9.0 - pyxdg >=0.26 - pyzmq >=22.1.0 -- qdarkstyle >=3.0.2,<3.2.0 +- qdarkstyle >=3.2.0,<3.3.0 - qstylizer >=0.2.2 - qtawesome >=1.2.1 - qtconsole >=5.4.2,<5.5.0 diff --git a/requirements/main.yml b/requirements/main.yml index 19474df0f00..f91faa8873d 100644 --- a/requirements/main.yml +++ b/requirements/main.yml @@ -31,7 +31,7 @@ dependencies: - python-lsp-black >=1.2.0,<3.0.0 - python-lsp-server >=1.8.0,<1.9.0 - pyzmq >=22.1.0 - - qdarkstyle >=3.0.2,<3.2.0 + - qdarkstyle >=3.2.0,<3.3.0 - qstylizer >=0.2.2 - qtawesome >=1.2.1 - qtconsole >=5.4.2,<5.5.0 diff --git a/setup.py b/setup.py index 37a8020a563..1f0fdf8c929 100644 --- a/setup.py +++ b/setup.py @@ -235,7 +235,7 @@ def run(self): 'python-lsp-server[all]>=1.8.0,<1.9.0', 'pyxdg>=0.26;platform_system=="Linux"', 'pyzmq>=22.1.0', - 'qdarkstyle>=3.0.2,<3.2.0', + 'qdarkstyle>=3.2.0,<3.3.0', 'qstylizer>=0.2.2', 'qtawesome>=1.2.1', 'qtconsole>=5.4.2,<5.5.0', diff --git a/spyder/dependencies.py b/spyder/dependencies.py index d734fb9d178..210d8807853 100644 --- a/spyder/dependencies.py +++ b/spyder/dependencies.py @@ -63,7 +63,7 @@ PYLS_SPYDER_REQVER = '>=0.4.0' PYXDG_REQVER = '>=0.26' PYZMQ_REQVER = '>=22.1.0' -QDARKSTYLE_REQVER = '>=3.0.2,<3.2.0' +QDARKSTYLE_REQVER = '>=3.2.0,<3.3.0' QSTYLIZER_REQVER = '>=0.2.2' QTAWESOME_REQVER = '>=1.2.1' QTCONSOLE_REQVER = '>=5.4.2,<5.5.0' diff --git a/spyder/utils/icon_manager.py b/spyder/utils/icon_manager.py index 5d6756088d9..956a7198e0f 100644 --- a/spyder/utils/icon_manager.py +++ b/spyder/utils/icon_manager.py @@ -410,9 +410,8 @@ def get_icon(self, name, resample=False): normal_state = wrapping_icon.pixmap(512, 512) icon.addPixmap(normal_state, QIcon.Normal) - # This is the color GammaRay reports for icons in disabled - # buttons, both for the dark and light themes - disabled_color = QColor(150, 150, 150) + # Disabled color from qdarkstyle + disabled_color = QColor(QStylePalette.COLOR_DISABLED) # Paint icon with the previous color to get the disabled state. # Taken from https://stackoverflow.com/a/65618075/438386 @@ -437,6 +436,7 @@ def icon(self, name, scale_factor=None, resample=False): args, kwargs = self._qtaargs[name] if scale_factor is not None: kwargs['scale_factor'] = scale_factor + kwargs['color_disabled'] = QStylePalette.COLOR_DISABLED return qta.icon(*args, **kwargs) except KeyError: # Load custom icons From 8b494c71a21a816e4a6e2b8bf3458119217cc873 Mon Sep 17 00:00:00 2001 From: Carlos Cordoba Date: Sat, 28 Oct 2023 10:13:33 -0500 Subject: [PATCH 2/2] Stylesheet: Make match the menu bar and app toolbar background colors --- spyder/utils/stylesheet.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spyder/utils/stylesheet.py b/spyder/utils/stylesheet.py index 4698a21bbd0..2446c2a40b7 100644 --- a/spyder/utils/stylesheet.py +++ b/spyder/utils/stylesheet.py @@ -109,6 +109,11 @@ def _customize_stylesheet(self): margin='0px' ) + # Set the same color as the one used for the app toolbar + css.QMenuBar.setValues( + backgroundColor=QStylePalette.COLOR_BACKGROUND_4 + ) + # Remove padding when pressing main menus css['QMenuBar::item:pressed'].setValues( padding='0px'