Add wallust support

This commit is contained in:
Ly-sec 2025-08-12 19:39:28 +02:00
commit 48f54c0b82
32 changed files with 257 additions and 245 deletions

View file

@ -8,7 +8,8 @@ Variants {
delegate: PanelWindow { delegate: PanelWindow {
required property ShellScreen modelData required property ShellScreen modelData
property string wallpaperSource: Wallpapers.currentWallpaper !== "" && !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : "" property string wallpaperSource: Wallpapers.currentWallpaper !== ""
&& !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : ""
visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled

View file

@ -9,7 +9,8 @@ Variants {
delegate: PanelWindow { delegate: PanelWindow {
required property ShellScreen modelData required property ShellScreen modelData
property string wallpaperSource: Wallpapers.currentWallpaper !== "" && !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : "" property string wallpaperSource: Wallpapers.currentWallpaper !== ""
&& !Settings.data.wallpaper.swww.enabled ? Wallpapers.currentWallpaper : ""
visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled visible: wallpaperSource !== "" && !Settings.data.wallpaper.swww.enabled
color: "transparent" color: "transparent"

View file

@ -109,7 +109,7 @@ Variants {
sizeMultiplier: 0.8 sizeMultiplier: 0.8
showBorder: false showBorder: false
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: function () { onClicked: {
demoPanel.isLoaded = !demoPanel.isLoaded demoPanel.isLoaded = !demoPanel.isLoaded
} }
} }
@ -121,7 +121,7 @@ Variants {
sizeMultiplier: 0.8 sizeMultiplier: 0.8
showBorder: false showBorder: false
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
onClicked: function () { onClicked: {
// Map this button's center to the screen and open the side panel below it // Map this button's center to the screen and open the side panel below it
const localCenterX = width / 2 const localCenterX = width / 2
const localCenterY = height / 2 const localCenterY = height / 2

View file

@ -12,15 +12,15 @@ NClock {
target: root target: root
} }
onEntered: function () { onEntered: {
if (!calendar.isLoaded) { if (!calendar.isLoaded) {
tooltip.show() tooltip.show()
} }
} }
onExited: function () { onExited: {
tooltip.hide() tooltip.hide()
} }
onClicked: function () { onClicked: {
tooltip.hide() tooltip.hide()
calendar.isLoaded = !calendar.isLoaded calendar.isLoaded = !calendar.isLoaded
} }

View file

@ -70,7 +70,7 @@ Item {
Audio.volumeDecrement() Audio.volumeDecrement()
} }
} }
onClicked: function () { onClicked: {
audioDeviceSelector.isLoaded = !audioDeviceSelector.isLoaded audioDeviceSelector.isLoaded = !audioDeviceSelector.isLoaded
} }
} }

View file

@ -24,7 +24,7 @@ NIconButton {
return connected ? network.signalIcon(parent.currentSignal) : "wifi_off" return connected ? network.signalIcon(parent.currentSignal) : "wifi_off"
} }
tooltipText: "WiFi Networks" tooltipText: "WiFi Networks"
onClicked: function () { onClicked: {
if (!wifiMenuLoader.active) { if (!wifiMenuLoader.active) {
wifiMenuLoader.isLoaded = true wifiMenuLoader.isLoaded = true
} }

View file

@ -78,7 +78,7 @@ NLoader {
NIconButton { NIconButton {
icon: "refresh" icon: "refresh"
sizeMultiplier: 0.8 sizeMultiplier: 0.8
onClicked: function () { onClicked: {
network.refreshNetworks() network.refreshNetworks()
} }
} }
@ -86,7 +86,7 @@ NLoader {
NIconButton { NIconButton {
icon: "close" icon: "close"
sizeMultiplier: 0.8 sizeMultiplier: 0.8
onClicked: function () { onClicked: {
wifiPanel.visible = false wifiPanel.visible = false
network.onMenuClosed() network.onMenuClosed()
} }

View file

@ -47,7 +47,7 @@ NLoader {
NIconButton { NIconButton {
icon: "chevron_left" icon: "chevron_left"
onClicked: function () { onClicked: {
let newDate = new Date(grid.year, grid.month - 1, 1) let newDate = new Date(grid.year, grid.month - 1, 1)
grid.year = newDate.getFullYear() grid.year = newDate.getFullYear()
grid.month = newDate.getMonth() grid.month = newDate.getMonth()
@ -65,7 +65,7 @@ NLoader {
NIconButton { NIconButton {
icon: "chevron_right" icon: "chevron_right"
onClicked: function () { onClicked: {
let newDate = new Date(grid.year, grid.month + 1, 1) let newDate = new Date(grid.year, grid.month + 1, 1)
grid.year = newDate.getFullYear() grid.year = newDate.getFullYear()
grid.month = newDate.getMonth() grid.month = newDate.getMonth()

View file

@ -73,17 +73,17 @@ NLoader {
stepSize: 0.01 stepSize: 0.01
value: Scaling.overrideScale value: Scaling.overrideScale
implicitWidth: bgRect.width * 0.75 implicitWidth: bgRect.width * 0.75
onMoved: function () { onMoved: {
Scaling.overrideScale = value Scaling.overrideScale = value
} }
onPressedChanged: function () { onPressedChanged: {
Scaling.overrideEnabled = true Scaling.overrideEnabled = true
} }
} }
NIconButton { NIconButton {
icon: "refresh" icon: "refresh"
fontPointSize: Style.fontSizeXL * scaling fontPointSize: Style.fontSizeXL * scaling
onClicked: function () { onClicked: {
Scaling.overrideEnabled = false Scaling.overrideEnabled = false
Scaling.overrideScale = 1.0 Scaling.overrideScale = 1.0
} }
@ -171,8 +171,9 @@ NLoader {
NTextInput { NTextInput {
text: "Type anything" text: "Type anything"
Layout.fillWidth: true Layout.fillWidth: true
onEditingFinished: function () {} onEditingFinished: {
}
NDivider { NDivider {
Layout.fillWidth: true Layout.fillWidth: true
} }

View file

@ -191,7 +191,7 @@ PanelWindow {
anchors.right: parent.right anchors.right: parent.right
anchors.margins: Style.marginSmall * scaling anchors.margins: Style.marginSmall * scaling
icon: "close" icon: "close"
onClicked: function () { onClicked: {
animateOut() animateOut()
} }
} }

View file

@ -46,13 +46,11 @@ NLoader {
"label": "Wallpaper", "label": "Wallpaper",
"icon": "image", "icon": "image",
"source": "Tabs/Wallpaper.qml" "source": "Tabs/Wallpaper.qml"
}, }, {
{
"label": "Wallpaper Selector", "label": "Wallpaper Selector",
"icon": "wallpaper_slideshow", "icon": "wallpaper_slideshow",
"source": "Tabs/WallpaperSelector.qml" "source": "Tabs/WallpaperSelector.qml"
}, }, {
{
"label": "Misc", "label": "Misc",
"icon": "more_horiz", "icon": "more_horiz",
"source": "Tabs/Misc.qml" "source": "Tabs/Misc.qml"
@ -62,7 +60,7 @@ NLoader {
"source": "Tabs/About.qml" "source": "Tabs/About.qml"
}] }]
onVisibleChanged: function () { onVisibleChanged: {
if (visible) if (visible)
currentTabIndex = 0 currentTabIndex = 0
} }
@ -190,7 +188,7 @@ NLoader {
icon: "close" icon: "close"
tooltipText: "Close settings panel" tooltipText: "Close settings panel"
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
onClicked: function () { onClicked: {
settingsWindow.isLoaded = !settingsWindow.isLoaded settingsWindow.isLoaded = !settingsWindow.isLoaded
} }
} }

View file

@ -84,7 +84,7 @@ ColumnLayout {
text: Settings.data.general.avatarImage text: Settings.data.general.avatarImage
placeholderText: "/home/user/.face" placeholderText: "/home/user/.face"
Layout.fillWidth: true Layout.fillWidth: true
onEditingFinished: function () { onEditingFinished: {
Settings.data.general.avatarImage = text Settings.data.general.avatarImage = text
} }
} }

View file

@ -65,7 +65,7 @@ ColumnLayout {
NTextInput { NTextInput {
text: Settings.data.screenRecorder.directory text: Settings.data.screenRecorder.directory
Layout.fillWidth: true Layout.fillWidth: true
onEditingFinished: function () { onEditingFinished: {
Settings.data.screenRecorder.directory = text Settings.data.screenRecorder.directory = text
} }
} }

View file

@ -58,7 +58,7 @@ ColumnLayout {
text: Settings.data.location.name text: Settings.data.location.name
placeholderText: "Enter city name" placeholderText: "Enter city name"
Layout.fillWidth: true Layout.fillWidth: true
onEditingFinished: function () { onEditingFinished: {
Settings.data.location.name = text Settings.data.location.name = text
} }
} }

View file

@ -70,7 +70,7 @@ ColumnLayout {
NTextInput { NTextInput {
text: Settings.data.wallpaper.directory text: Settings.data.wallpaper.directory
Layout.fillWidth: true Layout.fillWidth: true
onEditingFinished: function () { onEditingFinished: {
Settings.data.wallpaper.directory = text Settings.data.wallpaper.directory = text
} }
} }

View file

@ -83,9 +83,8 @@ Item {
} }
NText { NText {
text: Settings.data.wallpaper.swww.enabled ? text: Settings.data.wallpaper.swww.enabled ? "Wallpapers will change with " + Settings.data.wallpaper.swww.transitionType
"Wallpapers will change with " + Settings.data.wallpaper.swww.transitionType + " transition" : + " transition" : "Wallpapers will change instantly"
"Wallpapers will change instantly"
color: Colors.textSecondary color: Colors.textSecondary
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
visible: Settings.data.wallpaper.swww.enabled visible: Settings.data.wallpaper.swww.enabled
@ -193,7 +192,9 @@ Item {
radius: parent.radius radius: parent.radius
Behavior on opacity { Behavior on opacity {
NumberAnimation { duration: 150 } NumberAnimation {
duration: 150
}
} }
} }

View file

@ -21,17 +21,23 @@ NBox {
// Performance // Performance
NIconButton { NIconButton {
icon: "speed" icon: "speed"
onClicked: function () {/* TODO: hook to power profile */ } onClicked: {
/* TODO: hook to power profile */ }
} }
// Balanced // Balanced
NIconButton { NIconButton {
icon: "balance" icon: "balance"
onClicked: function () {/* TODO: hook to power profile */ } onClicked: {
/* TODO: hook to power profile */ }
} }
// Eco // Eco
NIconButton { NIconButton {
icon: "eco" icon: "eco"
onClicked: function () {/* TODO: hook to power profile */ } onClicked: {
/* TODO: hook to power profile */ }
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -59,7 +59,7 @@ NBox {
} }
NIconButton { NIconButton {
icon: "settings" icon: "settings"
onClicked: function () { onClicked: {
if (!root.settingsWindow) { if (!root.settingsWindow) {
const comp = Qt.createComponent("../../Settings/SettingsWindow.qml") const comp = Qt.createComponent("../../Settings/SettingsWindow.qml")
if (comp.status === Component.Ready) { if (comp.status === Component.Ready) {

View file

@ -23,10 +23,10 @@ Singleton {
watchChanges: true watchChanges: true
onFileChanged: reload() onFileChanged: reload()
onAdapterUpdated: writeAdapter() onAdapterUpdated: writeAdapter()
Component.onCompleted: function () { Component.onCompleted: {
reload() reload()
} }
onLoaded: function () { onLoaded: {
loadFromCache() loadFromCache()
} }
onLoadFailed: function (error) { onLoadFailed: function (error) {

View file

@ -16,7 +16,7 @@ Singleton {
FileView { FileView {
path: locationFile path: locationFile
onAdapterUpdated: writeAdapter() onAdapterUpdated: writeAdapter()
onLoaded: function () { onLoaded: {
updateWeather() updateWeather()
} }
onLoadFailed: function (error) { onLoadFailed: function (error) {

View file

@ -47,10 +47,10 @@ Singleton {
watchChanges: true watchChanges: true
onFileChanged: reload() onFileChanged: reload()
onAdapterUpdated: writeAdapter() onAdapterUpdated: writeAdapter()
Component.onCompleted: function () { Component.onCompleted: {
reload() reload()
} }
onLoaded: function () { onLoaded: {
Qt.callLater(function () { Qt.callLater(function () {
if (adapter.wallpaper.current !== "") { if (adapter.wallpaper.current !== "") {
@ -188,8 +188,14 @@ Singleton {
Connections { Connections {
target: adapter.wallpaper target: adapter.wallpaper
function onIsRandomChanged() { Wallpapers.toggleRandomWallpaper() } function onIsRandomChanged() {
function onRandomIntervalChanged() { Wallpapers.restartRandomWallpaperTimer() } Wallpapers.toggleRandomWallpaper()
function onDirectoryChanged() { Wallpapers.loadWallpapers() } }
function onRandomIntervalChanged() {
Wallpapers.restartRandomWallpaperTimer()
}
function onDirectoryChanged() {
Wallpapers.loadWallpapers()
}
} }
} }

View file

@ -144,7 +144,7 @@ Singleton {
} }
onExited: function (exitCode, exitStatus) { onExited: function (exitCode, exitStatus) {
console.log("SWWW: Process finished with exit code:", exitCode, "status:", exitStatus)
if (exitCode !== 0) { if (exitCode !== 0) {
console.log("SWWW: Process failed. Make sure swww-daemon is running with: swww-daemon") console.log("SWWW: Process failed. Make sure swww-daemon is running with: swww-daemon")
console.log("SWWW: You can start it with: swww-daemon --format xrgb") console.log("SWWW: You can start it with: swww-daemon --format xrgb")

View file

@ -1,5 +1,6 @@
pragma Singleton pragma Singleton
pragma ComponentBehavior: Bound
pragma ComponentBehavior
import QtQuick import QtQuick
import Quickshell import Quickshell
@ -16,35 +17,35 @@ Singleton {
property var hlWorkspaces: Hyprland.workspaces.values property var hlWorkspaces: Hyprland.workspaces.values
// Detect which compositor we're using // Detect which compositor we're using
Component.onCompleted: { Component.onCompleted: {
console.log("WorkspaceManager initializing..."); console.log("WorkspaceManager initializing...")
detectCompositor(); detectCompositor()
} }
function detectCompositor() { function detectCompositor() {
try { try {
try { try {
if (Hyprland.eventSocketPath) { if (Hyprland.eventSocketPath) {
console.log("Detected Hyprland compositor"); console.log("Detected Hyprland compositor")
isHyprland = true; isHyprland = true
isNiri = false; isNiri = false
initHyprland(); initHyprland()
return; return
} }
} catch (e) { } catch (e) {
console.log("Hyprland not available:", e); console.log("Hyprland not available:", e)
} }
if (typeof Niri !== "undefined") { if (typeof Niri !== "undefined") {
console.log("Detected Niri service"); console.log("Detected Niri service")
isHyprland = false; isHyprland = false
isNiri = true; isNiri = true
initNiri(); initNiri()
return; return
} }
console.log("No supported compositor detected"); console.log("No supported compositor detected")
} catch (e) { } catch (e) {
console.error("Error detecting compositor:", e); console.error("Error detecting compositor:", e)
} }
} }
@ -52,105 +53,105 @@ Singleton {
function initHyprland() { function initHyprland() {
try { try {
// Fixes the odd workspace issue. // Fixes the odd workspace issue.
Hyprland.refreshWorkspaces(); Hyprland.refreshWorkspaces()
// hlWorkspaces = Hyprland.workspaces.values; // hlWorkspaces = Hyprland.workspaces.values;
// updateHyprlandWorkspaces(); // updateHyprlandWorkspaces();
return true; return true
} catch (e) { } catch (e) {
console.error("Error initializing Hyprland:", e); console.error("Error initializing Hyprland:", e)
isHyprland = false; isHyprland = false
return false; return false
} }
} }
onHlWorkspacesChanged: { onHlWorkspacesChanged: {
updateHyprlandWorkspaces(); updateHyprlandWorkspaces()
} }
Connections { Connections {
target: Hyprland.workspaces target: Hyprland.workspaces
function onValuesChanged() { function onValuesChanged() {
updateHyprlandWorkspaces(); updateHyprlandWorkspaces()
} }
} }
Connections { Connections {
target: Hyprland target: Hyprland
function onRawEvent(event) { function onRawEvent(event) {
updateHyprlandWorkspaces(); updateHyprlandWorkspaces()
} }
} }
function updateHyprlandWorkspaces() { function updateHyprlandWorkspaces() {
workspaces.clear(); workspaces.clear()
try { try {
for (let i = 0; i < hlWorkspaces.length; i++) { for (var i = 0; i < hlWorkspaces.length; i++) {
const ws = hlWorkspaces[i]; const ws = hlWorkspaces[i]
// Only append workspaces with id >= 1 // Only append workspaces with id >= 1
if (ws.id >= 1) { if (ws.id >= 1) {
workspaces.append({ workspaces.append({
id: i, "id": i,
idx: ws.id, "idx": ws.id,
name: ws.name || "", "name": ws.name || "",
output: ws.monitor?.name || "", "output": ws.monitor?.name || "",
isActive: ws.active === true, "isActive": ws.active === true,
isFocused: ws.focused === true, "isFocused": ws.focused === true,
isUrgent: ws.urgent === true "isUrgent": ws.urgent === true
}); })
} }
} }
workspacesChanged(); workspacesChanged()
} catch (e) { } catch (e) {
console.error("Error updating Hyprland workspaces:", e); console.error("Error updating Hyprland workspaces:", e)
} }
} }
function initNiri() { function initNiri() {
updateNiriWorkspaces(); updateNiriWorkspaces()
} }
Connections { Connections {
target: Niri target: Niri
function onWorkspacesChanged() { function onWorkspacesChanged() {
updateNiriWorkspaces(); updateNiriWorkspaces()
} }
} }
function updateNiriWorkspaces() { function updateNiriWorkspaces() {
const niriWorkspaces = Niri.workspaces || []; const niriWorkspaces = Niri.workspaces || []
workspaces.clear(); workspaces.clear()
for (let i = 0; i < niriWorkspaces.length; i++) { for (var i = 0; i < niriWorkspaces.length; i++) {
const ws = niriWorkspaces[i]; const ws = niriWorkspaces[i]
workspaces.append({ workspaces.append({
id: ws.id, "id": ws.id,
idx: ws.idx || 1, "idx": ws.idx || 1,
name: ws.name || "", "name": ws.name || "",
output: ws.output || "", "output": ws.output || "",
isFocused: ws.isFocused === true, "isFocused": ws.isFocused === true,
isActive: ws.isActive === true, "isActive": ws.isActive === true,
isUrgent: ws.isUrgent === true, "isUrgent": ws.isUrgent === true,
isOccupied: ws.isOccupied === true, "isOccupied": ws.isOccupied === true
}); })
} }
workspacesChanged(); workspacesChanged()
} }
function switchToWorkspace(workspaceId) { function switchToWorkspace(workspaceId) {
if (isHyprland) { if (isHyprland) {
try { try {
Hyprland.dispatch(`workspace ${workspaceId}`); Hyprland.dispatch(`workspace ${workspaceId}`)
} catch (e) { } catch (e) {
console.error("Error switching Hyprland workspace:", e); console.error("Error switching Hyprland workspace:", e)
} }
} else if (isNiri) { } else if (isNiri) {
try { try {
Quickshell.execDetached(["niri", "msg", "action", "focus-workspace", workspaceId.toString()]); Quickshell.execDetached(["niri", "msg", "action", "focus-workspace", workspaceId.toString()])
} catch (e) { } catch (e) {
console.error("Error switching Niri workspace:", e); console.error("Error switching Niri workspace:", e)
} }
} else { } else {
console.warn("No supported compositor detected for workspace switching"); console.warn("No supported compositor detected for workspace switching")
} }
} }
} }

View file

@ -6,9 +6,10 @@ Rectangle {
id: root id: root
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
property var onEntered: function () {}
property var onExited: function () {} signal entered
property var onClicked: function () {} signal exited
signal clicked
width: textItem.paintedWidth width: textItem.paintedWidth
height: textItem.paintedHeight height: textItem.paintedHeight
@ -26,8 +27,8 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: true
onEntered: root.onEntered() onEntered: root.entered()
onExited: root.onExited() onExited: root.exited()
onClicked: root.onClicked() onClicked: root.clicked()
} }
} }

View file

@ -13,7 +13,8 @@ ComboBox {
property list<string> optionsKeys: [] property list<string> optionsKeys: []
property list<string> optionsLabels: [] property list<string> optionsLabels: []
property string currentKey: '' property string currentKey: ''
property var onSelected: function (string) {}
signal selected(string key)
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: height Layout.preferredHeight: height
@ -21,7 +22,7 @@ ComboBox {
model: optionsKeys model: optionsKeys
currentIndex: model.indexOf(currentKey) currentIndex: model.indexOf(currentKey)
onActivated: { onActivated: {
root.onSelected(model[currentIndex]) root.selected(model[currentIndex])
} }
// Rounded background // Rounded background

View file

@ -15,12 +15,13 @@ Rectangle {
property bool showBorder: true property bool showBorder: true
property bool enabled: true property bool enabled: true
property bool hovering: false property bool hovering: false
property var onEntered: function () {}
property var onExited: function () {}
property var onClicked: function () {}
property real fontPointSize: Style.fontSizeMedium property real fontPointSize: Style.fontSizeMedium
property string fontFamily: "Material Symbols Outlined" property string fontFamily: "Material Symbols Outlined"
signal entered
signal exited
signal clicked
implicitWidth: size implicitWidth: size
implicitHeight: size implicitHeight: size
@ -62,20 +63,20 @@ Rectangle {
if (tooltipText) { if (tooltipText) {
tooltip.show() tooltip.show()
} }
root.onEntered() root.entered()
} }
onExited: { onExited: {
hovering = false hovering = false
if (tooltipText) { if (tooltipText) {
tooltip.hide() tooltip.hide()
} }
root.onExited() root.exited()
} }
onClicked: { onClicked: {
if (tooltipText) { if (tooltipText) {
tooltip.hide() tooltip.hide()
} }
root.onClicked() root.clicked()
} }
} }
} }

View file

@ -4,26 +4,27 @@ import Quickshell.Wayland
import qs.Services import qs.Services
PanelWindow { PanelWindow {
id: outerPanel id: root
readonly property real scaling: Scaling.scale(screen) readonly property real scaling: Scaling.scale(screen)
property bool showOverlay: Settings.data.general.dimDesktop property bool showOverlay: Settings.data.general.dimDesktop
property int topMargin: Style.barHeight * scaling property int topMargin: Style.barHeight * scaling
property color overlayColor: showOverlay ? Colors.overlay : "transparent" property color overlayColor: showOverlay ? Colors.overlay : "transparent"
signal dismissed signal dismissed
function hide() { function hide() {
//visible = false //visible = false
dismissed() root.dismissed()
} }
function show() { function show() {
// Ensure only one panel is visible at a time using Settings as ephemeral store // Ensure only one panel is visible at a time using Settings as ephemeral store
try { try {
if (Settings.openPanel && Settings.openPanel !== outerPanel && Settings.openPanel.hide) { if (Settings.openPanel && Settings.openPanel !== root && Settings.openPanel.hide) {
Settings.openPanel.hide() Settings.openPanel.hide()
} }
Settings.openPanel = outerPanel Settings.openPanel = root
} catch (e) { } catch (e) {
// ignore // ignore
@ -45,7 +46,7 @@ PanelWindow {
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
onClicked: outerPanel.hide() onClicked: root.hide()
} }
Behavior on color { Behavior on color {
@ -57,16 +58,16 @@ PanelWindow {
Component.onDestruction: { Component.onDestruction: {
try { try {
if (visible && Settings.openPanel === outerPanel) if (visible && Settings.openPanel === root)
Settings.openPanel = null Settings.openPanel = null
} catch (e) { } catch (e) {
} }
} }
onVisibleChanged: function () { onVisibleChanged: {
try { try {
if (!visible && Settings.openPanel === outerPanel) if (!visible && Settings.openPanel === root)
Settings.openPanel = null Settings.openPanel = null
} catch (e) { } catch (e) {

View file

@ -18,10 +18,12 @@ Item {
property real sizeMultiplier: 0.8 property real sizeMultiplier: 0.8
property bool autoHide: false property bool autoHide: false
property var onEntered: function () {} signal shown
property var onExited: function () {} signal hidden
property var onClicked: function () {} signal entered
property var onWheel: function (delta) {} signal exited
signal clicked
signal wheel(int delta)
// Internal state // Internal state
property bool showPill: false property bool showPill: false
@ -34,10 +36,6 @@ Item {
readonly property int pillOverlap: iconSize * 0.5 readonly property int pillOverlap: iconSize * 0.5
readonly property int maxPillWidth: Math.max(1, textItem.implicitWidth + pillPaddingHorizontal * 2 + pillOverlap) readonly property int maxPillWidth: Math.max(1, textItem.implicitWidth + pillPaddingHorizontal * 2 + pillOverlap)
// TBC, do we use those ?
signal shown
signal hidden
width: iconSize + (showPill ? maxPillWidth - pillOverlap : 0) width: iconSize + (showPill ? maxPillWidth - pillOverlap : 0)
height: pillHeight height: pillHeight
@ -127,7 +125,7 @@ Item {
} }
onStopped: { onStopped: {
delayedHideAnim.start() delayedHideAnim.start()
shown() root.shown()
} }
} }
@ -166,7 +164,7 @@ Item {
onStopped: { onStopped: {
showPill = false showPill = false
shouldAnimateHide = false shouldAnimateHide = false
hidden() root.hidden()
} }
} }
@ -194,18 +192,18 @@ Item {
onEntered: { onEntered: {
showDelayed() showDelayed()
tooltip.show() tooltip.show()
root.onEntered() root.entered()
} }
onExited: { onExited: {
hide() hide()
tooltip.hide() tooltip.hide()
root.onExited() root.exited()
} }
onClicked: { onClicked: {
root.onClicked() root.clicked()
} }
onWheel: wheel => { onWheel: wheel => {
root.onWheel(wheel.angleDelta.y) root.wheel(wheel.angleDelta.y)
} }
} }

View file

@ -35,14 +35,6 @@ Slider {
height: parent.height height: parent.height
color: Colors.accentPrimary color: Colors.accentPrimary
radius: parent.radius radius: parent.radius
// Feels more responsive without animation
// Behavior on width {
// NumberAnimation {
// duration: 50
// easing.type: Easing.OutQuad
// }
// }
} }
// Circular cutout // Circular cutout
@ -84,6 +76,7 @@ Slider {
color: root.pressed ? Colors.surfaceVariant : Colors.surface color: root.pressed ? Colors.surfaceVariant : Colors.surface
border.color: Colors.accentPrimary border.color: Colors.accentPrimary
border.width: Math.max(1, Style.borderThick * scaling) border.width: Math.max(1, Style.borderThick * scaling)
// Press feedback halo (using accent color, low opacity) // Press feedback halo (using accent color, low opacity)
Rectangle { Rectangle {
anchors.centerIn: parent anchors.centerIn: parent

View file

@ -13,7 +13,8 @@ Item {
property alias placeholderText: input.placeholderText property alias placeholderText: input.placeholderText
property bool readOnly: false property bool readOnly: false
property bool enabled: true property bool enabled: true
property var onEditingFinished: function () {}
signal editingFinished
// Sizing // Sizing
implicitHeight: Style.baseWidgetSize * 1.25 * scaling implicitHeight: Style.baseWidgetSize * 1.25 * scaling
@ -55,7 +56,7 @@ Item {
placeholderTextColor: Colors.textSecondary placeholderTextColor: Colors.textSecondary
background: null background: null
font.pointSize: Style.fontSizeSmall * scaling font.pointSize: Style.fontSizeSmall * scaling
onEditingFinished: root.onEditingFinished() onEditingFinished: root.editingFinished()
// Text changes are observable via the aliased 'text' property (root.text) and its 'textChanged' signal. // Text changes are observable via the aliased 'text' property (root.text) and its 'textChanged' signal.
// No additional callback is invoked here to avoid conflicts with QML's onTextChanged handler semantics. // No additional callback is invoked here to avoid conflicts with QML's onTextChanged handler semantics.
} }

View file

@ -12,7 +12,8 @@ RowLayout {
property bool value: false property bool value: false
property bool hovering: false property bool hovering: false
property int baseSize: Style.baseWidgetSize property int baseSize: Style.baseWidgetSize
property var onToggled: function (value) {}
signal toggled(bool balue)
Layout.fillWidth: true Layout.fillWidth: true
@ -72,7 +73,7 @@ RowLayout {
onExited: hovering = false onExited: hovering = false
onClicked: { onClicked: {
value = !value value = !value
root.onToggled(value) root.toggled(value)
} }
} }
} }