fix search trickle through actions and variants view and mouse event stealing by wallpapertile
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Successful in 1m6s
Rust / fmt (pull_request) Successful in 1m3s
Rust / build (pull_request) Successful in 2m17s
Rust / clippy (pull_request) Successful in 1m29s
C++ / build (pull_request) Successful in 2m48s
Python / verify (pull_request) Successful in 3m16s
C++ / clang-tidy (pull_request) Successful in 4m17s
C++ / fmt (pull_request) Successful in 4s
JS/TS / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Successful in 1m6s
Rust / fmt (pull_request) Successful in 1m3s
Rust / build (pull_request) Successful in 2m17s
Rust / clippy (pull_request) Successful in 1m29s
C++ / build (pull_request) Successful in 2m48s
Python / verify (pull_request) Successful in 3m16s
C++ / clang-tidy (pull_request) Successful in 4m17s
This commit is contained in:
@@ -1,28 +1,36 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import qs.Modules.Launcher.Services
|
||||
import qs.Modules.Launcher.Items
|
||||
import qs.Components
|
||||
import Quickshell
|
||||
import ZShell.Config
|
||||
import qs.Components
|
||||
import qs.Services
|
||||
import qs.Modules.Launcher.Items
|
||||
import qs.Modules.Launcher.Services
|
||||
|
||||
CustomListView {
|
||||
id: root
|
||||
|
||||
readonly property string displayState: stateForText(displayText)
|
||||
property string displayText
|
||||
readonly property string requestedState: stateForText(search.text)
|
||||
required property SearchBar search
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
highlightFollowsCurrentItem: false
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
implicitHeight: (Config.launcher.sizes.itemHeight + spacing) * Math.min(Config.launcher.maxAppsShown, count) - spacing
|
||||
orientation: Qt.Vertical
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: height
|
||||
spacing: Tokens.spacing.small
|
||||
state: {
|
||||
const text = search.text;
|
||||
function resultsForText(text: string): var {
|
||||
switch (stateForText(text)) {
|
||||
case "actions":
|
||||
return Actions.query(text);
|
||||
case "calc":
|
||||
return [0];
|
||||
case "variant":
|
||||
return SchemeVariants.query(text);
|
||||
default:
|
||||
return Apps.search(text);
|
||||
}
|
||||
}
|
||||
|
||||
function stateForText(text: string): string {
|
||||
const prefix = Config.launcher.actionPrefix;
|
||||
if (text.startsWith(prefix)) {
|
||||
for (const action of ["calc", "scheme", "variant"])
|
||||
@@ -34,6 +42,20 @@ CustomListView {
|
||||
|
||||
return "apps";
|
||||
}
|
||||
|
||||
function syncDisplayText(): void {
|
||||
if (visibilities.launcher && requestedState === displayState)
|
||||
displayText = search.text;
|
||||
}
|
||||
|
||||
highlightFollowsCurrentItem: false
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
implicitHeight: (Config.launcher.sizes.itemHeight + spacing) * Math.min(Config.launcher.maxAppsShown, count) - spacing
|
||||
orientation: Qt.Vertical
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: height
|
||||
spacing: Tokens.spacing.small
|
||||
state: visibilities.launcher ? requestedState : displayState
|
||||
verticalLayoutDirection: ListView.BottomToTop
|
||||
|
||||
CustomScrollBar.vertical: CustomScrollBar {
|
||||
@@ -44,19 +66,21 @@ CustomListView {
|
||||
|
||||
Anim {
|
||||
from: 0
|
||||
properties: "opacity,scale"
|
||||
property: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
addDisplaced: Transition {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
property: "y"
|
||||
type: Anim.StandardSmall
|
||||
}
|
||||
|
||||
Anim {
|
||||
properties: "opacity,scale"
|
||||
property: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
displaced: Transition {
|
||||
@@ -65,8 +89,9 @@ CustomListView {
|
||||
}
|
||||
|
||||
Anim {
|
||||
properties: "opacity,scale"
|
||||
property: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
highlight: CustomRect {
|
||||
@@ -85,7 +110,7 @@ CustomListView {
|
||||
}
|
||||
}
|
||||
model: ScriptModel {
|
||||
id: model
|
||||
values: root.resultsForText(root.displayText)
|
||||
|
||||
onValuesChanged: root.currentIndex = 0
|
||||
}
|
||||
@@ -95,8 +120,9 @@ CustomListView {
|
||||
}
|
||||
|
||||
Anim {
|
||||
properties: "opacity,scale"
|
||||
property: "opacity"
|
||||
to: 1
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
remove: Transition {
|
||||
@@ -104,8 +130,9 @@ CustomListView {
|
||||
|
||||
Anim {
|
||||
from: 1
|
||||
properties: "opacity,scale"
|
||||
property: "opacity"
|
||||
to: 0
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
states: [
|
||||
@@ -113,7 +140,6 @@ CustomListView {
|
||||
name: "apps"
|
||||
|
||||
PropertyChanges {
|
||||
model.values: Apps.search(search.text)
|
||||
root.delegate: appItem
|
||||
}
|
||||
},
|
||||
@@ -121,7 +147,6 @@ CustomListView {
|
||||
name: "actions"
|
||||
|
||||
PropertyChanges {
|
||||
model.values: Actions.query(search.text)
|
||||
root.delegate: actionItem
|
||||
}
|
||||
},
|
||||
@@ -129,7 +154,6 @@ CustomListView {
|
||||
name: "calc"
|
||||
|
||||
PropertyChanges {
|
||||
model.values: [0]
|
||||
root.delegate: calcItem
|
||||
}
|
||||
},
|
||||
@@ -137,7 +161,6 @@ CustomListView {
|
||||
name: "variant"
|
||||
|
||||
PropertyChanges {
|
||||
model.values: SchemeVariants.query(search.text)
|
||||
root.delegate: variantItem
|
||||
}
|
||||
}
|
||||
@@ -147,7 +170,7 @@ CustomListView {
|
||||
ParallelAnimation {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.standardAccel
|
||||
from: 1
|
||||
property: "opacity"
|
||||
target: root
|
||||
@@ -156,7 +179,7 @@ CustomListView {
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.standardAccel
|
||||
from: 1
|
||||
property: "scale"
|
||||
target: root
|
||||
@@ -165,14 +188,24 @@ CustomListView {
|
||||
}
|
||||
|
||||
PropertyAction {
|
||||
properties: "values,delegate"
|
||||
targets: [model, root]
|
||||
property: "delegate"
|
||||
target: root
|
||||
value: null
|
||||
}
|
||||
|
||||
ScriptAction {
|
||||
script: root.displayText = root.search.text
|
||||
}
|
||||
|
||||
PropertyAction {
|
||||
property: "delegate"
|
||||
target: root
|
||||
}
|
||||
|
||||
ParallelAnimation {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.standardDecel
|
||||
from: 0
|
||||
property: "opacity"
|
||||
target: root
|
||||
@@ -181,7 +214,7 @@ CustomListView {
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.standardDecel
|
||||
from: 0.9
|
||||
property: "scale"
|
||||
target: root
|
||||
@@ -197,6 +230,8 @@ CustomListView {
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: displayText = search.text
|
||||
|
||||
Component {
|
||||
id: appItem
|
||||
|
||||
@@ -228,4 +263,20 @@ CustomListView {
|
||||
list: root
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onTextChanged() {
|
||||
root.syncDisplayText();
|
||||
}
|
||||
|
||||
target: root.search
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onLauncherChanged() {
|
||||
root.syncDisplayText();
|
||||
}
|
||||
|
||||
target: root.visibilities
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user