Verified Commit 6e82a855 authored by Jonah Brüchert's avatar Jonah Brüchert
Browse files

StartupFeedback: calculate background color from icon

parent 648f784d
...@@ -21,31 +21,36 @@ import QtQuick 2.12 ...@@ -21,31 +21,36 @@ import QtQuick 2.12
import QtQuick.Layouts 1.1 import QtQuick.Layouts 1.1
import QtQuick.Window 2.2 import QtQuick.Window 2.2
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import QtGraphicalEffects 1.12 import QtGraphicalEffects 1.12
import org.kde.kirigami 2.13 as Kirigami
pragma Singleton pragma Singleton
Window { Window {
id: window id: window
function open(splashIcon, title, color, x, y, sourceIconSize) { Kirigami.ImageColors {
id: colorGenerator
source: icon.source
}
function open(splashIcon, title, x, y, sourceIconSize) {
iconParent.scale = sourceIconSize/iconParent.width; iconParent.scale = sourceIconSize/iconParent.width;
background.scale = 0; background.scale = 0;
background.x = -window.width/2 + x background.x = -window.width/2 + x
background.y = -window.height/2 + y background.y = -window.height/2 + y
window.title = title; window.title = title;
icon.source = splashIcon; icon.source = splashIcon;
background.color = color;
background.state = "open"; background.state = "open";
} }
property alias state: background.state property alias state: background.state
property alias icon: icon.source property alias icon: icon.source
width: Screen.width width: Screen.width
height: Screen.height height: Screen.height
color: "transparent"
onVisibleChanged: { onVisibleChanged: {
if (!visible) { if (!visible) {
background.state = "closed"; background.state = "closed";
...@@ -89,6 +94,8 @@ Window { ...@@ -89,6 +94,8 @@ Window {
width: window.width width: window.width
height: window.height height: window.height
color: colorGenerator.dominant
state: "closed" state: "closed"
states: [ states: [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment