summaryrefslogtreecommitdiff
path: root/modules/controlcenter/ethernet/EthernetList.qml
diff options
context:
space:
mode:
authorATMDA <atdma2600@gmail.com>2025-11-12 15:58:42 -0500
committerATMDA <atdma2600@gmail.com>2025-11-12 15:58:42 -0500
commite92187293e4afa046ca05bd80796c1fa193097e5 (patch)
treecc9fae7544271ff03c3eb2515bc8daa0c9e1cdcd /modules/controlcenter/ethernet/EthernetList.qml
parentnotifs/toasts: reworked notifications and toasts and how they display and wor... (diff)
downloadcaelestia-shell-e92187293e4afa046ca05bd80796c1fa193097e5.tar.gz
caelestia-shell-e92187293e4afa046ca05bd80796c1fa193097e5.tar.bz2
caelestia-shell-e92187293e4afa046ca05bd80796c1fa193097e5.zip
controlcenter: refactoring into components
Diffstat (limited to 'modules/controlcenter/ethernet/EthernetList.qml')
-rw-r--r--modules/controlcenter/ethernet/EthernetList.qml77
1 files changed, 1 insertions, 76 deletions
diff --git a/modules/controlcenter/ethernet/EthernetList.qml b/modules/controlcenter/ethernet/EthernetList.qml
index ff7cee2..8b04c09 100644
--- a/modules/controlcenter/ethernet/EthernetList.qml
+++ b/modules/controlcenter/ethernet/EthernetList.qml
@@ -34,7 +34,7 @@ ColumnLayout {
icon: "settings"
accent: "Primary"
- function onClicked(): void {
+ onClicked: {
if (root.session.ethernet.active)
root.session.ethernet.active = null;
else {
@@ -166,81 +166,6 @@ ColumnLayout {
implicitHeight: rowLayout.implicitHeight + Appearance.padding.normal * 2
}
}
-
- component ToggleButton: StyledRect {
- id: toggleBtn
-
- required property bool toggled
- property string icon
- property string label
- property string accent: "Secondary"
-
- function onClicked(): void {
- }
-
- Layout.preferredWidth: implicitWidth + (toggleStateLayer.pressed ? Appearance.padding.normal * 2 : toggled ? Appearance.padding.small * 2 : 0)
- implicitWidth: toggleBtnInner.implicitWidth + Appearance.padding.large * 2
- implicitHeight: toggleBtnIcon.implicitHeight + Appearance.padding.normal * 2
-
- radius: toggled || toggleStateLayer.pressed ? Appearance.rounding.small : Math.min(width, height) / 2 * Math.min(1, Appearance.rounding.scale)
- color: toggled ? Colours.palette[`m3${accent.toLowerCase()}`] : Colours.palette[`m3${accent.toLowerCase()}Container`]
-
- StateLayer {
- id: toggleStateLayer
-
- color: toggleBtn.toggled ? Colours.palette[`m3on${toggleBtn.accent}`] : Colours.palette[`m3on${toggleBtn.accent}Container`]
-
- function onClicked(): void {
- toggleBtn.onClicked();
- }
- }
-
- RowLayout {
- id: toggleBtnInner
-
- anchors.centerIn: parent
- spacing: Appearance.spacing.normal
-
- MaterialIcon {
- id: toggleBtnIcon
-
- visible: !!text
- fill: toggleBtn.toggled ? 1 : 0
- text: toggleBtn.icon
- color: toggleBtn.toggled ? Colours.palette[`m3on${toggleBtn.accent}`] : Colours.palette[`m3on${toggleBtn.accent}Container`]
- font.pointSize: Appearance.font.size.large
-
- Behavior on fill {
- Anim {}
- }
- }
-
- Loader {
- asynchronous: true
- active: !!toggleBtn.label
- visible: active
-
- sourceComponent: StyledText {
- text: toggleBtn.label
- color: toggleBtn.toggled ? Colours.palette[`m3on${toggleBtn.accent}`] : Colours.palette[`m3on${toggleBtn.accent}Container`]
- }
- }
- }
-
- Behavior on radius {
- Anim {
- duration: Appearance.anim.durations.expressiveFastSpatial
- easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
- }
- }
-
- Behavior on Layout.preferredWidth {
- Anim {
- duration: Appearance.anim.durations.expressiveFastSpatial
- easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial
- }
- }
- }
}