on xenial help sign in
Bring splash header closer to what apps use
commitb37b4b6350f8d38a0f4219c0b7d18ab66d5244cf authorAlbert Astals Cid <albert.astals@canonical.com> dateThu 29 Oct 2015, 12:40 (11 years ago) parent84e35d0
2 files changed+12−92
qml/Stages/PageHeadStyle.qml−76 qml/Stages/Splash.qml+12−16
qml/Stages/PageHeadStyle.qmldeleted−76
@@ -1,76 +0,0 @@
1−/*
2− * Copyright 2014 Canonical Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU Lesser General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU Lesser General Public License for more details.
12− *
13− * You should have received a copy of the GNU Lesser General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−import QtQuick 2.2
17−import Ubuntu.Components 1.3
18−import Ubuntu.Components.Styles 1.3 as Style
19−
20−// FIXME: copied with large modifications from Ubuntu UI Toolkit's Ambiance's theme
21−Style.PageHeadStyle {
22− id: headerStyle
23−
24− contentHeight: units.gu(7)
25− separatorSource: "graphics/PageHeaderBaseDividerLight.sci"
26− separatorBottomSource: "graphics/PageHeaderBaseDividerBottom.png"
27− fontWeight: Font.Light
28− fontSize: "x-large"
29− textColor: styledItem.config.foregroundColor
30− textLeftMargin: units.gu(2)
31−
32− implicitHeight: headerStyle.contentHeight
33−
34− property var theme
35−
36− Label {
37− anchors {
38− left: parent.left
39− leftMargin: headerStyle.textLeftMargin
40− right: parent.right
41− verticalCenter: parent.verticalCenter
42− }
43− LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
44− text: styledItem.title
45− font.weight: headerStyle.fontWeight
46− fontSize: headerStyle.fontSize
47− color: headerStyle.textColor
48− elide: Text.ElideRight
49− }
50−
51− BorderImage {
52− id: separator
53− anchors {
54− top: parent.bottom
55− topMargin: separatorBottom.height
56− left: parent.left
57− right: parent.right
58− }
59− source: headerStyle.separatorSource
60− height: styledItem.config.sections.model !== undefined ? units.gu(3) : units.gu(2)
61− asynchronous: true
62− cache: true
63− }
64−
65− Image {
66− id: separatorBottom
67− anchors {
68− top: separator.bottom
69− left: parent.left
70− right: parent.right
71− }
72− source: headerStyle.separatorBottomSource
73− asynchronous: true
74− cache: true
75− }
76−}
qml/Stages/Splash.qml+12−16
@@ -29,7 +29,7 @@ Item {
2929 property color footerColor: d.undefinedColor
3030 property alias imageSource: overlaidImage.source
3131 property url icon
32− property alias title: header.title
32+ property alias title: headerConfig.title
3333 property alias showHeader: header.visible
3434
3535 Ambiance.Palette {
@@ -75,27 +75,23 @@ Item {
7575 style: Component { MainViewStyle {theme: styledItem.fakeTheme} }
7676 }
7777
78− StyledItem {
78+ Ambiance.PageHeadStyle {
7979 id: header
8080 anchors {
81− left: parent.left
81+ left: parent.left;
8282 right: parent.right
8383 }
84− visible: false
85−
86− // mimic API of toolkit's AppHeader component required by PageHeadStyle
87− property Item pageStack
88− property Item contents
89− property string title
90− property var tabsModel
91− property var config: QtObject {
92− property color foregroundColor: styledItem.fakeTheme.palette.selected.backgroundText
93− property var sections: QtObject {}
84+ property var styledItem: header
85+ // FIXME Keep in sync with SDK's MainView.qml values of these two colors
86+ property color dividerColor: Qt.darker(styledItem.backgroundColor, 1.1)
87+ property color panelColor: Qt.lighter(styledItem.backgroundColor, 1.1)
88+ panelForegroundColor: config.foregroundColor
89+ config: PageHeadConfiguration {
90+ id: headerConfig
91+ foregroundColor: styledItem.fakeTheme.palette.selected.backgroundText
9492 }
9593
96− // FIXME: should instead use future toolkit API:
97− // style: theme.createStyleComponent("PageHeadStyle.qml", header)
98− style: Component { PageHeadStyle {theme: styledItem.fakeTheme} }
94+ property var contents: null
9995 }
10096
10197 Image {