drawers: give back focus when close
For launcher and session, give back focus to previously open one on close Also use execDetached for session buttons
This commit is contained in:
parent
8a03505846
commit
bf686b1c36
2 changed files with 14 additions and 11 deletions
|
|
@ -107,7 +107,7 @@ Item {
|
||||||
|
|
||||||
function onLauncherChanged(): void {
|
function onLauncherChanged(): void {
|
||||||
if (root.visibilities.launcher)
|
if (root.visibilities.launcher)
|
||||||
search.forceActiveFocus();
|
search.focus = true;
|
||||||
else {
|
else {
|
||||||
search.text = "";
|
search.text = "";
|
||||||
const current = list.currentList;
|
const current = list.currentList;
|
||||||
|
|
@ -115,6 +115,11 @@ Item {
|
||||||
current.currentIndex = 0;
|
current.currentIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onSessionChanged(): void {
|
||||||
|
if (root.visibilities.launcher && !root.visibilities.session)
|
||||||
|
search.focus = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import "root:/widgets"
|
||||||
import "root:/services"
|
import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
|
@ -34,6 +33,11 @@ Column {
|
||||||
if (root.visibilities.session)
|
if (root.visibilities.session)
|
||||||
logout.focus = true;
|
logout.focus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onLauncherChanged(): void {
|
||||||
|
if (root.visibilities.session && !root.visibilities.launcher)
|
||||||
|
logout.focus = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -90,22 +94,16 @@ Column {
|
||||||
radius: Appearance.rounding.large
|
radius: Appearance.rounding.large
|
||||||
color: button.activeFocus ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
|
color: button.activeFocus ? Colours.palette.m3secondaryContainer : Colours.palette.m3surfaceContainer
|
||||||
|
|
||||||
Keys.onEnterPressed: proc.startDetached()
|
Keys.onEnterPressed: Quickshell.execDetached(button.command)
|
||||||
Keys.onReturnPressed: proc.startDetached()
|
Keys.onReturnPressed: Quickshell.execDetached(button.command)
|
||||||
Keys.onEscapePressed: root.visibilities.session = false
|
Keys.onEscapePressed: root.visibilities.session = false
|
||||||
|
|
||||||
Process {
|
|
||||||
id: proc
|
|
||||||
|
|
||||||
command: button.command
|
|
||||||
}
|
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
radius: parent.radius
|
radius: parent.radius
|
||||||
color: button.activeFocus ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurface
|
color: button.activeFocus ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurface
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
proc.startDetached();
|
Quickshell.execDetached(button.command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue