From 14964e0203c6bca5ed99f0fa09e9233e34ac11f5 Mon Sep 17 00:00:00 2001 From: Toast Date: Thu, 5 Jun 2025 01:55:56 +0200 Subject: [PATCH] Qml/ModPage: tint header with icon's primary color --- src/leek/qml/ModPage.qml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/leek/qml/ModPage.qml b/src/leek/qml/ModPage.qml index c54ab18..6b9bfde 100644 --- a/src/leek/qml/ModPage.qml +++ b/src/leek/qml/ModPage.qml @@ -25,9 +25,19 @@ Kirigami.Page { Layout.leftMargin: -root.leftPadding Layout.rightMargin: -root.rightPadding + Kirigami.ImageColors { + id: iconColors + source: modIcon.source + } + implicitHeight: headerContents.implicitHeight + (headerContents.anchors.topMargin * 2) - color: "#804eb1" + // Tint the header with the dominant color of the mod's icon + color: Kirigami.ColorUtils.tintWithAlpha( + Kirigami.Theme.backgroundColor, + iconColors.dominant, + 0.1 + ) GridLayout { id: headerContents @@ -44,6 +54,7 @@ Kirigami.Page { RowLayout { // Icon Kirigami.Icon { + id: modIcon implicitHeight: Kirigami.Units.iconSizes.huge implicitWidth: implicitHeight source: "package-x-generic"