Add shortcuts
This commit is contained in:
3 files changed
+35
-2
No files matched your search
+12
-1
@@ -19,6 +19,7 @@ ApplicationWindow {
|
|||||||
onSidebarOpenChanged: appState.sidebarOpen = sidebarOpen
|
onSidebarOpenChanged: appState.sidebarOpen = sidebarOpen
|
||||||
property string currentPage: "starter"
|
property string currentPage: "starter"
|
||||||
property bool _restoringState: false
|
property bool _restoringState: false
|
||||||
|
property bool barsVisible: true
|
||||||
|
|
||||||
onCurrentPageChanged: appState.lastPage = currentPage
|
onCurrentPageChanged: appState.lastPage = currentPage
|
||||||
|
|
||||||
@@ -84,6 +85,7 @@ ApplicationWindow {
|
|||||||
width: parent.width
|
width: parent.width
|
||||||
sidebarOpen: window.sidebarOpen
|
sidebarOpen: window.sidebarOpen
|
||||||
currentPage: window.currentPage
|
currentPage: window.currentPage
|
||||||
|
barsVisible: window.currentPage !== "reader" || window.barsVisible
|
||||||
onMenuClicked: window.sidebarOpen = true
|
onMenuClicked: window.sidebarOpen = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +118,7 @@ ApplicationWindow {
|
|||||||
Loader {
|
Loader {
|
||||||
id: footerLoader
|
id: footerLoader
|
||||||
width: parent.width
|
width: parent.width
|
||||||
active: window.currentPage === "reader"
|
active: window.currentPage === "reader" && window.barsVisible
|
||||||
sourceComponent: Footer {}
|
sourceComponent: Footer {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,6 +129,15 @@ ApplicationWindow {
|
|||||||
z: 3000
|
z: 3000
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Shortcut {
|
||||||
|
sequence: "F"
|
||||||
|
onActivated: window.visibility = (window.visibility === Window.FullScreen) ? Window.Windowed : Window.FullScreen
|
||||||
|
}
|
||||||
|
Shortcut {
|
||||||
|
sequence: "F11"
|
||||||
|
onActivated: window.visibility = (window.visibility === Window.FullScreen) ? Window.Windowed : Window.FullScreen
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: bookController
|
target: bookController
|
||||||
function onBookReady() {
|
function onBookReady() {
|
||||||
|
|||||||
@@ -4,11 +4,17 @@ import Asteria
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: header
|
id: header
|
||||||
height: Theme.headerHeight
|
height: barsVisible ? Theme.headerHeight : 0
|
||||||
|
clip: true
|
||||||
color: Theme.surface
|
color: Theme.surface
|
||||||
|
|
||||||
property bool sidebarOpen: false
|
property bool sidebarOpen: false
|
||||||
property string currentPage: "starter"
|
property string currentPage: "starter"
|
||||||
|
property bool barsVisible: true
|
||||||
|
|
||||||
|
Behavior on height {
|
||||||
|
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||||
|
}
|
||||||
|
|
||||||
signal menuClicked()
|
signal menuClicked()
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,22 @@ Rectangle {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
z: 1
|
||||||
|
onClicked: clickDebounce.restart()
|
||||||
|
onDoubleClicked: {
|
||||||
|
clickDebounce.stop()
|
||||||
|
window.visibility = (window.visibility === Window.FullScreen) ? Window.Windowed : Window.FullScreen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Timer {
|
||||||
|
id: clickDebounce
|
||||||
|
interval: 150
|
||||||
|
onTriggered: window.barsVisible = !window.barsVisible
|
||||||
|
}
|
||||||
|
|
||||||
// Placeholder when no book is open
|
// Placeholder when no book is open
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
Reference in new issue
Block a user