diff --git a/b_asic/GUI/main_window.py b/b_asic/GUI/main_window.py index 5f75ae098772aea632290600fa4d43c951bba857..5daf997f7c5c9ff184a96ef320c9fdcf213a3c0a 100644 --- a/b_asic/GUI/main_window.py +++ b/b_asic/GUI/main_window.py @@ -142,10 +142,12 @@ class SFGMainWindow(QMainWindow): self._ui.actionShowPC.triggered.connect(self._show_precedence_graph) self._ui.actionSimulateSFG.triggered.connect(self.simulate_sfg) + self._ui.actionSimulateSFG.setIcon(get_icon('sim')) # About menu self._ui.faqBASIC.triggered.connect(self.display_faq_page) self._ui.faqBASIC.setShortcut(QKeySequence("Ctrl+?")) + self._ui.faqBASIC.setIcon(get_icon('faq')) self._ui.aboutBASIC.triggered.connect(self.display_about_page) self._ui.aboutBASIC.setIcon(get_icon('about')) self._ui.keybindsBASIC.triggered.connect(self.display_keybindings_page) @@ -175,7 +177,9 @@ class SFGMainWindow(QMainWindow): self._ui.exit_menu.setIcon(get_icon('quit')) self._ui.select_all.triggered.connect(self._select_all) self._ui.select_all.setShortcut(QKeySequence("Ctrl+A")) + self._ui.select_all.setIcon(get_icon('all')) self._ui.unselect_all.triggered.connect(self._unselect_all) + self._ui.unselect_all.setIcon(get_icon('none')) self._shortcut_signal = QShortcut(QKeySequence(Qt.Key_Space), self) self._shortcut_signal.activated.connect(self._connect_callback) self._create_recent_file_actions_and_menus() @@ -202,8 +206,9 @@ class SFGMainWindow(QMainWindow): self._statusbar_visible.triggered.connect(self._toggle_statusbar) self._ui.view_menu.addAction(self._statusbar_visible) + # Zoom to fit self._ui.view_menu.addSeparator() - self._zoom_to_fit_action = QAction("Zoom to &fit") + self._zoom_to_fit_action = QAction(get_icon('zoom-to-fit'), "Zoom to &fit") self._zoom_to_fit_action.triggered.connect(self._zoom_to_fit) self._ui.view_menu.addAction(self._zoom_to_fit_action) @@ -416,7 +421,7 @@ class SFGMainWindow(QMainWindow): self._update_recent_file_list() - def exit_app(self) -> None: + def exit_app(self, event=None) -> None: """Exit the application.""" self._logger.info("Exiting the application.") QApplication.quit() diff --git a/b_asic/gui_utils/icons.py b/b_asic/gui_utils/icons.py index f302345b37c8e0bd4f472fe9c5d4ad36ed7dda56..54f02db18c3e7a8df02fb3569240fd81c1c22fb6 100644 --- a/b_asic/gui_utils/icons.py +++ b/b_asic/gui_utils/icons.py @@ -4,6 +4,7 @@ import qtawesome ICONS = { 'save': 'mdi6.content-save', + 'save-as': 'mdi6.content-save-edit', 'undo': 'mdi6.undo', 'redo': 'mdi6.redo', 'new': 'mdi6.file-outline', @@ -23,9 +24,16 @@ ICONS = { 'about': 'ph.question', 'keys': 'ph.keyboard', 'add-operations': 'ph.math-operations', + 'zoom-to-fit': 'mdi6.fit-to-page', + 'faq': 'mdi6.frequently-asked-questions', + 'sim': 'mdi6.chart-line', + 'reorder': ('msc.graph-left', {'rotated': -90}), } def get_icon(name): """Return icon for given name""" - return qtawesome.icon(ICONS[name]) + info = ICONS[name] + if isinstance(info, str): + return qtawesome.icon(info) + return qtawesome.icon(info[0], **info[1]) diff --git a/b_asic/scheduler_gui/main_window.py b/b_asic/scheduler_gui/main_window.py index bc57fdbe5c96b75d852847ce1b0f175d85cb9032..21f2b211a9101d47491696179f4fa519532d7c58 100644 --- a/b_asic/scheduler_gui/main_window.py +++ b/b_asic/scheduler_gui/main_window.py @@ -137,16 +137,19 @@ class ScheduleMainWindow(QMainWindow, Ui_MainWindow): self.menu_save.triggered.connect(self.save) self.menu_save.setIcon(get_icon('save')) self.menu_save_as.triggered.connect(self.save_as) + self.menu_save_as.setIcon(get_icon('save-as')) self.menu_quit.triggered.connect(self.close) self.menu_quit.setIcon(get_icon('quit')) self.menu_node_info.triggered.connect(self.show_info_table) self.menu_node_info.setIcon(get_icon('info')) self.menu_exit_dialog.triggered.connect(self.hide_exit_dialog) self.actionReorder.triggered.connect(self._action_reorder) + self.actionReorder.setIcon(get_icon('reorder')) self.actionStatus_bar.triggered.connect(self._toggle_statusbar) self.actionPlot_schedule.triggered.connect(self._plot_schedule) self.actionPlot_schedule.setIcon(get_icon('plot-schedule')) self.actionZoom_to_fit.triggered.connect(self._zoom_to_fit) + self.actionZoom_to_fit.setIcon(get_icon('zoom-to-fit')) self.actionUndo.setIcon(get_icon('undo')) self.actionRedo.setIcon(get_icon('redo')) self.splitter.splitterMoved.connect(self._splitter_moved)