mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
top bar manual show/hide
This commit is contained in:
@@ -83,6 +83,7 @@ Singleton {
|
||||
property real cornerRadius: 12
|
||||
property bool notificationOverlayEnabled: false
|
||||
property bool topBarAutoHide: false
|
||||
property bool topBarVisible: true
|
||||
property real topBarSpacing: 4
|
||||
property real topBarInnerPadding: 8
|
||||
property bool topBarSquareCorners: false
|
||||
@@ -267,6 +268,8 @@ Singleton {
|
||||
!== undefined ? settings.notificationOverlayEnabled : false
|
||||
topBarAutoHide = settings.topBarAutoHide
|
||||
!== undefined ? settings.topBarAutoHide : false
|
||||
topBarVisible = settings.topBarVisible
|
||||
!== undefined ? settings.topBarVisible : true
|
||||
notificationTimeoutLow = settings.notificationTimeoutLow
|
||||
!== undefined ? settings.notificationTimeoutLow : 5000
|
||||
notificationTimeoutNormal = settings.notificationTimeoutNormal
|
||||
@@ -356,6 +359,7 @@ Singleton {
|
||||
"cornerRadius": cornerRadius,
|
||||
"notificationOverlayEnabled": notificationOverlayEnabled,
|
||||
"topBarAutoHide": topBarAutoHide,
|
||||
"topBarVisible": topBarVisible,
|
||||
"topBarSpacing": topBarSpacing,
|
||||
"topBarInnerPadding": topBarInnerPadding,
|
||||
"topBarSquareCorners": topBarSquareCorners,
|
||||
@@ -858,6 +862,16 @@ Singleton {
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setTopBarVisible(visible) {
|
||||
topBarVisible = visible
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function toggleTopBarVisible() {
|
||||
topBarVisible = !topBarVisible
|
||||
saveSettings()
|
||||
}
|
||||
|
||||
function setNotificationTimeoutLow(timeout) {
|
||||
notificationTimeoutLow = timeout
|
||||
saveSettings()
|
||||
@@ -1010,4 +1024,27 @@ Singleton {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
function show() {
|
||||
root.setTopBarVisible(true)
|
||||
return "BAR_SHOW_SUCCESS"
|
||||
}
|
||||
|
||||
function hide() {
|
||||
root.setTopBarVisible(false)
|
||||
return "BAR_HIDE_SUCCESS"
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
root.toggleTopBarVisible()
|
||||
return topBarVisible ? "BAR_SHOW_SUCCESS" : "BAR_HIDE_SUCCESS"
|
||||
}
|
||||
|
||||
function status() {
|
||||
return topBarVisible ? "visible" : "hidden"
|
||||
}
|
||||
|
||||
target: "bar"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user