Add Update sidebar menu item and macOS standard About menu

Add an "Update" entry to the sidebar to give users quick access to the
application version without interrupting their reading session. Clicking
it opens a themed modal popup (loaded conditionally via Loader) that
displays AppInfo.version and keeps any currently open book loaded,
providing a natural foundation for future update-checking functionality.

On macOS, also install a parentless QMenuBar with a QAction::AboutRole
item so Qt's Cocoa integration places "About Asteria" in the standard
macOS Application menu without adding a QML in-window menu bar. The
action invokes NSApp's standard About panel, leveraging the bundle name,
icon, and version already configured in Info.plist.
This commit is contained in:
Agel committed 2026-11-19 14:30:41 +01:00
1 parent eca05bec8d
commit 2636b7cf51
8 files changed
+182 -1

No files matched your search

+12 -1
View File
@@ -168,11 +168,16 @@ if(WIN32)
list(APPEND SOURCES "${CMAKE_CURRENT_BINARY_DIR}/asteria.rc")
endif()
if(APPLE)
enable_language(OBJCXX)
set(APP_ICON_MACOS "${CMAKE_CURRENT_SOURCE_DIR}/src/assets/asteria-qt.icns")
set_source_files_properties(${APP_ICON_MACOS} PROPERTIES
MACOSX_PACKAGE_LOCATION "Resources"
)
list(APPEND SOURCES ${APP_ICON_MACOS})
list(APPEND SOURCES
${APP_ICON_MACOS}
src/backend/MacMenuBar.h
src/backend/MacMenuBar.mm
)
endif()
# Executable
@@ -229,6 +234,10 @@ target_link_libraries(asteria-qt PRIVATE
${UCHARDET_LIB}
)
if(APPLE)
target_link_libraries(asteria-qt PRIVATE "-framework AppKit")
endif()
if(UNIX AND NOT APPLE AND Qt6DBus_FOUND)
target_link_libraries(asteria-qt PRIVATE Qt6::DBus)
target_compile_definitions(asteria-qt PRIVATE HAS_QT_DBUS)
@@ -259,6 +268,7 @@ set_source_files_properties(src/qml/components/LabeledSwitch.qml PROPERTIES QT_R
set_source_files_properties(src/qml/pages/StarterPage.qml PROPERTIES QT_RESOURCE_ALIAS pages/StarterPage.qml)
set_source_files_properties(src/qml/pages/ReaderPage.qml PROPERTIES QT_RESOURCE_ALIAS pages/ReaderPage.qml)
set_source_files_properties(src/qml/components/SettingsPopup.qml PROPERTIES QT_RESOURCE_ALIAS components/SettingsPopup.qml)
set_source_files_properties(src/qml/components/UpdatePopup.qml PROPERTIES QT_RESOURCE_ALIAS components/UpdatePopup.qml)
set_source_files_properties(src/qml/pages/HistoryPage.qml PROPERTIES QT_RESOURCE_ALIAS pages/HistoryPage.qml)
set_source_files_properties(src/qml/pages/CustomThemePage.qml PROPERTIES QT_RESOURCE_ALIAS pages/CustomThemePage.qml)
@@ -283,6 +293,7 @@ qt_add_qml_module(asteria-qt
src/qml/components/LabeledSlider.qml
src/qml/components/LabeledSwitch.qml
src/qml/components/SettingsPopup.qml
src/qml/components/UpdatePopup.qml
src/qml/pages/StarterPage.qml
src/qml/pages/ReaderPage.qml
src/qml/pages/HistoryPage.qml