launcher: allow show on hover (#498)
added `showOnHover` to launcher config, disabled by default to preserve existing functionality. when enabled, drag-to-show is disabled.
This commit is contained in:
parent
d69a400f9f
commit
468bab5e5b
3 changed files with 7 additions and 3 deletions
|
|
@ -383,7 +383,8 @@ The module automatically adds Caelestia shell to the path with **full functional
|
||||||
"schemes": false,
|
"schemes": false,
|
||||||
"variants": false,
|
"variants": false,
|
||||||
"wallpapers": false
|
"wallpapers": false
|
||||||
}
|
},
|
||||||
|
"showOnHover": false
|
||||||
},
|
},
|
||||||
"lock": {
|
"lock": {
|
||||||
"recolourLogo": false
|
"recolourLogo": false
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import Quickshell.Io
|
||||||
|
|
||||||
JsonObject {
|
JsonObject {
|
||||||
property bool enabled: true
|
property bool enabled: true
|
||||||
|
property bool showOnHover: false
|
||||||
property int maxShown: 8
|
property int maxShown: 8
|
||||||
property int maxWallpapers: 9 // Warning: even numbers look bad
|
property int maxWallpapers: 9 // Warning: even numbers look bad
|
||||||
property string specialPrefix: "@"
|
property string specialPrefix: "@"
|
||||||
|
|
|
||||||
|
|
@ -121,8 +121,10 @@ CustomMouseArea {
|
||||||
visibilities.session = false;
|
visibilities.session = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show/hide launcher on drag
|
// Show launcher on hover, or show/hide on drag if hover is disabled
|
||||||
if (pressed && inBottomPanel(panels.launcher, dragStart.x, dragStart.y) && withinPanelWidth(panels.launcher, x, y)) {
|
if (Config.launcher.showOnHover) {
|
||||||
|
visibilities.launcher = inBottomPanel(panels.launcher, x, y);
|
||||||
|
} else if (pressed && inBottomPanel(panels.launcher, dragStart.x, dragStart.y) && withinPanelWidth(panels.launcher, x, y)) {
|
||||||
const dragY = y - dragStart.y;
|
const dragY = y - dragStart.y;
|
||||||
if (dragY < -Config.launcher.dragThreshold)
|
if (dragY < -Config.launcher.dragThreshold)
|
||||||
visibilities.launcher = true;
|
visibilities.launcher = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue