diff --git a/mne/icons/toolbar_move_horizontal@2x.png b/mne/icons/toolbar_move_horizontal@2x.png new file mode 100644 index 00000000000..143b62ec558 Binary files /dev/null and b/mne/icons/toolbar_move_horizontal@2x.png differ diff --git a/mne/icons/toolbar_move_vertical@2x.png b/mne/icons/toolbar_move_vertical@2x.png new file mode 100644 index 00000000000..453d7b71f96 Binary files /dev/null and b/mne/icons/toolbar_move_vertical@2x.png differ diff --git a/mne/icons/toolbar_separator_horizontal.png b/mne/icons/toolbar_separator_horizontal.png new file mode 100644 index 00000000000..ecf2ab7d0cf Binary files /dev/null and b/mne/icons/toolbar_separator_horizontal.png differ diff --git a/mne/icons/toolbar_separator_horizontal@2x.png b/mne/icons/toolbar_separator_horizontal@2x.png new file mode 100644 index 00000000000..ac2b3432646 Binary files /dev/null and b/mne/icons/toolbar_separator_horizontal@2x.png differ diff --git a/mne/icons/toolbar_separator_vertical@2x.png b/mne/icons/toolbar_separator_vertical@2x.png new file mode 100644 index 00000000000..2f66e93d346 Binary files /dev/null and b/mne/icons/toolbar_separator_vertical@2x.png differ diff --git a/mne/viz/backends/_utils.py b/mne/viz/backends/_utils.py index fde9be11ef0..aa1a4f04da9 100644 --- a/mne/viz/backends/_utils.py +++ b/mne/viz/backends/_utils.py @@ -9,6 +9,7 @@ import collections.abc from colorsys import rgb_to_hls from contextlib import contextmanager +import functools import platform import signal import sys @@ -75,6 +76,7 @@ def _alpha_blend_background(ctable, background_color): return (use_table * alphas) + background_color * (1 - alphas) +@functools.lru_cache def _qt_init_icons(): from qtpy.QtGui import QIcon icons_path = f"{Path(__file__).parent.parent.parent}/icons" @@ -219,7 +221,9 @@ def _qt_get_stylesheet(theme): # https://github.com/ColinDuquesnoy/QDarkStyleSheet/blob/master/qdarkstyle/dark/style.qss # noqa: E501 # Something around rgb(51, 51, 51) worked as the bgcolor here, # but it's easy enough just to set it transparent and inherit - # the bgcolor of the window (which is the same) + # the bgcolor of the window (which is the same). We also take + # the separator images from QDarkStyle (MIT). + icons_path = _qt_init_icons() stylesheet = """\ QStatusBar { border: 1px solid rgb(76, 76, 75); @@ -232,7 +236,23 @@ def _qt_get_stylesheet(theme): background-color: transparent; border-bottom: 1px solid rgb(99, 99, 99); } -""" +QToolBar::separator:horizontal { + width: 16px; + image: url("%(icons_path)s/toolbar_separator_horizontal@2x.png"); +} +QToolBar::separator:vertical { + height: 16px; + image: url("%(icons_path)s/toolbar_separator_vertical@2x.png"); +} +QToolBar::handle:horizontal { + width: 16px; + image: url("%(icons_path)s/toolbar_move_horizontal@2x.png"); +} +QToolBar::handle:vertical { + height: 16px; + image: url("%(icons_path)s/toolbar_move_vertical@2x.png"); +} +""" % dict(icons_path=icons_path) else: stylesheet = '' else: