* Adjust some widget heights/settings text wrap
* Adjust shortcuts * History unicode symbol * Icon in version dialog
This commit is contained in:
parent
a0153a370b
commit
05879131b4
7 changed files with 47 additions and 13 deletions
|
|
@ -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
|
# 0.4.4
|
||||||
|
|
||||||
* Moving unchecked TODOs now includes those up to 7 days ago, not just yesterday
|
* Moving unchecked TODOs now includes those up to 7 days ago, not just yesterday
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@
|
||||||
"open_in_new_tab": "Open in new tab",
|
"open_in_new_tab": "Open in new tab",
|
||||||
"autosave": "autosave",
|
"autosave": "autosave",
|
||||||
"unchecked_checkbox_items_moved_to_next_day": "Unchecked checkbox items moved to next day",
|
"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",
|
"insert_images": "Insert images",
|
||||||
"images": "Images",
|
"images": "Images",
|
||||||
"reopen_failed": "Re-open failed",
|
"reopen_failed": "Re-open failed",
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@
|
||||||
"unlock_failed": "Échec du déverrouillage",
|
"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.",
|
"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": "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 !",
|
"unrecognised_extension": "Extension non reconnue !",
|
||||||
"backup_encrypted_notebook": "Sauvegarder le bouquin chiffré",
|
"backup_encrypted_notebook": "Sauvegarder le bouquin chiffré",
|
||||||
"enter_a_name_for_this_version": "Saisir un nom pour cette version",
|
"enter_a_name_for_this_version": "Saisir un nom pour cette version",
|
||||||
|
|
|
||||||
|
|
@ -206,16 +206,16 @@ class MainWindow(QMainWindow):
|
||||||
act_save.triggered.connect(lambda: self._save_current(explicit=True))
|
act_save.triggered.connect(lambda: self._save_current(explicit=True))
|
||||||
file_menu.addAction(act_save)
|
file_menu.addAction(act_save)
|
||||||
act_history = QAction("&" + strings._("history"), self)
|
act_history = QAction("&" + strings._("history"), self)
|
||||||
act_history.setShortcut("Ctrl+H")
|
act_history.setShortcut("Ctrl+Shift+H")
|
||||||
act_history.setShortcutContext(Qt.ApplicationShortcut)
|
act_history.setShortcutContext(Qt.ApplicationShortcut)
|
||||||
act_history.triggered.connect(self._open_history)
|
act_history.triggered.connect(self._open_history)
|
||||||
file_menu.addAction(act_history)
|
file_menu.addAction(act_history)
|
||||||
act_settings = QAction(strings._("main_window_settings_accessible_flag"), self)
|
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)
|
act_settings.triggered.connect(self._open_settings)
|
||||||
file_menu.addAction(act_settings)
|
file_menu.addAction(act_settings)
|
||||||
act_export = QAction(strings._("export_accessible_flag"), self)
|
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)
|
act_export.triggered.connect(self._export)
|
||||||
file_menu.addAction(act_export)
|
file_menu.addAction(act_export)
|
||||||
act_backup = QAction("&" + strings._("backup"), self)
|
act_backup = QAction("&" + strings._("backup"), self)
|
||||||
|
|
@ -223,7 +223,7 @@ class MainWindow(QMainWindow):
|
||||||
act_backup.triggered.connect(self._backup)
|
act_backup.triggered.connect(self._backup)
|
||||||
file_menu.addAction(act_backup)
|
file_menu.addAction(act_backup)
|
||||||
act_stats = QAction(strings._("main_window_statistics_accessible_flag"), self)
|
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)
|
act_stats.triggered.connect(self._open_statistics)
|
||||||
file_menu.addAction(act_stats)
|
file_menu.addAction(act_stats)
|
||||||
file_menu.addSeparator()
|
file_menu.addSeparator()
|
||||||
|
|
@ -283,19 +283,19 @@ class MainWindow(QMainWindow):
|
||||||
# Help menu with drop-down
|
# Help menu with drop-down
|
||||||
help_menu = mb.addMenu("&" + strings._("help"))
|
help_menu = mb.addMenu("&" + strings._("help"))
|
||||||
act_docs = QAction(strings._("documentation"), self)
|
act_docs = QAction(strings._("documentation"), self)
|
||||||
act_docs.setShortcut("Ctrl+D")
|
act_docs.setShortcut("Ctrl+Shift+D")
|
||||||
act_docs.setShortcutContext(Qt.ApplicationShortcut)
|
act_docs.setShortcutContext(Qt.ApplicationShortcut)
|
||||||
act_docs.triggered.connect(self._open_docs)
|
act_docs.triggered.connect(self._open_docs)
|
||||||
help_menu.addAction(act_docs)
|
help_menu.addAction(act_docs)
|
||||||
self.addAction(act_docs)
|
self.addAction(act_docs)
|
||||||
act_bugs = QAction(strings._("report_a_bug"), self)
|
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.setShortcutContext(Qt.ApplicationShortcut)
|
||||||
act_bugs.triggered.connect(self._open_bugs)
|
act_bugs.triggered.connect(self._open_bugs)
|
||||||
help_menu.addAction(act_bugs)
|
help_menu.addAction(act_bugs)
|
||||||
self.addAction(act_bugs)
|
self.addAction(act_bugs)
|
||||||
act_version = QAction(strings._("version"), self)
|
act_version = QAction(strings._("version"), self)
|
||||||
act_version.setShortcut("Ctrl+V")
|
act_version.setShortcut("Ctrl+Shift+V")
|
||||||
act_version.setShortcutContext(Qt.ApplicationShortcut)
|
act_version.setShortcutContext(Qt.ApplicationShortcut)
|
||||||
act_version.triggered.connect(self._open_version)
|
act_version.triggered.connect(self._open_version)
|
||||||
help_menu.addAction(act_version)
|
help_menu.addAction(act_version)
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ class DateHeatmap(QWidget):
|
||||||
|
|
||||||
def minimumSizeHint(self) -> QSize:
|
def minimumSizeHint(self) -> QSize:
|
||||||
sz = self.sizeHint()
|
sz = self.sizeHint()
|
||||||
return QSize(min(350, sz.width()), sz.height())
|
return QSize(min(380, sz.width()), sz.height())
|
||||||
|
|
||||||
def paintEvent(self, event):
|
def paintEvent(self, event):
|
||||||
super().paintEvent(event)
|
super().paintEvent(event)
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,8 @@ class ToolBar(QToolBar):
|
||||||
self.actInsertImg.triggered.connect(self.insertImageRequested)
|
self.actInsertImg.triggered.connect(self.insertImageRequested)
|
||||||
|
|
||||||
# History button
|
# History button
|
||||||
self.actHistory = QAction(strings._("history"), self)
|
self.actHistory = QAction("⎌", self)
|
||||||
|
self.actHistory.setToolTip(strings._("history"))
|
||||||
self.actHistory.triggered.connect(self.historyRequested)
|
self.actHistory.triggered.connect(self.historyRequested)
|
||||||
|
|
||||||
# Set exclusive buttons in QActionGroups
|
# Set exclusive buttons in QActionGroups
|
||||||
|
|
@ -178,7 +179,7 @@ class ToolBar(QToolBar):
|
||||||
self._style_letter_button(self.actAlarm, "⏰")
|
self._style_letter_button(self.actAlarm, "⏰")
|
||||||
|
|
||||||
# History
|
# History
|
||||||
self._style_letter_button(self.actHistory, strings._("view_history"))
|
self._style_letter_button(self.actHistory, "⎌")
|
||||||
|
|
||||||
def _style_letter_button(
|
def _style_letter_button(
|
||||||
self,
|
self,
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ from PySide6.QtWidgets import (
|
||||||
QWidget,
|
QWidget,
|
||||||
QProgressDialog,
|
QProgressDialog,
|
||||||
)
|
)
|
||||||
|
from PySide6.QtGui import QPixmap, QImage, QPainter, QGuiApplication
|
||||||
|
from PySide6.QtSvg import QSvgRenderer
|
||||||
|
|
||||||
from .settings import APP_NAME
|
from .settings import APP_NAME
|
||||||
from . import strings
|
from . import strings
|
||||||
|
|
@ -50,6 +52,28 @@ class VersionChecker:
|
||||||
|
|
||||||
# ---------- Version helpers ---------- #
|
# ---------- 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:
|
def current_version(self) -> str:
|
||||||
"""
|
"""
|
||||||
Return the current app version as reported by importlib.metadata
|
Return the current app version as reported by importlib.metadata
|
||||||
|
|
@ -87,8 +111,10 @@ class VersionChecker:
|
||||||
version_formatted = f"{APP_NAME} {version}"
|
version_formatted = f"{APP_NAME} {version}"
|
||||||
|
|
||||||
box = QMessageBox(self._parent)
|
box = QMessageBox(self._parent)
|
||||||
box.setIcon(QMessageBox.Information)
|
|
||||||
box.setWindowTitle(strings._("version"))
|
box.setWindowTitle(strings._("version"))
|
||||||
|
|
||||||
|
box.setIconPixmap(self._logo_pixmap(96))
|
||||||
|
|
||||||
box.setText(version_formatted)
|
box.setText(version_formatted)
|
||||||
|
|
||||||
check_button = box.addButton(
|
check_button = box.addButton(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue