temporary fix for focus being stolen even after release. Change to async loaders
This commit is contained in:
@@ -4,6 +4,7 @@ import Quickshell
|
||||
import QtQuick
|
||||
import qs.Components
|
||||
import qs.Config
|
||||
import qs.Modules.Launcher.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -19,26 +20,17 @@ Item {
|
||||
max -= panels.popouts.nonAnimHeight;
|
||||
return max;
|
||||
}
|
||||
property real offsetScale: shouldBeActive ? 0 : 1
|
||||
required property var panels
|
||||
required property ShellScreen screen
|
||||
required property PersistentProperties visibilities
|
||||
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
|
||||
implicitHeight: content.implicitHeight
|
||||
implicitWidth: content.implicitWidth || 400
|
||||
opacity: 1 - offsetScale
|
||||
visible: offsetScale < 1
|
||||
|
||||
Behavior on offsetScale {
|
||||
Anim {
|
||||
@@ -47,61 +39,26 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
onMaxHeightChanged: timer.start()
|
||||
|
||||
Connections {
|
||||
function onEnabledChanged(): void {
|
||||
timer.start();
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Component.onCompleted: Qt.callLater(() => Apps)
|
||||
onShouldBeActiveChanged: {
|
||||
if (shouldBeActive)
|
||||
implicitHeight = Qt.binding(() => content.implicitHeight);
|
||||
else
|
||||
implicitHeight = implicitHeight;
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: content
|
||||
|
||||
active: false
|
||||
active: root.shouldBeActive || root.visible
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: parent.top
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: Content {
|
||||
maxHeight: root.maxHeight
|
||||
panels: root.panels
|
||||
visibilities: root.visibilities
|
||||
|
||||
Component.onCompleted: root.contentHeight = implicitHeight
|
||||
}
|
||||
|
||||
Component.onCompleted: timer.start()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import qs.Modules.DesktopIcons
|
||||
|
||||
Loader {
|
||||
active: Config.background.enabled
|
||||
asynchronous: true
|
||||
asynchronous: false
|
||||
|
||||
sourceComponent: Variants {
|
||||
model: Quickshell.screens
|
||||
|
||||
Reference in New Issue
Block a user