Commit 01a2374a authored by Noah Davis's avatar Noah Davis 🌵
Browse files

[Delegates] Change how color set is selected

Use same color set for down and highlight

don't inherit if backround is null or invisible
parent c62f6011
......@@ -44,15 +44,13 @@ T.CheckDelegate {
icon.height: Kirigami.Units.iconSizes.auto
Kirigami.Theme.colorSet: {
if (control.down) {
if (control.down || control.highlighted) {
return Kirigami.Theme.Button
} else if (control.highlighted) {
return Kirigami.Theme.Selection
} else {
return Kirigami.Theme.View
return parent.Kirigami.Theme.colorSet ?? Kirigami.Theme.View
}
}
Kirigami.Theme.inherit: !control.highlighted && !control.down
Kirigami.Theme.inherit: !background || !background.visible && !(control.highlighted || control.down)
contentItem: IconLabelContent {
control: control
......
......@@ -43,15 +43,13 @@ T.ItemDelegate {
icon.height: Kirigami.Units.iconSizes.auto
Kirigami.Theme.colorSet: {
if (control.down) {
if (control.down || control.highlighted) {
return Kirigami.Theme.Button
} else if (control.highlighted) {
return Kirigami.Theme.Selection
} else {
return Kirigami.Theme.View
return parent.Kirigami.Theme.colorSet ?? Kirigami.Theme.View
}
}
Kirigami.Theme.inherit: !control.highlighted && !control.down
Kirigami.Theme.inherit: !background || !background.visible && !(control.highlighted || control.down)
contentItem: IconLabelContent {
control: control
......
......@@ -44,15 +44,13 @@ T.RadioDelegate {
icon.height: Kirigami.Units.iconSizes.auto
Kirigami.Theme.colorSet: {
if (control.down) {
if (control.down || control.highlighted) {
return Kirigami.Theme.Button
} else if (control.highlighted) {
return Kirigami.Theme.Selection
} else {
return Kirigami.Theme.View
return parent.Kirigami.Theme.colorSet ?? Kirigami.Theme.View
}
}
Kirigami.Theme.inherit: !control.highlighted && !control.down
Kirigami.Theme.inherit: !background || !background.visible && !(control.highlighted || control.down)
contentItem: IconLabelContent {
control: control
......
......@@ -4,7 +4,6 @@
import QtQuick 2.15
import QtQuick.Controls 2.15 as Controls
import QtQuick.Controls.impl 2.15
import QtQuick.Templates 2.15 as T
import org.kde.kirigami 2.14 as Kirigami
import "impl"
......@@ -43,17 +42,13 @@ T.SwipeDelegate {
icon.height: Kirigami.Units.iconSizes.auto
Kirigami.Theme.colorSet: {
if (control.down) {
if (control.down || control.highlighted) {
return Kirigami.Theme.Button
} else if (control.highlighted) {
return Kirigami.Theme.Selection
} else {
return Kirigami.Theme.View
return parent.Kirigami.Theme.colorSet ?? Kirigami.Theme.View
}
}
Kirigami.Theme.inherit: !control.highlighted && !control.down
swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } }
Kirigami.Theme.inherit: !background || !background.visible && !(control.highlighted || control.down)
contentItem: IconLabelContent {
control: control
......@@ -65,4 +60,12 @@ T.SwipeDelegate {
background: DelegateBackground {
control: control
}
clip: true
swipe.transition: Transition {
SmoothedAnimation {
velocity: 3
easing.type: Easing.InOutCubic
}
}
}
......@@ -44,15 +44,13 @@ T.SwitchDelegate {
icon.height: Kirigami.Units.iconSizes.auto
Kirigami.Theme.colorSet: {
if (control.down) {
if (control.down || control.highlighted) {
return Kirigami.Theme.Button
} else if (control.highlighted) {
return Kirigami.Theme.Selection
} else {
return Kirigami.Theme.View
return parent.Kirigami.Theme.colorSet ?? Kirigami.Theme.View
}
}
Kirigami.Theme.inherit: !control.highlighted && !control.down
Kirigami.Theme.inherit: !background || !background.visible && !(control.highlighted || control.down)
contentItem: IconLabelContent {
control: control
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment