temporary fix for focus being stolen even after release. Change to async loaders
This commit is contained in:
+1
-1
@@ -35,7 +35,7 @@ Variants {
|
|||||||
property var root: Quickshell.shellDir
|
property var root: Quickshell.shellDir
|
||||||
|
|
||||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||||
WlrLayershell.keyboardFocus: visibilities.dock || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
// WlrLayershell.keyboardFocus: visibilities.dock || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.resources ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
contentItem.focus: true
|
contentItem.focus: true
|
||||||
mask: visibilities.isDrawing ? null : region
|
mask: visibilities.isDrawing ? null : region
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import Quickshell
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Config
|
import qs.Config
|
||||||
|
import qs.Modules.Launcher.Services
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
@@ -19,26 +20,17 @@ Item {
|
|||||||
max -= panels.popouts.nonAnimHeight;
|
max -= panels.popouts.nonAnimHeight;
|
||||||
return max;
|
return max;
|
||||||
}
|
}
|
||||||
|
property real offsetScale: shouldBeActive ? 0 : 1
|
||||||
required property var panels
|
required property var panels
|
||||||
required property ShellScreen screen
|
required property ShellScreen screen
|
||||||
required property PersistentProperties visibilities
|
|
||||||
readonly property bool shouldBeActive: visibilities.launcher
|
readonly property bool shouldBeActive: visibilities.launcher
|
||||||
property real offsetScale: shouldBeActive ? 0 : 1
|
required property PersistentProperties visibilities
|
||||||
|
|
||||||
onShouldBeActiveChanged: {
|
|
||||||
if (shouldBeActive) {
|
|
||||||
implicitHeight = Qt.binding(() => content.implicitHeight);
|
|
||||||
timer.stop();
|
|
||||||
} else {
|
|
||||||
implicitHeight = implicitHeight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
visible: offsetScale < 1
|
|
||||||
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
|
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
|
||||||
implicitHeight: content.implicitHeight
|
implicitHeight: content.implicitHeight
|
||||||
implicitWidth: content.implicitWidth || 400
|
implicitWidth: content.implicitWidth || 400
|
||||||
opacity: 1 - offsetScale
|
opacity: 1 - offsetScale
|
||||||
|
visible: offsetScale < 1
|
||||||
|
|
||||||
Behavior on offsetScale {
|
Behavior on offsetScale {
|
||||||
Anim {
|
Anim {
|
||||||
@@ -47,61 +39,26 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMaxHeightChanged: timer.start()
|
Component.onCompleted: Qt.callLater(() => Apps)
|
||||||
|
onShouldBeActiveChanged: {
|
||||||
Connections {
|
if (shouldBeActive)
|
||||||
function onEnabledChanged(): void {
|
implicitHeight = Qt.binding(() => content.implicitHeight);
|
||||||
timer.start();
|
else
|
||||||
}
|
implicitHeight = implicitHeight;
|
||||||
|
|
||||||
function onMaxShownChanged(): void {
|
|
||||||
timer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
target: Config.launcher
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
function onValuesChanged(): void {
|
|
||||||
if (DesktopEntries.applications.values.length < Config.launcher.maxAppsShown)
|
|
||||||
timer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
target: DesktopEntries.applications
|
|
||||||
}
|
|
||||||
|
|
||||||
Timer {
|
|
||||||
id: timer
|
|
||||||
|
|
||||||
interval: Appearance.anim.durations.small
|
|
||||||
|
|
||||||
onRunningChanged: {
|
|
||||||
if (running && !root.shouldBeActive) {
|
|
||||||
content.visible = false;
|
|
||||||
content.active = true;
|
|
||||||
} else {
|
|
||||||
root.contentHeight = Math.min(root.maxHeight, content.implicitHeight);
|
|
||||||
content.active = Qt.binding(() => root.shouldBeActive || root.visible);
|
|
||||||
content.visible = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
active: false
|
active: root.shouldBeActive || root.visible
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
|
asynchronous: true
|
||||||
|
|
||||||
sourceComponent: Content {
|
sourceComponent: Content {
|
||||||
maxHeight: root.maxHeight
|
maxHeight: root.maxHeight
|
||||||
panels: root.panels
|
panels: root.panels
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
|
}
|
||||||
Component.onCompleted: root.contentHeight = implicitHeight
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: timer.start()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import qs.Modules.DesktopIcons
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: Config.background.enabled
|
active: Config.background.enabled
|
||||||
asynchronous: true
|
asynchronous: false
|
||||||
|
|
||||||
sourceComponent: Variants {
|
sourceComponent: Variants {
|
||||||
model: Quickshell.screens
|
model: Quickshell.screens
|
||||||
|
|||||||
Reference in New Issue
Block a user