Skip to content

Commit

Permalink
feat: bring back force icon color with support for non-symbolic icons
Browse files Browse the repository at this point in the history
closes: #55
refs: #69
  • Loading branch information
luisbocanegra committed Sep 17, 2024
1 parent 2ba52bd commit 10af807
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 653 deletions.
6 changes: 0 additions & 6 deletions package/contents/config/config.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ ConfigModel {
source: "configNewTray.qml"
}

ConfigCategory {
name: i18n("Test")
icon: "preferences"
source: "colorCompTest.qml"
}

ConfigCategory {
name: i18n("General")
icon: "preferences"
Expand Down
2 changes: 1 addition & 1 deletion package/contents/config/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
<entry
name="allSettings"
type="String">
<default>{"panel":{"blurBehind":true,"backgroundColor":{"lightnessValue":0.1,"saturationValue":0.05,"alpha":1,"systemColor":"backgroundColor","systemColorSet":"View","type":0,"custom":"#013eff","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"foregroundColor":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":1,"systemColor":"backgroundColor","systemColorSet":"View","type":0,"custom":"#fc0000","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":0,"enabled":false},"radius":{"topLeft":8,"topRight":8,"bottomRight":8,"bottomLeft":8},"margins":{"right":4,"left":4,"top":4,"bottom":4},"border":{"customSides":false,"custom":{"widths":{"left":0,"bottom":2,"right":3,"top":2},"margins":[],"radius":0},"width":1,"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":0.2,"systemColor":"highlightColor","systemColorSet":"View","type":0,"custom":"#ff6c06","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true}},"shadow":{"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":0.15,"systemColor":"backgroundColor","systemColorSet":"View","type":0,"custom":"#282828","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"size":8,"xOffset":0,"yOffset":0},"enabled":true},"widgets":{"blurBehind":false,"backgroundColor":{"lightnessValue":0.2,"saturationValue":0.6,"alpha":1,"type":0,"custom":"#00004b","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"systemColorSet":"View","systemColor":"backgroundColor","enabled":true},"foregroundColor":{"lightnessValue":0.85,"saturationValue":0.75,"alpha":1,"systemColor":"highlightColor","systemColorSet":"Header","type":0,"custom":"#ff9a00","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":true,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"radius":{"topLeft":8,"topRight":8,"bottomRight":8,"bottomLeft":8},"margins":{"right":0,"left":0,"top":4,"bottom":4},"border":{"customSides":false,"custom":{"widths":{"left":0,"bottom":3,"right":0,"top":0},"margins":[],"radius":0},"width":0,"color":{"lightnessValue":0.35,"saturationValue":0.05,"alpha":1,"systemColorSet":"View","type":0,"custom":"#eeff71","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"systemColor":"backgroundColor","enabled":true}},"shadow":{"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":1,"systemColorSet":"View","type":0,"custom":"#282828","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"systemColor":"backgroundColor","enabled":true},"size":5,"xOffset":0,"yOffset":0},"enabled":true},"trayWidgets":{"blurBehind":false,"backgroundColor":{"lightnessValue":0.1,"saturationValue":0.75,"alpha":1,"systemColor":"highlightColor","systemColorSet":"Window","type":0,"custom":"#0023f8","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":true,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"foregroundColor":{"lightnessValue":0.2,"saturationValue":0.7,"alpha":1,"systemColor":"highlightColor","systemColorSet":"View","type":0,"custom":"#feff76","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":true,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"radius":{"topLeft":5,"topRight":5,"bottomRight":5,"bottomLeft":5},"margins":{"right":2,"left":2,"top":4,"bottom":4},"border":{"customSides":true,"custom":{"widths":{"left":0,"bottom":2,"right":0,"top":0},"margins":[],"radius":0},"width":0,"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":0.4,"systemColor":"backgroundColor","systemColorSet":"Window","type":0,"custom":"#04ff0c","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true}},"shadow":{"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":1,"systemColor":"textColor","systemColorSet":"View","type":0,"custom":"#282828","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":0,"enabled":true},"size":5,"xOffset":0,"yOffset":0},"enabled":true},"nativePanelBackground":{"enabled":true,"opacity":1}}</default>
<default>{"panel":{"blurBehind":true,"backgroundColor":{"lightnessValue":0.1,"saturationValue":0.05,"alpha":1,"systemColor":"backgroundColor","systemColorSet":"View","type":0,"custom":"#013eff","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"foregroundColor":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":1,"systemColor":"backgroundColor","systemColorSet":"View","type":0,"custom":"#fc0000","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":0,"enabled":false},"radius":{"topLeft":8,"topRight":8,"bottomRight":8,"bottomLeft":8},"margins":{"right":4,"left":4,"top":4,"bottom":4},"border":{"customSides":false,"custom":{"widths":{"left":0,"bottom":2,"right":3,"top":2},"margins":[],"radius":0},"width":1,"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":0.2,"systemColor":"highlightColor","systemColorSet":"View","type":0,"custom":"#ff6c06","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true}},"shadow":{"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":0.15,"systemColor":"backgroundColor","systemColorSet":"View","type":0,"custom":"#282828","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"size":8,"xOffset":0,"yOffset":0},"enabled":true},"widgets":{"blurBehind":false,"backgroundColor":{"lightnessValue":0.2,"saturationValue":0.6,"alpha":1,"type":0,"custom":"#00004b","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"systemColorSet":"View","systemColor":"backgroundColor","enabled":true},"foregroundColor":{"lightnessValue":0.85,"saturationValue":0.75,"alpha":1,"systemColor":"highlightColor","systemColorSet":"Header","type":0,"custom":"#ff9a00","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":true,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"radius":{"topLeft":8,"topRight":8,"bottomRight":8,"bottomLeft":8},"margins":{"right":0,"left":0,"top":4,"bottom":4},"border":{"customSides":false,"custom":{"widths":{"left":0,"bottom":3,"right":0,"top":0},"margins":[],"radius":0},"width":0,"color":{"lightnessValue":0.35,"saturationValue":0.05,"alpha":1,"systemColorSet":"View","type":0,"custom":"#eeff71","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"systemColor":"backgroundColor","enabled":true}},"shadow":{"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":1,"systemColorSet":"View","type":0,"custom":"#282828","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"systemColor":"backgroundColor","enabled":true},"size":5,"xOffset":0,"yOffset":0},"enabled":true},"trayWidgets":{"blurBehind":false,"backgroundColor":{"lightnessValue":0.1,"saturationValue":0.75,"alpha":1,"systemColor":"highlightColor","systemColorSet":"Window","type":0,"custom":"#0023f8","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":true,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"foregroundColor":{"lightnessValue":0.2,"saturationValue":0.7,"alpha":1,"systemColor":"highlightColor","systemColorSet":"View","type":0,"custom":"#feff76","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":true,"lightnessEnabled":true,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true},"radius":{"topLeft":5,"topRight":5,"bottomRight":5,"bottomLeft":5},"margins":{"right":2,"left":2,"top":4,"bottom":4},"border":{"customSides":true,"custom":{"widths":{"left":0,"bottom":2,"right":0,"top":0},"margins":[],"radius":0},"width":0,"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":0.4,"systemColor":"backgroundColor","systemColorSet":"Window","type":0,"custom":"#04ff0c","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":1,"enabled":true}},"shadow":{"color":{"lightnessValue":0.05,"saturationValue":0.05,"alpha":1,"systemColor":"textColor","systemColorSet":"View","type":0,"custom":"#282828","list":["#ED8796","#A6DA95","#EED49F","#8AADF4","#F5BDE6","#8BD5CA","#f5a97f"],"followColor":0,"saturationEnabled":false,"lightnessEnabled":false,"animation":{"enabled":false,"interval":3000,"smoothing":800},"sourceType":0,"enabled":true},"size":5,"xOffset":0,"yOffset":0},"enabled":true},"nativePanelBackground":{"enabled":true,"opacity":1}, "forceForegroundColor":{}}</default>
</entry>
</group>
</kcfg>
13 changes: 13 additions & 0 deletions package/contents/ui/code/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@ function isBgManaged(item) {
return managed
}

function isEffectManaged(item) {
let managed = false
if (item?.children) {
for (let i in item.children) {
const child = item.children[i];
if (!child?.luisbocanegraPanelColorizerEffectManaged) continue
managed = true
}
}
// console.error(item, "managed:", managed);
return managed
}

function findTrayGridView(item) {
if (!item?.children) return null
if (item instanceof GridView) {
Expand Down
1 change: 0 additions & 1 deletion package/contents/ui/components/FormWidgetSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ ColumnLayout {
onCheckedChanged: {
configLocal.blurBehind = checked
if (checked) {
nativePanelBackgroundCheckbox.checked = true
}
updateConfig()
}
Expand Down
51 changes: 51 additions & 0 deletions package/contents/ui/components/WidgetCardCheck.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.kde.kirigami as Kirigami

Kirigami.AbstractCard {
id: root
property var widget
signal updateWidget(mask: bool, effect: bool)
checked: maskCheckbox.checked || effectCheckbox.checked

contentItem: RowLayout {
Kirigami.Icon {
width: Kirigami.Units.gridUnit
height: width
source: widget.icon
}
ColumnLayout {
Label {
text: widget.title
}
Label {
text: widget.name
opacity: 0.6
}
}
Item {
Layout.fillWidth: true
}
Button {
id: maskCheckbox
text: i18n("Mask")
checkable: true
checked: widget.method.mask ?? false
icon.name: checked ? "checkmark-symbolic" : "dialog-close-symbolic"
onCheckedChanged: {
updateWidget(maskCheckbox.checked, effectCheckbox.checked)
}
}
Button {
id: effectCheckbox
text: i18n("Effect")
checkable: true
checked: widget.method.multiEffect ?? false
icon.name: checked ? "checkmark-symbolic" : "dialog-close-symbolic"
onCheckedChanged: {
updateWidget(maskCheckbox.checked, effectCheckbox.checked)
}
}
}
}
Loading

0 comments on commit 10af807

Please sign in to comment.