autoformat

This commit is contained in:
ItsLemmy
2025-11-30 11:46:33 -05:00
parent 925bbe7a5e
commit f04622ade7
2 changed files with 46 additions and 21 deletions

View File

@@ -42,27 +42,38 @@ NIconButton {
return widgetMetadata.colorizeSystemIcon !== undefined ? widgetMetadata.colorizeSystemIcon : "none";
}
readonly property bool isColorizing: enableColorization && colorizeSystemIcon !== "none"
readonly property color iconColor: {
if (!isColorizing) return Color.mOnSurface;
if (!isColorizing)
return Color.mOnSurface;
switch (colorizeSystemIcon) {
case "primary": return Color.mPrimary;
case "secondary": return Color.mSecondary;
case "tertiary": return Color.mTertiary;
case "error": return Color.mError;
default: return Color.mOnSurface;
case "primary":
return Color.mPrimary;
case "secondary":
return Color.mSecondary;
case "tertiary":
return Color.mTertiary;
case "error":
return Color.mError;
default:
return Color.mOnSurface;
}
}
readonly property color iconHoverColor: {
if (!isColorizing) return Color.mOnHover;
if (!isColorizing)
return Color.mOnHover;
switch (colorizeSystemIcon) {
case "primary": return Qt.darker(Color.mPrimary, 1.2);
case "secondary": return Qt.darker(Color.mSecondary, 1.2);
case "tertiary": return Qt.darker(Color.mTertiary, 1.2);
case "error": return Qt.darker(Color.mError, 1.2);
default: return Color.mOnHover;
case "primary":
return Qt.darker(Color.mPrimary, 1.2);
case "secondary":
return Qt.darker(Color.mSecondary, 1.2);
case "tertiary":
return Qt.darker(Color.mTertiary, 1.2);
case "error":
return Qt.darker(Color.mError, 1.2);
default:
return Color.mOnHover;
}
}
@@ -154,8 +165,7 @@ NIconButton {
asynchronous: true
layer.enabled: isColorizing && (useDistroLogo || customIconPath !== "")
layer.effect: ShaderEffect {
property color targetColor: isColorizing ? iconColor :
(Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mSurfaceVariant)
property color targetColor: isColorizing ? iconColor : (Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mSurfaceVariant)
property real colorizeMode: 2.0
fragmentShader: Qt.resolvedUrl(Quickshell.shellDir + "/Shaders/qsb/appicon_colorize.frag.qsb")

View File

@@ -53,14 +53,29 @@ ColumnLayout {
label: I18n.tr("bar.widget-settings.control-center.color-selection.label")
description: I18n.tr("bar.widget-settings.control-center.color-selection.description")
model: [
{ "name": I18n.tr("options.colors.none"), "key": "none" },
{ "name": I18n.tr("options.colors.primary"), "key": "primary" },
{ "name": I18n.tr("options.colors.secondary"), "key": "secondary" },
{ "name": I18n.tr("options.colors.tertiary"), "key": "tertiary" },
{ "name": I18n.tr("options.colors.error"), "key": "error" }
{
"name": I18n.tr("options.colors.none"),
"key": "none"
},
{
"name": I18n.tr("options.colors.primary"),
"key": "primary"
},
{
"name": I18n.tr("options.colors.secondary"),
"key": "secondary"
},
{
"name": I18n.tr("options.colors.tertiary"),
"key": "tertiary"
},
{
"name": I18n.tr("options.colors.error"),
"key": "error"
}
]
currentKey: valueColorizeSystemIcon
onSelected: function(key) {
onSelected: function (key) {
valueColorizeSystemIcon = key;
}
}