Tweak delegate padding and color choice

This commit is contained in:
Devin Lin 2020-08-29 12:19:41 -04:00
parent 0308d1fd62
commit 8eecc27cbc

View file

@ -32,21 +32,31 @@ ColumnLayout {
signal panelClosed signal panelClosed
Rectangle { Rectangle {
Layout.preferredWidth: units.iconSizes.large + units.smallSpacing * 2 Layout.preferredWidth: units.iconSizes.large + units.smallSpacing
Layout.minimumHeight: width Layout.minimumHeight: width
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
radius: units.smallSpacing radius: units.smallSpacing
border.color: Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, 0.2) border.color: toggled ?
color: toggled ? Qt.darker(Qt.rgba(PlasmaCore.ColorScope.highlightColor.r, PlasmaCore.ColorScope.highlightColor.g, PlasmaCore.ColorScope.highlightColor.b, 1), 1.25) :
Qt.rgba(PlasmaCore.ColorScope.highlightColor.r, PlasmaCore.ColorScope.highlightColor.g, PlasmaCore.ColorScope.highlightColor.b, iconMouseArea.pressed ? 0.5 : 0.3) : Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, 0.2)
Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, iconMouseArea.pressed ? 0.5 : 0.1) color: {
if (toggled) {
return Qt.rgba(PlasmaCore.ColorScope.highlightColor.r, PlasmaCore.ColorScope.highlightColor.g, PlasmaCore.ColorScope.highlightColor.b, iconMouseArea.pressed ? 0.5 : 0.3);
} else {
if (iconMouseArea.pressed) {
return Qt.darker(Qt.rgba(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b, 0.9), 1.25);
} else {
return Qt.rgba(PlasmaCore.ColorScope.backgroundColor.r, PlasmaCore.ColorScope.backgroundColor.g, PlasmaCore.ColorScope.backgroundColor.b, 0.3);
}
}
}
PlasmaCore.IconItem { PlasmaCore.IconItem {
id: icon id: icon
colorGroup: PlasmaCore.ColorScope.colorGroup colorGroup: PlasmaCore.ColorScope.colorGroup
anchors { anchors {
fill: parent fill: parent
margins: units.smallSpacing * 2 margins: units.smallSpacing
} }
source: model.icon source: model.icon
MouseArea { MouseArea {