quicksettings: Use standard corner radius

This commit is contained in:
Devin Lin 2024-07-15 18:45:33 -04:00
parent 0a09d935ac
commit 7f011e92ed
2 changed files with 24 additions and 24 deletions

View file

@ -17,13 +17,13 @@ import org.kde.plasma.components 3.0 as PlasmaComponents
QuickSettingsDelegate { QuickSettingsDelegate {
id: root id: root
padding: Kirigami.Units.smallSpacing * 2 padding: Kirigami.Units.smallSpacing * 2
iconItem: icon iconItem: icon
// scale animation on press // scale animation on press
zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
background: Item { background: Item {
// very simple shadow for performance // very simple shadow for performance
Rectangle { Rectangle {
@ -32,15 +32,15 @@ QuickSettingsDelegate {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: parent.height height: parent.height
radius: Kirigami.Units.smallSpacing radius: Kirigami.Units.cornerRadius
color: Qt.rgba(0, 0, 0, 0.075) color: Qt.rgba(0, 0, 0, 0.075)
} }
// background color // background color
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Kirigami.Units.smallSpacing radius: Kirigami.Units.cornerRadius
border.width: 1 border.width: 1
border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor
color: { color: {
@ -52,23 +52,23 @@ QuickSettingsDelegate {
} }
} }
} }
MobileShell.HapticsEffect { MobileShell.HapticsEffect {
id: haptics id: haptics
} }
contentItem: MouseArea { contentItem: MouseArea {
id: mouseArea id: mouseArea
onPressed: haptics.buttonVibrate() onPressed: haptics.buttonVibrate()
onClicked: root.delegateClick() onClicked: root.delegateClick()
onPressAndHold: { onPressAndHold: {
haptics.buttonVibrate(); haptics.buttonVibrate();
root.delegatePressAndHold(); root.delegatePressAndHold();
} }
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
Kirigami.Icon { Kirigami.Icon {
id: icon id: icon
anchors.top: parent.top anchors.top: parent.top
@ -77,7 +77,7 @@ QuickSettingsDelegate {
implicitHeight: width implicitHeight: width
source: root.icon source: root.icon
} }
ColumnLayout { ColumnLayout {
id: column id: column
spacing: Kirigami.Units.smallSpacing spacing: Kirigami.Units.smallSpacing

View file

@ -19,10 +19,10 @@ QuickSettingsDelegate {
id: root id: root
iconItem: icon iconItem: icon
// scale animation on press // scale animation on press
zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1 zoomScale: (ShellSettings.Settings.animationsEnabled && mouseArea.pressed) ? 0.9 : 1
background: Item { background: Item {
// very simple shadow for performance // very simple shadow for performance
Rectangle { Rectangle {
@ -31,15 +31,15 @@ QuickSettingsDelegate {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
height: parent.height height: parent.height
radius: Kirigami.Units.smallSpacing radius: Kirigami.Units.cornerRadius
color: Qt.rgba(0, 0, 0, 0.075) color: Qt.rgba(0, 0, 0, 0.075)
} }
// background // background
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: Kirigami.Units.smallSpacing radius: Kirigami.Units.cornerRadius
border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor
color: { color: {
if (root.enabled) { if (root.enabled) {
@ -50,23 +50,23 @@ QuickSettingsDelegate {
} }
} }
} }
MobileShell.HapticsEffect { MobileShell.HapticsEffect {
id: haptics id: haptics
} }
contentItem: MouseArea { contentItem: MouseArea {
id: mouseArea id: mouseArea
onPressed: haptics.buttonVibrate(); onPressed: haptics.buttonVibrate();
onClicked: root.delegateClick() onClicked: root.delegateClick()
onPressAndHold: { onPressAndHold: {
haptics.buttonVibrate(); haptics.buttonVibrate();
root.delegatePressAndHold(); root.delegatePressAndHold();
} }
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
Kirigami.Icon { Kirigami.Icon {
id: icon id: icon
anchors.centerIn: parent anchors.centerIn: parent