mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
ControlCenter: add colorize distro toggle
This commit is contained in:
@@ -32,6 +32,11 @@ NIconButton {
|
||||
readonly property string customIcon: widgetSettings.icon || widgetMetadata.icon
|
||||
readonly property bool useDistroLogo: (widgetSettings.useDistroLogo !== undefined) ? widgetSettings.useDistroLogo : widgetMetadata.useDistroLogo
|
||||
readonly property string customIconPath: widgetSettings.customIconPath || ""
|
||||
readonly property bool colorizeDistroLogo: {
|
||||
if (widgetSettings.colorizeDistroLogo !== undefined)
|
||||
return widgetSettings.colorizeDistroLogo
|
||||
return widgetMetadata.colorizeDistroLogo !== undefined ? widgetMetadata.colorizeDistroLogo : false
|
||||
}
|
||||
|
||||
// If we have a custom path or distro logo, don't use the theme icon.
|
||||
icon: (customIconPath === "" && !useDistroLogo) ? customIcon : ""
|
||||
@@ -72,5 +77,12 @@ NIconButton {
|
||||
visible: source !== ""
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
layer.enabled: useDistroLogo && colorizeDistroLogo
|
||||
layer.effect: ShaderEffect {
|
||||
property color targetColor: Settings.data.colorSchemes.darkMode ? Color.mOnSurface : Color.mSurfaceVariant
|
||||
property real colorizeMode: 1.0
|
||||
|
||||
fragmentShader: Qt.resolvedUrl(Quickshell.shellDir + "/Shaders/qsb/appicon_colorize.frag.qsb")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,14 @@ ColumnLayout {
|
||||
property string valueIcon: widgetData.icon !== undefined ? widgetData.icon : widgetMetadata.icon
|
||||
property bool valueUseDistroLogo: widgetData.useDistroLogo !== undefined ? widgetData.useDistroLogo : widgetMetadata.useDistroLogo
|
||||
property string valueCustomIconPath: widgetData.customIconPath !== undefined ? widgetData.customIconPath : ""
|
||||
property bool valueColorizeDistroLogo: widgetData.colorizeDistroLogo !== undefined ? widgetData.colorizeDistroLogo : (widgetMetadata.colorizeDistroLogo !== undefined ? widgetMetadata.colorizeDistroLogo : false)
|
||||
|
||||
function saveSettings() {
|
||||
var settings = Object.assign({}, widgetData || {})
|
||||
settings.icon = valueIcon
|
||||
settings.useDistroLogo = valueUseDistroLogo
|
||||
settings.customIconPath = valueCustomIconPath
|
||||
settings.colorizeDistroLogo = valueColorizeDistroLogo
|
||||
return settings
|
||||
}
|
||||
|
||||
@@ -39,6 +41,16 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
NToggle {
|
||||
visible: valueUseDistroLogo
|
||||
label: I18n.tr("bar.widget-settings.control-center.colorize-distro-logo.label")
|
||||
description: I18n.tr("bar.widget-settings.control-center.colorize-distro-logo.description")
|
||||
checked: valueColorizeDistroLogo
|
||||
onToggled: function (checked) {
|
||||
valueColorizeDistroLogo = checked
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Style.marginM
|
||||
|
||||
|
||||
@@ -761,10 +761,10 @@ ColumnLayout {
|
||||
NCheckbox {
|
||||
label: "Spicetify"
|
||||
description: ProgramCheckerService.spicetifyAvailable ? I18n.tr("settings.color-scheme.templates.programs.spicetify.description", {
|
||||
"filepath": "~/.config/spicetify/Themes/Comfy/color.ini"
|
||||
}) : I18n.tr("settings.color-scheme.templates.programs.spicetify.description-missing", {
|
||||
"app": "spicetify"
|
||||
})
|
||||
"filepath": "~/.config/spicetify/Themes/Comfy/color.ini"
|
||||
}) : I18n.tr("settings.color-scheme.templates.programs.spicetify.description-missing", {
|
||||
"app": "spicetify"
|
||||
})
|
||||
checked: Settings.data.templates.spicetify
|
||||
enabled: ProgramCheckerService.spicetifyAvailable
|
||||
opacity: ProgramCheckerService.spicetifyAvailable ? 1.0 : 0.6
|
||||
|
||||
Reference in New Issue
Block a user