revamp shortcuts

This commit is contained in:
Agel committed 2026-03-29 23:20:46 +02:00
1 parent c9e07a5c8a
commit ba2f7207d8
3 files changed
+103 -5

No files matched your search

+68
View File
@@ -101,6 +101,7 @@ ApplicationWindow {
}
ReaderPage {
id: readerPage
anchors.fill: parent
visible: window.currentPage === "reader"
}
@@ -130,14 +131,81 @@ ApplicationWindow {
z: 3000
}
// Global keyboard shortcuts - work regardless of focus
Shortcut {
sequence: "F"
context: Qt.ApplicationShortcut
onActivated: window.visibility = (window.visibility === Window.FullScreen) ? Window.Windowed : Window.FullScreen
}
Shortcut {
sequence: "F11"
context: Qt.ApplicationShortcut
onActivated: window.visibility = (window.visibility === Window.FullScreen) ? Window.Windowed : Window.FullScreen
}
Shortcut {
sequence: "Up"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage?.pageView) {
readerPage.pageView.handleScrollUp();
}
}
}
Shortcut {
sequence: "Down"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage?.pageView) {
readerPage.pageView.handleScrollDown();
}
}
}
Shortcut {
sequence: "PgUp"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage?.pageView) {
readerPage.pageView.handlePageUp();
}
}
}
Shortcut {
sequence: "PgDown"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage?.pageView) {
readerPage.pageView.handlePageDown();
}
}
}
// Fallback shortcuts using alternative key names
Shortcut {
sequence: "Prior"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage?.pageView) {
readerPage.pageView.handlePageUp();
}
}
}
Shortcut {
sequence: "Next"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage?.pageView) {
readerPage.pageView.handlePageDown();
}
}
}
Shortcut {
sequence: "Space"
context: Qt.ApplicationShortcut
onActivated: {
if (currentPage === "reader" && readerPage) {
readerPage.pageView.handlePageDown();
}
}
}
Connections {
target: bookController