refactor: redo app launcher

This commit is contained in:
kossLAN 2025-10-16 18:30:10 -04:00
parent f59fe534cf
commit fbd9c212e5
Signed by: kossLAN
SSH key fingerprint: SHA256:bdV0x+wdQHGJ6LgmstH3KV8OpWY+OOFmJcPcB0wQPV8
6 changed files with 134 additions and 99 deletions

View file

@ -15,9 +15,9 @@
(system: fn system nixpkgs.legacyPackages.${system});
in {
packages = forEachSystem (system: pkgs: rec {
default = minmat;
minmat = pkgs.stdenv.mkDerivation {
pname = "minmat";
default = dots;
dots = pkgs.stdenv.mkDerivation {
pname = "dots";
version = "0.1.0";
src = ./shell;

View file

@ -73,11 +73,11 @@ Variants {
Layout.fillHeight: true
}
VolumeIndicator {
bar: root
Layout.preferredWidth: this.height
Layout.fillHeight: true
}
// VolumeIndicator {
// bar: root
// Layout.preferredWidth: this.height
// Layout.fillHeight: true
// }
PowerMenu {
bar: root

View file

@ -34,44 +34,51 @@ Singleton {
LazyLoader {
id: loader
activeAsync: persist.launcherOpen
// activeAsync: persist.launcherOpen
active: persist.launcherOpen
PanelWindow {
implicitWidth: 500
implicitHeight: 7 + searchContainer.implicitHeight + list.topMargin * 2 + list.delegateHeight * 10
color: "transparent"
exclusiveZone: 0
WlrLayershell.keyboardFocus: WlrKeyboardFocus.Exclusive
// WlrLayershell.namespace: "shell:launcher"
StyledRectangle {
id: container
anchors {
top: true
bottom: true
left: true
right: true
}
WrapperRectangle {
clip: true
radius: 12
color: ShellSettings.colors.surface_translucent
margin: 6
border {
width: 1
color: ShellSettings.colors.active_translucent
}
anchors {
fill: parent
margins: 10
}
Behavior on height {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: screen.height / 2.75
}
ColumnLayout {
anchors.fill: parent
anchors.margins: 7
anchors.topMargin: 10
anchors.bottomMargin: 0
spacing: 0
id: column
anchors.centerIn: parent
StyledRectangle {
id: searchContainer
Layout.fillWidth: true
implicitHeight: searchbox.implicitHeight + 15
radius: 6
// Width is largely determined by size of the searchContainer
Layout.preferredWidth: 500
RowLayout {
id: searchbox
anchors.fill: parent
@ -79,8 +86,8 @@ Singleton {
TextInput {
id: search
Layout.fillWidth: true
color: ShellSettings.colors.highlight
Layout.fillWidth: true
focus: true
Keys.forwardTo: [list]
@ -113,14 +120,41 @@ Singleton {
ListView {
id: list
Layout.fillWidth: true
Layout.fillHeight: true
visible: opacity > 0
opacity: matchesLength != 0 ? 1 : 0
clip: true
cacheBuffer: 0 // works around QTBUG-131106
//reuseItems: true
Layout.fillWidth: true
Layout.preferredHeight: Math.min(matchesLength * delegateHeight, 500)
Behavior on opacity {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
Behavior on Layout.preferredHeight {
NumberAnimation {
duration: 200
easing.type: Easing.OutCubic
}
}
property var matchesLength: model.values.length
model: ScriptModel {
values: DesktopEntries.applications.values.map(object => {
values: {
const stxt = search.text.toLowerCase();
if (stxt === '')
return [];
return DesktopEntries.applications.values.map(object => {
// const stxt = search.text.toLowerCase();
const ntxt = object.name.toLowerCase();
let si = 0;
let ni = 0;
@ -196,14 +230,12 @@ Singleton {
return s;
return a.object.name.localeCompare(b.object.name);
}).map(entry => entry.object)
}).map(entry => entry.object);
}
onValuesChanged: list.currentIndex = 0
}
topMargin: 7
bottomMargin: list.count == 0 ? 0 : 7
add: Transition {
NumberAnimation {
property: "opacity"
@ -269,6 +301,7 @@ Singleton {
readonly property real delegateHeight: 44
delegate: MouseArea {
id: entryMouseArea
required property DesktopEntry modelData
implicitHeight: list.delegateHeight
@ -281,6 +314,7 @@ Singleton {
RowLayout {
id: delegateLayout
anchors {
verticalCenter: parent.verticalCenter
left: parent.left
@ -291,10 +325,11 @@ Singleton {
Layout.alignment: Qt.AlignVCenter
asynchronous: true
implicitSize: 30
source: Quickshell.iconPath(modelData.icon)
source: Quickshell.iconPath(entryMouseArea.modelData.icon)
}
Text {
text: modelData.name
text: entryMouseArea.modelData.name
color: ShellSettings.colors.active
Layout.alignment: Qt.AlignVCenter
}

View file

@ -114,8 +114,8 @@ Item {
font.bold: true
elide: Text.ElideRight
maximumLineCount: 1
Layout.preferredWidth: implicitWidth
Layout.maximumWidth: topRow.width * 0.3
// Layout.preferredWidth: implicitWidth
// Layout.maximumWidth: topRow.width * 0.3
}
Text {

View file

@ -39,7 +39,7 @@ Scope {
onVisibleCountChanged: visible = visibleCount != 0
color: "transparent"
implicitWidth: 525
implicitWidth: 500
visible: false
exclusionMode: ExclusionMode.Normal