From fc223237f0938c7904360d8c2674368bffa53373 Mon Sep 17 00:00:00 2001 From: ATMDA Date: Wed, 12 Nov 2025 21:58:14 -0500 Subject: controlcenter: wireless panel rewrite --- modules/controlcenter/network/SimpleButton.qml | 36 ++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/controlcenter/network/SimpleButton.qml (limited to 'modules/controlcenter/network/SimpleButton.qml') diff --git a/modules/controlcenter/network/SimpleButton.qml b/modules/controlcenter/network/SimpleButton.qml new file mode 100644 index 0000000..49ab2f4 --- /dev/null +++ b/modules/controlcenter/network/SimpleButton.qml @@ -0,0 +1,36 @@ +import qs.components +import qs.components.effects +import qs.config +import QtQuick + +StyledRect { + id: root + + property color onColor: Colours.palette.m3onSurface + property alias disabled: stateLayer.disabled + property alias text: label.text + property alias enabled: stateLayer.enabled + + implicitWidth: label.implicitWidth + Appearance.padding.normal * 2 + implicitHeight: label.implicitHeight + Appearance.padding.normal * 2 + radius: Appearance.rounding.normal + + StateLayer { + id: stateLayer + color: parent.onColor + function onClicked(): void { + if (parent.enabled !== false) { + parent.clicked(); + } + } + } + + StyledText { + id: label + anchors.centerIn: parent + color: parent.onColor + } + + signal clicked +} + -- cgit v1.2.3-freya