|
51 | 51 | from mne.utils import _to_rgb, logger, sizeof_fmt, warn, get_config
|
52 | 52 |
|
53 | 53 | from . import _browser_instances
|
| 54 | +from .icons import resources # noqa: F401 |
54 | 55 |
|
55 | 56 | try:
|
56 | 57 | from pytestqt.exceptions import capture_exceptions
|
@@ -124,11 +125,6 @@ def _init_mne_qtapp(enable_icon=True, pg_app=False):
|
124 | 125 | return app
|
125 | 126 |
|
126 | 127 |
|
127 |
| -def _get_std_icon(icon_name): |
128 |
| - return QApplication.instance().style().standardIcon( |
129 |
| - getattr(QStyle, icon_name)) |
130 |
| - |
131 |
| - |
132 | 128 | def _get_color(color_spec):
|
133 | 129 | """Wraps mkColor to accept all possible matplotlib color-specifiers."""
|
134 | 130 | try:
|
@@ -2117,7 +2113,7 @@ def _init_ui(self):
|
2117 | 2113 | self.stop_bx.editingFinished.connect(self._stop_changed)
|
2118 | 2114 | layout.addWidget(self.stop_bx)
|
2119 | 2115 |
|
2120 |
| - help_bt = QPushButton(_get_std_icon('SP_DialogHelpButton'), 'Help') |
| 2116 | + help_bt = QPushButton(QIcon(":/help.svg"), 'Help') |
2121 | 2117 | help_bt.clicked.connect(self._show_help)
|
2122 | 2118 | layout.addWidget(help_bt)
|
2123 | 2119 |
|
@@ -2834,59 +2830,53 @@ def __init__(self, **kwargs):
|
2834 | 2830 | toolbar = self.addToolBar('Tools')
|
2835 | 2831 | toolbar.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
|
2836 | 2832 |
|
2837 |
| - adecr_time = QAction(_get_std_icon('SP_ArrowDown'), |
2838 |
| - 'Time', parent=self) |
| 2833 | + adecr_time = QAction(QIcon(":/less_time.svg"), '- Time', parent=self) |
2839 | 2834 | adecr_time.triggered.connect(partial(self.change_duration, -0.2))
|
2840 | 2835 | toolbar.addAction(adecr_time)
|
2841 | 2836 |
|
2842 |
| - aincr_time = QAction(_get_std_icon('SP_ArrowUp'), |
2843 |
| - 'Time', parent=self) |
| 2837 | + aincr_time = QAction(QIcon(":/more_time.svg"), '+ Time', parent=self) |
2844 | 2838 | aincr_time.triggered.connect(partial(self.change_duration, 0.25))
|
2845 | 2839 | toolbar.addAction(aincr_time)
|
2846 | 2840 |
|
2847 |
| - adecr_nchan = QAction(_get_std_icon('SP_ArrowDown'), |
2848 |
| - 'Channels', parent=self) |
| 2841 | + adecr_nchan = QAction(QIcon(":/less_channels.svg"), '- Channels', |
| 2842 | + parent=self) |
2849 | 2843 | adecr_nchan.triggered.connect(partial(self.change_nchan, -10))
|
2850 | 2844 | toolbar.addAction(adecr_nchan)
|
2851 | 2845 |
|
2852 |
| - aincr_nchan = QAction(_get_std_icon('SP_ArrowUp'), |
2853 |
| - 'Channels', parent=self) |
| 2846 | + aincr_nchan = QAction(QIcon(":/more_channels.svg"), '+ Channels', |
| 2847 | + parent=self) |
2854 | 2848 | aincr_nchan.triggered.connect(partial(self.change_nchan, 10))
|
2855 | 2849 | toolbar.addAction(aincr_nchan)
|
2856 | 2850 |
|
2857 |
| - adecr_nchan = QAction(_get_std_icon('SP_ArrowDown'), |
2858 |
| - 'Zoom', parent=self) |
| 2851 | + adecr_nchan = QAction(QIcon(":/zoom_out.svg"), 'Zoom Out', parent=self) |
2859 | 2852 | adecr_nchan.triggered.connect(partial(self.scale_all, 4 / 5))
|
2860 | 2853 | toolbar.addAction(adecr_nchan)
|
2861 | 2854 |
|
2862 |
| - aincr_nchan = QAction(_get_std_icon('SP_ArrowUp'), |
2863 |
| - 'Zoom', parent=self) |
| 2855 | + aincr_nchan = QAction(QIcon(":/zoom_in.svg"), 'Zoom In', parent=self) |
2864 | 2856 | aincr_nchan.triggered.connect(partial(self.scale_all, 5 / 4))
|
2865 | 2857 | toolbar.addAction(aincr_nchan)
|
2866 | 2858 |
|
2867 | 2859 | if not self.mne.is_epochs:
|
2868 |
| - atoggle_annot = QAction(_get_std_icon('SP_DialogResetButton'), |
2869 |
| - 'Annotations', parent=self) |
| 2860 | + atoggle_annot = QAction(QIcon(":/annotations.svg"), 'Annotations', |
| 2861 | + parent=self) |
2870 | 2862 | atoggle_annot.triggered.connect(self._toggle_annotation_fig)
|
2871 | 2863 | toolbar.addAction(atoggle_annot)
|
2872 | 2864 |
|
2873 |
| - atoggle_proj = QAction(_get_std_icon('SP_DialogOkButton'), |
2874 |
| - 'SSP', parent=self) |
| 2865 | + atoggle_proj = QAction(QIcon(":/ssp.svg"), 'SSP', parent=self) |
2875 | 2866 | atoggle_proj.triggered.connect(self._toggle_proj_fig)
|
2876 | 2867 | toolbar.addAction(atoggle_proj)
|
2877 | 2868 |
|
2878 |
| - atoggle_fullscreen = QAction(_get_std_icon('SP_TitleBarMaxButton'), |
2879 |
| - 'Full-Screen', parent=self) |
| 2869 | + atoggle_fullscreen = QAction(QIcon(":/fullscreen.svg"), 'Fullscreen', |
| 2870 | + parent=self) |
2880 | 2871 | atoggle_fullscreen.triggered.connect(self._toggle_fullscreen)
|
2881 | 2872 | toolbar.addAction(atoggle_fullscreen)
|
2882 | 2873 |
|
2883 |
| - asettings = QAction(_get_std_icon('SP_FileDialogDetailedView'), |
2884 |
| - 'Settings', parent=self) |
| 2874 | + asettings = QAction(QIcon(":/settings.svg"), 'Settings', |
| 2875 | + parent=self) |
2885 | 2876 | asettings.triggered.connect(self._toggle_settings_fig)
|
2886 | 2877 | toolbar.addAction(asettings)
|
2887 | 2878 |
|
2888 |
| - ahelp = QAction(_get_std_icon('SP_DialogHelpButton'), |
2889 |
| - 'Help', parent=self) |
| 2879 | + ahelp = QAction(QIcon(":/help.svg"), 'Help', parent=self) |
2890 | 2880 | ahelp.triggered.connect(self._toggle_help_fig)
|
2891 | 2881 | toolbar.addAction(ahelp)
|
2892 | 2882 |
|
|
0 commit comments