Moved test widgets to a demo panel

This commit is contained in:
quadbyte 2025-08-09 18:23:33 -04:00
parent c701192c08
commit 5d6b82a80e
3 changed files with 77 additions and 24 deletions

View file

@ -33,32 +33,13 @@ PanelWindow {
// Testing widgets // Testing widgets
RowLayout { RowLayout {
NToggle {
label: "Label"
description: "Description"
onToggled: function(value: bool) {
console.log("NToggle: " + value)
}
}
NIconButton { NIconButton {
id: myIconButton id: demoPanelToggler
icon: "refresh" icon: "experiment"
onEntered: function() { onClicked: function () {
myTooltip.show(); demoPanel.visible ? demoPanel.hide() : demoPanel.show()
}
onExited: function() {
myTooltip.hide();
} }
} }
NTooltip {
id: myTooltip
target: myIconButton
positionAbove: false
text: "Hello world"
}
NSlider {}
Clock {} Clock {}
} }

View file

@ -37,7 +37,7 @@ Rectangle {
onClicked: function () { onClicked: function () {
calendar.visible = !calendar.visible calendar.visible = !calendar.visible
if (calendar.visible) { if (calendar.visible) {
tooltip.hide(); tooltip.hide()
} }
} }
} }

View file

@ -0,0 +1,72 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Quickshell
import Quickshell.Wayland
import qs.Services
import qs.Widgets
/*
An experiment/demo panel to tweaks widgets
*/
NPanel {
id: root
readonly property real scaling: Scaling.scale(screen)
Rectangle {
color: Theme.backgroundPrimary
radius: Style.radiusMedium * scaling
border.color: Theme.backgroundTertiary
border.width: Math.max(1, 1.5 * scale)
width: 340 * scaling
height: 200
anchors.top: parent.top
anchors.right: parent.right
anchors.topMargin: 4 * scaling
anchors.rightMargin: 4 * scaling
// Prevent closing when clicking in the panel bg
MouseArea {
anchors.fill: parent
}
ColumnLayout {
anchors.fill: parent
anchors.margins: 16 * scaling
spacing: 12 * scaling
NToggle {
label: "Label"
description: "Description"
onToggled: function(value: bool) {
console.log("NToggle: " + value)
}
}
NIconButton {
id: myIconButton
icon: "refresh"
onEntered: function() {
myTooltip.show();
}
onExited: function() {
myTooltip.hide();
}
}
NTooltip {
id: myTooltip
target: myIconButton
positionAbove: false
text: "Hello world"
}
NSlider {}
}
}
}