Qml/ModPage: tint header with icon's primary color
This commit is contained in:
parent
1ab178ac42
commit
14964e0203
1 changed files with 12 additions and 1 deletions
|
|
@ -25,9 +25,19 @@ Kirigami.Page {
|
||||||
Layout.leftMargin: -root.leftPadding
|
Layout.leftMargin: -root.leftPadding
|
||||||
Layout.rightMargin: -root.rightPadding
|
Layout.rightMargin: -root.rightPadding
|
||||||
|
|
||||||
|
Kirigami.ImageColors {
|
||||||
|
id: iconColors
|
||||||
|
source: modIcon.source
|
||||||
|
}
|
||||||
|
|
||||||
implicitHeight: headerContents.implicitHeight + (headerContents.anchors.topMargin * 2)
|
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 {
|
GridLayout {
|
||||||
id: headerContents
|
id: headerContents
|
||||||
|
|
@ -44,6 +54,7 @@ Kirigami.Page {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
// Icon
|
// Icon
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
|
id: modIcon
|
||||||
implicitHeight: Kirigami.Units.iconSizes.huge
|
implicitHeight: Kirigami.Units.iconSizes.huge
|
||||||
implicitWidth: implicitHeight
|
implicitWidth: implicitHeight
|
||||||
source: "package-x-generic"
|
source: "package-x-generic"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue