Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

WIP: First state Splash without hack. Need fixing #268

Draft
wants to merge 1 commit into
base: xenial
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions qml/Stage/Splash.qml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ Item {
property alias title: header.title
property alias showHeader: header.visible

Ambiance.Palette {
id: ambiancePalette
}

QtObject {
id: d

// As specified in qtmir, it will set the color value to this for fields left undefined
// This is also the default value of a color property in QML.
readonly property color undefinedColor: "#00000000"

readonly property color defaultBackgroundColor: header.visible ? ambiancePalette.normal.background : "black"
readonly property color defaultBackgroundColor: header.visible ? theme.palette.normal.background : "black"

// Splash screen that shows the application icon and splashTitle
readonly property bool showIcon: overlaidImage.status == Image.Null && !root.showHeader
Expand All @@ -60,28 +56,16 @@ Item {
: root.headerColor
property color footerColor: Qt.colorEqual(root.footerColor, d.undefinedColor) ? styledItem.backgroundColor
: root.footerColor

// FIXME: fake a Theme object as to expose the Palette corresponding to the backgroundColor (see MainViewStyle.qml)
readonly property var fakeTheme: QtObject {
property string name
property Palette palette: Qt.createQmlObject("import QtQuick 2.4;\
import Ubuntu.Components.Themes.%1 1.3;\
Palette {}".arg(styledItem.fakeTheme.name),
styledItem, "dynamicPalette");
}

// FIXME: should instead use future toolkit API:
// style: theme.createStyleComponent("MainViewStyle.qml", styledItem)
style: Component { MainViewStyle {theme: styledItem.fakeTheme} }
style: Theme.createStyleComponent("MainViewStyle.qml", styledItem)
}

PageHeader {
id: header
anchors { left: parent.left; right: parent.right }
StyleHints {
foregroundColor: styledItem.fakeTheme.palette.normal.backgroundText
foregroundColor: styledItem.theme.palette.normal.backgroundText
backgroundColor: "transparent"
dividerColor: styledItem.fakeTheme.palette.normal.base
dividerColor: styledItem.theme.palette.normal.base
}
}

Expand Down Expand Up @@ -126,7 +110,7 @@ Item {
anchors.topMargin: units.gu(2)
fontSize: "large"

color: styledItem.fakeTheme.palette.normal.backgroundText
color: styledItem.theme.palette.normal.backgroundText
visible: d.showIcon
}

Expand All @@ -147,4 +131,8 @@ Item {
enabled: parent.visible
// absorb all mouse events
}

transitions: Transition {
UbuntuNumberAnimation {}
}
}