[welcomeq] Add top-text
- Fix QML indentation to the canonical 4-spaces - Add a header at the top of the page - Force the image to load from the filesystem
This commit is contained in:
parent
18942f835f
commit
ae35256177
@ -1,3 +1,20 @@
|
|||||||
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
|
*
|
||||||
|
* Copyright 2020, Adriaan de Groot <groot@kde.org>
|
||||||
|
*
|
||||||
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Calamares is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
import calamares.ui 1.0
|
import calamares.ui 1.0
|
||||||
|
|
||||||
import QtQuick 2.10
|
import QtQuick 2.10
|
||||||
@ -9,21 +26,33 @@ import QtQuick.Window 2.3
|
|||||||
|
|
||||||
Page
|
Page
|
||||||
{
|
{
|
||||||
id: welcome
|
id: welcome
|
||||||
|
|
||||||
header: Item
|
header: Item
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 150
|
height: 150
|
||||||
|
|
||||||
Image
|
Text
|
||||||
{
|
{
|
||||||
anchors.centerIn: parent
|
id: welcomeTopText
|
||||||
source: Branding.imagePath(Branding.ProductWelcome)
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
height: Math.min(100, parent.height)
|
anchors.top: parent.top
|
||||||
width: height
|
// In QML, QString::arg() only takes one argument
|
||||||
sourceSize.width: width
|
text: qsTr("<h3>%1 <quote>%2</quote></h3>").arg(Branding.string(Branding.ProductName)).arg(Branding.string(Branding.Version))
|
||||||
sourceSize.height: height
|
}
|
||||||
}
|
Image
|
||||||
}
|
{
|
||||||
|
id: welcomeImage
|
||||||
|
anchors.centerIn: parent
|
||||||
|
// imagePath() returns a full pathname, so make it refer to the filesystem
|
||||||
|
// .. otherwise the path is interpreted relative to the "call site", which
|
||||||
|
// .. might be the QRC file.
|
||||||
|
source: "file:/" + Branding.imagePath(Branding.ProductWelcome)
|
||||||
|
height: Math.min(100, parent.height)
|
||||||
|
width: height
|
||||||
|
sourceSize.width: width
|
||||||
|
sourceSize.height: height
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user