import QtQuick import QtQuick.Layouts import ZShell.Config import qs.Services import qs.Components import qs.Modules.Settings.Common CustomSwitch { id: toggleItem readonly property alias bg: bg property alias first: bg.first property alias last: bg.last property string subtext Layout.fillWidth: true cLayer: 2 horizontalPadding: Tokens.padding.largeIncreased implicitHeight: Math.max(implicitContentHeight, implicitIndicatorHeight) + verticalPadding * 2 implicitWidth: implicitContentWidth + implicitIndicatorWidth + horizontalPadding * 2 indicator.anchors.right: right indicator.anchors.rightMargin: toggleItem.horizontalPadding indicator.anchors.verticalCenter: verticalCenter verticalPadding: Tokens.padding.normal background: ConnectedRect { id: bg StateLayer { id: stateLayer manualPressOverride: toggleItem.pressed } } contentItem: Item { anchors.left: parent.left anchors.leftMargin: toggleItem.horizontalPadding anchors.right: toggleItem.indicator.left anchors.rightMargin: Tokens.spacing.normal implicitHeight: column.implicitHeight implicitWidth: column.implicitWidth ColumnLayout { id: column anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter spacing: 0 CustomText { id: label Layout.fillWidth: true elide: Text.ElideRight font.pointSize: Tokens.font.size.smaller text: toggleItem.text } CustomText { id: subtext Layout.fillWidth: true color: Colors.palette.m3outline elide: Text.ElideRight font.pointSize: Tokens.font.size.small text: toggleItem.subtext visible: toggleItem.subtext } } } onPressed: stateLayer.press(stateLayer.mouseX, stateLayer.mouseY) }