add icons to actions
This commit is contained in:
12
main.py
12
main.py
@@ -22,6 +22,8 @@ MAX_LINE_LENGTH = 4096
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
log = logging.getLogger("main")
|
||||
|
||||
raven_icon = "icon7.png"
|
||||
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -55,11 +57,11 @@ class MainWindow(QMainWindow):
|
||||
def file_menu(self) -> QMenu:
|
||||
file_menu = QMenu(self.tr("&File", "name of the file menu"), self)
|
||||
|
||||
open_file = QAction(self.tr("&Open..."), self)
|
||||
open_file = QAction(QIcon.fromTheme("document-open"), self.tr("&Open..."), self)
|
||||
open_file.setShortcut('Ctrl+O')
|
||||
open_file.triggered.connect(self._open_file_dialog)
|
||||
|
||||
close_action = QAction(self.tr("E&xit", "menu item to close the application"), self)
|
||||
close_action = QAction(QIcon.fromTheme("exit"), self.tr("E&xit", "menu item to close the application"), self)
|
||||
close_action.setShortcut('Ctrl+X')
|
||||
close_action.triggered.connect(self.destruct)
|
||||
|
||||
@@ -77,7 +79,7 @@ class MainWindow(QMainWindow):
|
||||
manage.triggered.connect(lambda: HighlightingDialog(self.settings).exec())
|
||||
result.addAction(manage)
|
||||
|
||||
highlight_search_terms = QAction(self.tr("Highlight &Search Terms"), self)
|
||||
highlight_search_terms = QAction(self.tr("Highlight &Searches"), self)
|
||||
highlight_search_terms.setCheckable(True)
|
||||
highlight_search_terms.setChecked(self.settings.session.getboolean("general", "highlight_search_term"))
|
||||
highlight_search_terms.triggered.connect(
|
||||
@@ -90,7 +92,7 @@ class MainWindow(QMainWindow):
|
||||
def help_menu(self) -> QMenu:
|
||||
help_menu = QMenu(self.tr("&Help", "name of the help menu"), self)
|
||||
|
||||
about_action = QAction(self.tr("&About"), self)
|
||||
about_action = QAction(QIcon(raven_icon), self.tr("&About"), self)
|
||||
about_action.triggered.connect(lambda: AboutDialog().exec())
|
||||
help_menu.addAction(about_action)
|
||||
|
||||
@@ -179,7 +181,7 @@ def stop_signal(signum, _stackframe):
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = QApplication(sys.argv)
|
||||
app.setWindowIcon(QIcon("icon7.png"))
|
||||
app.setWindowIcon(QIcon(raven_icon))
|
||||
|
||||
# translator = QTranslator()
|
||||
# if translator.load(QLocale("de"), "messages_de.ts"):
|
||||
|
||||
Reference in New Issue
Block a user