forked from Shinonome/dots-hyprland
bar: add delay for autohide
This commit is contained in:
@@ -40,7 +40,6 @@ Singleton {
|
|||||||
Timer {
|
Timer {
|
||||||
id: workspaceShowNumbersTimer
|
id: workspaceShowNumbersTimer
|
||||||
interval: Config.options.bar.workspaces.showNumberDelay
|
interval: Config.options.bar.workspaces.showNumberDelay
|
||||||
// interval: 0
|
|
||||||
repeat: false
|
repeat: false
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
workspaceShowNumbers = true
|
workspaceShowNumbers = true
|
||||||
|
|||||||
@@ -39,7 +39,27 @@ Scope {
|
|||||||
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 : (Appearance.sizes.barShortenScreenWidthThreshold >= screen.width) ? 1 : 0
|
property real useShortenedForm: (Appearance.sizes.barHellaShortenScreenWidthThreshold >= screen.width) ? 2 : (Appearance.sizes.barShortenScreenWidthThreshold >= screen.width) ? 1 : 0
|
||||||
readonly property int centerSideModuleWidth: (useShortenedForm == 2) ? Appearance.sizes.barCenterSideModuleWidthHellaShortened : (useShortenedForm == 1) ? Appearance.sizes.barCenterSideModuleWidthShortened : Appearance.sizes.barCenterSideModuleWidth
|
readonly property int centerSideModuleWidth: (useShortenedForm == 2) ? Appearance.sizes.barCenterSideModuleWidthHellaShortened : (useShortenedForm == 1) ? Appearance.sizes.barCenterSideModuleWidthShortened : Appearance.sizes.barCenterSideModuleWidth
|
||||||
|
|
||||||
property bool mustShow: hoverRegion.containsMouse || (Config?.options.bar.autoHide.showWhenPressingSuper && GlobalStates.superDown)
|
Timer {
|
||||||
|
id: showBarTimer
|
||||||
|
interval: (Config?.options.bar.autoHide.showWhenPressingSuper.delay ?? 100)
|
||||||
|
repeat: false
|
||||||
|
onTriggered: {
|
||||||
|
barRoot.superShow = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Connections {
|
||||||
|
target: GlobalStates
|
||||||
|
function onSuperDownChanged() {
|
||||||
|
if (!Config?.options.bar.autoHide.showWhenPressingSuper.enabled) return;
|
||||||
|
if (GlobalStates.superDown) showBarTimer.restart();
|
||||||
|
else {
|
||||||
|
showBarTimer.stop();
|
||||||
|
barRoot.superShow = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
property bool superShow: false
|
||||||
|
property bool mustShow: hoverRegion.containsMouse || superShow
|
||||||
exclusionMode: ExclusionMode.Ignore
|
exclusionMode: ExclusionMode.Ignore
|
||||||
exclusiveZone: (Config?.options.bar.autoHide.enabled && (!mustShow || !Config?.options.bar.autoHide.pushWindows)) ? 0 :
|
exclusiveZone: (Config?.options.bar.autoHide.enabled && (!mustShow || !Config?.options.bar.autoHide.pushWindows)) ? 0 :
|
||||||
Appearance.sizes.baseBarHeight + (Config.options.bar.cornerStyle === 1 ? Appearance.sizes.hyprlandGapsOut : 0)
|
Appearance.sizes.baseBarHeight + (Config.options.bar.cornerStyle === 1 ? Appearance.sizes.hyprlandGapsOut : 0)
|
||||||
|
|||||||
@@ -127,7 +127,10 @@ Singleton {
|
|||||||
property JsonObject autoHide: JsonObject {
|
property JsonObject autoHide: JsonObject {
|
||||||
property bool enabled: false
|
property bool enabled: false
|
||||||
property bool pushWindows: false
|
property bool pushWindows: false
|
||||||
property bool showWhenPressingSuper: true
|
property JsonObject showWhenPressingSuper: JsonObject {
|
||||||
|
property bool enabled: true
|
||||||
|
property int delay: 100
|
||||||
|
}
|
||||||
}
|
}
|
||||||
property bool bottom: false // Instead of top
|
property bool bottom: false // Instead of top
|
||||||
property int cornerStyle: 0 // 0: Hug | 1: Float | 2: Plain rectangle
|
property int cornerStyle: 0 // 0: Hug | 1: Float | 2: Plain rectangle
|
||||||
|
|||||||
Reference in New Issue
Block a user