waffles: functioning search

This commit is contained in:
end-4
2025-12-05 00:19:21 +01:00
parent 8e704e4009
commit 9043ae7bf6
48 changed files with 648 additions and 88 deletions
@@ -152,6 +152,7 @@ Singleton {
property real normal: 11
property real large: 13
property real larger: 15
property real xlarger: 17
}
}
@@ -48,7 +48,7 @@ Singleton {
}
property string batteryLevelIcon: {
const discreteLevel = Math.ceil(Battery.percentage * 10)
const discreteLevel = Math.ceil(Battery.percentage * 10);
return `battery-${discreteLevel > 9 ? "full" : discreteLevel}`;
}
@@ -107,7 +107,8 @@ Singleton {
function audioAppIcon(node) {
let icon;
icon = AppSearch.guessIcon(node?.properties["application.icon-name"] ?? "");
if (AppSearch.iconExists(icon)) return icon;
if (AppSearch.iconExists(icon))
return icon;
icon = AppSearch.guessIcon(node?.properties["node.name"] ?? "");
return icon;
}
@@ -127,4 +128,60 @@ Singleton {
return "bluetooth";
}
function fluentFromMaterial(icon) {
switch (icon) {
case "calculate":
return "calculator";
case "keyboard_return":
return "arrow-enter-left";
case "open_in_new":
return "open";
case "settings_suggest":
return "wand";
case "terminal":
return "app-generic";
case "travel_explore":
return "globe-search";
case "keep":
return "pin";
case "keep_off":
return "pin-off";
default:
return "apps";
}
}
function guessIconForName(name) {
const lowerName = name.toLowerCase();
if (lowerName.includes("app") || lowerName.includes("desktop"))
return "apps";
if (lowerName.includes("news"))
return "news";
if (lowerName.includes("new") || lowerName.includes("create") || lowerName.includes("add"))
return "add";
if (lowerName.includes("open"))
return "open";
if (lowerName.includes("friends") || lowerName.includes("contact") || lowerName.includes("family"))
return "people";
if (lowerName.includes("community"))
return "people-team";
if (lowerName.includes("library"))
return "library";
if (lowerName.includes("setting"))
return "settings";
if (lowerName.includes("gallery"))
return "image-copy";
if (lowerName.includes("server"))
return "server";
if (lowerName.includes("picture") || lowerName.includes("photo") || lowerName.includes("image"))
return "image";
if (lowerName.includes("store") || lowerName.includes("shop"))
return "store-microsoft";
if (lowerName.includes("record") || lowerName.includes("capture"))
return "record";
if (lowerName.includes("screen") || lowerName.includes("display") || lowerName.includes("monitor") || lowerName.includes("desktop"))
return "desktop";
return "apps";
}
}
@@ -0,0 +1,10 @@
import qs.modules.common
import qs.modules.common.widgets
import QtQuick
import QtQuick.Controls
ListView {
id: root
ScrollBar.vertical: WScrollBar {}
}
@@ -0,0 +1,25 @@
import QtQuick
import QtQuick.Controls
import qs.modules.common
import qs.modules.common.widgets
import qs.modules.common.functions
ScrollBar {
id: root
policy: ScrollBar.AsNeeded
active: hovered || pressed
property color color: Looks.colors.controlBg
contentItem: Rectangle {
implicitWidth: root.active ? 4 : 2
implicitHeight: root.visualSize
radius: 9999
color: root.color
opacity: root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1.0) ? 0.5 : 0
Behavior on opacity {
animation: Looks.transition.opacity.createObject(this)
}
}
}