revamp shortcuts
This commit is contained in:
1 parent
c9e07a5c8a
commit
ba2f7207d8
3 files changed
+103
-5
No files matched your search
@@ -5,8 +5,32 @@ import Asteria
|
||||
Rectangle {
|
||||
focus: true
|
||||
|
||||
Keys.onLeftPressed: readingModel.previousChapter()
|
||||
Keys.onRightPressed: readingModel.nextChapter()
|
||||
// Public methods for global keyboard navigation
|
||||
function handlePageUp() {
|
||||
var scrollAmount = chunkListView.height * 0.95;
|
||||
chunkListView.contentY = Math.max(0, chunkListView.contentY - scrollAmount);
|
||||
}
|
||||
|
||||
function handlePageDown() {
|
||||
var scrollAmount = chunkListView.height * 0.95;
|
||||
var maxY = Math.max(0, chunkListView.contentHeight - chunkListView.height);
|
||||
chunkListView.contentY = Math.min(maxY, chunkListView.contentY + scrollAmount);
|
||||
}
|
||||
|
||||
function handleScrollUp() {
|
||||
// Scroll up by approximately 2-3 lines
|
||||
var lineHeight = appState.fontSize * appState.lineSpacing;
|
||||
var scrollAmount = lineHeight * 3; // ~2-3 lines
|
||||
chunkListView.contentY = Math.max(0, chunkListView.contentY - scrollAmount);
|
||||
}
|
||||
|
||||
function handleScrollDown() {
|
||||
// Scroll down by approximately 2-3 lines
|
||||
var lineHeight = appState.fontSize * appState.lineSpacing;
|
||||
var scrollAmount = lineHeight * 3; // ~2-3 lines
|
||||
var maxY = Math.max(0, chunkListView.contentHeight - chunkListView.height);
|
||||
chunkListView.contentY = Math.min(maxY, chunkListView.contentY + scrollAmount);
|
||||
}
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: Theme.gradientTop }
|
||||
|
||||
Reference in new issue
Block a user