mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
feat(dock): implement distribution logo rendering for launcher icon
This commit is contained in:
@@ -247,6 +247,15 @@ Item {
|
||||
return launcherMetadata.iconColor;
|
||||
return "none";
|
||||
}
|
||||
readonly property bool launcherUseDistroLogo: {
|
||||
if (Settings.data.dock.launcherUseDistroLogo !== undefined)
|
||||
return Settings.data.dock.launcherUseDistroLogo;
|
||||
if (launcherWidgetSettings.useDistroLogo !== undefined)
|
||||
return launcherWidgetSettings.useDistroLogo;
|
||||
if (launcherMetadata && launcherMetadata.useDistroLogo !== undefined)
|
||||
return launcherMetadata.useDistroLogo;
|
||||
return false;
|
||||
}
|
||||
|
||||
Item {
|
||||
id: launcherIconContainer
|
||||
@@ -268,6 +277,24 @@ Item {
|
||||
icon: launcherButton.launcherIcon
|
||||
pointSize: dockRoot.iconSize * 0.7
|
||||
color: Color.resolveColorKey(launcherButton.launcherIconColorKey)
|
||||
visible: !launcherButton.launcherUseDistroLogo
|
||||
}
|
||||
|
||||
IconImage {
|
||||
anchors.centerIn: parent
|
||||
width: dockRoot.iconSize * 0.8
|
||||
height: width
|
||||
source: launcherButton.launcherUseDistroLogo ? HostService.osLogo : ""
|
||||
visible: source !== ""
|
||||
smooth: true
|
||||
asynchronous: true
|
||||
layer.enabled: visible
|
||||
layer.effect: ShaderEffect {
|
||||
property color targetColor: Color.resolveColorKey(launcherButton.launcherIconColorKey)
|
||||
property real colorizeMode: 2.0
|
||||
|
||||
fragmentShader: Qt.resolvedUrl(Quickshell.shellDir + "/Shaders/qsb/appicon_colorize.frag.qsb")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user