From 05879131b49e26c5f62f7c82edd4fefbf1392163 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Sun, 23 Nov 2025 20:54:19 +1100 Subject: [PATCH] * Adjust some widget heights/settings text wrap * Adjust shortcuts * History unicode symbol * Icon in version dialog --- CHANGELOG.md | 7 +++++++ bouquin/locales/en.json | 2 +- bouquin/locales/fr.json | 2 +- bouquin/main_window.py | 14 +++++++------- bouquin/statistics_dialog.py | 2 +- bouquin/toolbar.py | 5 +++-- bouquin/version_check.py | 28 +++++++++++++++++++++++++++- 7 files changed, 47 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f57337..92f3ab4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# 0.4.4.1 + + * Adjust some widget heights/settings text wrap + * Adjust shortcuts + * History unicode symbol + * Icon in version dialog + # 0.4.4 * Moving unchecked TODOs now includes those up to 7 days ago, not just yesterday diff --git a/bouquin/locales/en.json b/bouquin/locales/en.json index 56fff73..d92c819 100644 --- a/bouquin/locales/en.json +++ b/bouquin/locales/en.json @@ -96,7 +96,7 @@ "open_in_new_tab": "Open in new tab", "autosave": "autosave", "unchecked_checkbox_items_moved_to_next_day": "Unchecked checkbox items moved to next day", - "move_unchecked_todos_to_today_on_startup": "Automatically move unchecked TODOs from the last 7 days to next weekday", + "move_unchecked_todos_to_today_on_startup": "Automatically move unchecked TODOs\nfrom the last 7 days to next weekday", "insert_images": "Insert images", "images": "Images", "reopen_failed": "Re-open failed", diff --git a/bouquin/locales/fr.json b/bouquin/locales/fr.json index 7719b04..c518fb6 100644 --- a/bouquin/locales/fr.json +++ b/bouquin/locales/fr.json @@ -88,7 +88,7 @@ "unlock_failed": "Échec du déverrouillage", "could_not_unlock_database_at_new_path": "Impossible de déverrouiller la base de données au nouveau chemin.", "unencrypted_export": "Export non chiffré", - "unencrypted_export_warning": "L’export de la base de données ne sera pas chiffré !\nÊtes-vous sûr de vouloir continuer ?'nSi vous voulez une sauvegarde chiffrée, choisissez Sauvegarde plutôt qu’Export.", + "unencrypted_export_warning": "L’export de la base de données ne sera pas chiffré !\nÊtes-vous sûr de vouloir continuer ?\nSi vous voulez une sauvegarde chiffrée, choisissez Sauvegarde plutôt qu’Export.", "unrecognised_extension": "Extension non reconnue !", "backup_encrypted_notebook": "Sauvegarder le bouquin chiffré", "enter_a_name_for_this_version": "Saisir un nom pour cette version", diff --git a/bouquin/main_window.py b/bouquin/main_window.py index 52d6f96..aa9d9a1 100644 --- a/bouquin/main_window.py +++ b/bouquin/main_window.py @@ -206,16 +206,16 @@ class MainWindow(QMainWindow): act_save.triggered.connect(lambda: self._save_current(explicit=True)) file_menu.addAction(act_save) act_history = QAction("&" + strings._("history"), self) - act_history.setShortcut("Ctrl+H") + act_history.setShortcut("Ctrl+Shift+H") act_history.setShortcutContext(Qt.ApplicationShortcut) act_history.triggered.connect(self._open_history) file_menu.addAction(act_history) act_settings = QAction(strings._("main_window_settings_accessible_flag"), self) - act_settings.setShortcut("Ctrl+Shift+G") + act_settings.setShortcut("Ctrl+Shift+.") act_settings.triggered.connect(self._open_settings) file_menu.addAction(act_settings) act_export = QAction(strings._("export_accessible_flag"), self) - act_export.setShortcut("Ctrl+E") + act_export.setShortcut("Ctrl+Shift+E") act_export.triggered.connect(self._export) file_menu.addAction(act_export) act_backup = QAction("&" + strings._("backup"), self) @@ -223,7 +223,7 @@ class MainWindow(QMainWindow): act_backup.triggered.connect(self._backup) file_menu.addAction(act_backup) act_stats = QAction(strings._("main_window_statistics_accessible_flag"), self) - act_stats.setShortcut("Shift+Ctrl+S") + act_stats.setShortcut("Ctrl+Shift+S") act_stats.triggered.connect(self._open_statistics) file_menu.addAction(act_stats) file_menu.addSeparator() @@ -283,19 +283,19 @@ class MainWindow(QMainWindow): # Help menu with drop-down help_menu = mb.addMenu("&" + strings._("help")) act_docs = QAction(strings._("documentation"), self) - act_docs.setShortcut("Ctrl+D") + act_docs.setShortcut("Ctrl+Shift+D") act_docs.setShortcutContext(Qt.ApplicationShortcut) act_docs.triggered.connect(self._open_docs) help_menu.addAction(act_docs) self.addAction(act_docs) act_bugs = QAction(strings._("report_a_bug"), self) - act_bugs.setShortcut("Ctrl+R") + act_bugs.setShortcut("Ctrl+Shift+R") act_bugs.setShortcutContext(Qt.ApplicationShortcut) act_bugs.triggered.connect(self._open_bugs) help_menu.addAction(act_bugs) self.addAction(act_bugs) act_version = QAction(strings._("version"), self) - act_version.setShortcut("Ctrl+V") + act_version.setShortcut("Ctrl+Shift+V") act_version.setShortcutContext(Qt.ApplicationShortcut) act_version.triggered.connect(self._open_version) help_menu.addAction(act_version) diff --git a/bouquin/statistics_dialog.py b/bouquin/statistics_dialog.py index 4d07680..f6898e0 100644 --- a/bouquin/statistics_dialog.py +++ b/bouquin/statistics_dialog.py @@ -98,7 +98,7 @@ class DateHeatmap(QWidget): def minimumSizeHint(self) -> QSize: sz = self.sizeHint() - return QSize(min(350, sz.width()), sz.height()) + return QSize(min(380, sz.width()), sz.height()) def paintEvent(self, event): super().paintEvent(event) diff --git a/bouquin/toolbar.py b/bouquin/toolbar.py index 59c2f50..a9fb730 100644 --- a/bouquin/toolbar.py +++ b/bouquin/toolbar.py @@ -110,7 +110,8 @@ class ToolBar(QToolBar): self.actInsertImg.triggered.connect(self.insertImageRequested) # History button - self.actHistory = QAction(strings._("history"), self) + self.actHistory = QAction("⎌", self) + self.actHistory.setToolTip(strings._("history")) self.actHistory.triggered.connect(self.historyRequested) # Set exclusive buttons in QActionGroups @@ -178,7 +179,7 @@ class ToolBar(QToolBar): self._style_letter_button(self.actAlarm, "⏰") # History - self._style_letter_button(self.actHistory, strings._("view_history")) + self._style_letter_button(self.actHistory, "⎌") def _style_letter_button( self, diff --git a/bouquin/version_check.py b/bouquin/version_check.py index 8f62589..afbc409 100644 --- a/bouquin/version_check.py +++ b/bouquin/version_check.py @@ -16,6 +16,8 @@ from PySide6.QtWidgets import ( QWidget, QProgressDialog, ) +from PySide6.QtGui import QPixmap, QImage, QPainter, QGuiApplication +from PySide6.QtSvg import QSvgRenderer from .settings import APP_NAME from . import strings @@ -50,6 +52,28 @@ class VersionChecker: # ---------- Version helpers ---------- # + def _logo_pixmap(self, logical_size: int = 96) -> QPixmap: + """ + Render the SVG logo to a high-DPI-aware QPixmap so it stays crisp. + """ + svg_path = Path(__file__).resolve().parent / "icons" / "bouquin-light.svg" + + # Logical size (what Qt layouts see) + dpr = QGuiApplication.primaryScreen().devicePixelRatio() + img_size = int(logical_size * dpr) + + image = QImage(img_size, img_size, QImage.Format_ARGB32) + image.fill(Qt.transparent) + + renderer = QSvgRenderer(str(svg_path)) + painter = QPainter(image) + renderer.render(painter) + painter.end() + + pixmap = QPixmap.fromImage(image) + pixmap.setDevicePixelRatio(dpr) + return pixmap + def current_version(self) -> str: """ Return the current app version as reported by importlib.metadata @@ -87,8 +111,10 @@ class VersionChecker: version_formatted = f"{APP_NAME} {version}" box = QMessageBox(self._parent) - box.setIcon(QMessageBox.Information) box.setWindowTitle(strings._("version")) + + box.setIconPixmap(self._logo_pixmap(96)) + box.setText(version_formatted) check_button = box.addButton(