[welcomeq] add language bar

reads data from languagesModel correctly, debug added to see index changes
code cleanup
button layout improved
install info text added, better spacing of text
about button no longer commented out, 3 reasons:
- info provided by any about is standard, will be odd if it can't be found
- about.qml is a seperate file, can be completely adjusted
- not showing it takes away the options for new QML cala users to see what is possible with Loader, thus stopping new possible contributors
main
demmm 5 years ago
parent 3ef950eea3
commit 249150dd1b

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@ -16,6 +16,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>. * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/ */
import io.calamares.core 1.0
import io.calamares.ui 1.0 import io.calamares.ui 1.0
import QtQuick 2.10 import QtQuick 2.10
@ -29,21 +30,21 @@ Page
{ {
id: welcome id: welcome
header: Item header: Item {
{
width: parent.width width: parent.width
height: parent.height height: parent.height
Text Text {
{
id: welcomeTopText id: welcomeTopText
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
horizontalAlignment: Text.AlignHCenter
padding: 40
// In QML, QString::arg() only takes one argument // In QML, QString::arg() only takes one argument
text: qsTr("<h3>Welcome to the %1 <quote>%2</quote> installer</h3>").arg(Branding.string(Branding.ProductName)).arg(Branding.string(Branding.Version)) text: qsTr("<h3>Welcome to the %1 <quote>%2</quote> installer</h3>
<p>This program will ask you some questions and set up %1 on your computer.</p>").arg(Branding.string(Branding.ProductName)).arg(Branding.string(Branding.Version))
} }
Image Image {
{
id: welcomeImage id: welcomeImage
anchors.centerIn: parent anchors.centerIn: parent
// imagePath() returns a full pathname, so make it refer to the filesystem // imagePath() returns a full pathname, so make it refer to the filesystem
@ -55,36 +56,31 @@ Page
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
RowLayout RowLayout {
{
id: buttonBar id: buttonBar
width: parent.width width: parent.width / 1.5
height: 64 height: 64
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
spacing: Kirigami.Units.largeSpacing* 2 spacing: Kirigami.Units.largeSpacing* 2
/* Traditionally Calamares has had an "About" button that talks about Button {
* Calamares itself, which just isn't a very useful thing in someone
* else's installation ISO.
*/
Button
{
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("About") text: qsTr("About")
icon.name: "dialog-information" icon.name: "dialog-information"
Kirigami.Theme.backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.4) Kirigami.Theme.backgroundColor: Qt.rgba(Kirigami.Theme.backgroundColor.r, Kirigami.Theme.backgroundColor.g, Kirigami.Theme.backgroundColor.b, 0.4)
Kirigami.Theme.textColor: Kirigami.Theme.textColor Kirigami.Theme.textColor: Kirigami.Theme.textColor
visible: false visible: true
onClicked: { onClicked: {
//onClicked: load.source = "file:/usr/share/calamares/branding/kaos_branding/show.qml" //onClicked: load.source = "file:/usr/share/calamares/branding/default/show.qml"
onClicked: load.source = "about.qml" onClicked: load.source = "about.qml"
} }
} }
Button
{ Button {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Support") text: qsTr("Support")
icon.name: "system-help" icon.name: "system-help"
@ -94,8 +90,8 @@ Page
visible: config.supportUrl !== "" visible: config.supportUrl !== ""
onClicked: Qt.openUrlExternally(config.supportUrl) onClicked: Qt.openUrlExternally(config.supportUrl)
} }
Button
{ Button {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Known issues") text: qsTr("Known issues")
icon.name: "tools-report-bug" icon.name: "tools-report-bug"
@ -105,8 +101,8 @@ Page
visible: config.knownIssuesUrl !== "" visible: config.knownIssuesUrl !== ""
onClicked: Qt.openUrlExternally(config.knownIssuesUrl) onClicked: Qt.openUrlExternally(config.knownIssuesUrl)
} }
Button
{ Button {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Release notes") text: qsTr("Release notes")
icon.name: "folder-text" icon.name: "folder-text"
@ -116,8 +112,8 @@ Page
visible: config.releaseNotesUrl !== "" visible: config.releaseNotesUrl !== ""
onClicked: Qt.openUrlExternally(config.releaseNotesUrl) onClicked: Qt.openUrlExternally(config.releaseNotesUrl)
} }
Button
{ Button {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Donate") text: qsTr("Donate")
icon.name: "taxes-finances" icon.name: "taxes-finances"
@ -128,8 +124,41 @@ Page
onClicked: Qt.openUrlExternally(config.donateUrl) onClicked: Qt.openUrlExternally(config.donateUrl)
} }
} }
Loader
{ RowLayout {
id: languageBar
width: parent.width /1.2
height: 48
anchors.bottom: parent.bottom
anchors.bottomMargin: parent.height /7
anchors.horizontalCenter: parent.horizontalCenter
spacing: Kirigami.Units.largeSpacing* 4
Rectangle {
width: parent.width
Layout.fillWidth: true
focus: true
Image {
id: image
height: 48
fillMode: Image.PreserveAspectFit
source: "img/language-icon-48px.png"
}
ComboBox {
id: languages
anchors.left: image.right
width: languageBar.width /1.1
textRole: "label"
currentIndex: 4 //model.currentIndex
model: config.languagesModel
onCurrentIndexChanged: console.debug(currentText, currentIndex)
}
}
}
Loader {
id:load id:load
anchors.fill: parent anchors.fill: parent
} }

@ -4,5 +4,6 @@
<file alias="about.qml">about.qml</file> <file alias="about.qml">about.qml</file>
<file>img/squid.png</file> <file>img/squid.png</file>
<file>img/chevron-left-solid.svg</file> <file>img/chevron-left-solid.svg</file>
<file>img/language-icon-48px.png</file>
</qresource> </qresource>
</RCC> </RCC>

Loading…
Cancel
Save