Skip to content

Commit

Permalink
Merge pull request #21465 from conradolandia/update-qdarkstyle
Browse files Browse the repository at this point in the history
PR: Update minimal required version of QDarkstyle to `>=3.2,<3.3`
  • Loading branch information
ccordoba12 authored Oct 28, 2023
2 parents e646539 + 8b494c7 commit 938c1b1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion spyder/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
6 changes: 3 additions & 3 deletions spyder/utils/icon_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions spyder/utils/stylesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 938c1b1

Please sign in to comment.