Moved test widgets to a demo panel
This commit is contained in:
parent
c701192c08
commit
5d6b82a80e
3 changed files with 77 additions and 24 deletions
|
|
@ -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 {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
72
Modules/DemoPanel/DemoPanel.qml
Normal file
72
Modules/DemoPanel/DemoPanel.qml
Normal 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 {}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue