mirror of
https://github.com/parchlinux/calamares.git
synced 2025-02-24 19:05:46 -05:00
Branding: update example, use NavButtons
This commit is contained in:
parent
7ab79a944b
commit
3b8673fb99
1 changed files with 31 additions and 38 deletions
|
@ -17,21 +17,35 @@
|
||||||
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import QtQuick 2.0;
|
import QtQuick 2.5;
|
||||||
import calamares.slideshow 1.0;
|
import calamares.slideshow 1.0;
|
||||||
|
|
||||||
Presentation
|
Presentation
|
||||||
{
|
{
|
||||||
id: presentation
|
id: presentation
|
||||||
|
|
||||||
Timer {
|
mouseNavigation: false /* Only the fwd/back buttons */
|
||||||
interval: 5000
|
loopSlides: false
|
||||||
running: false
|
|
||||||
repeat: true
|
BackButton {
|
||||||
onTriggered: presentation.goToNextSlide()
|
width: 60
|
||||||
|
height: 60
|
||||||
|
source: "go-previous.svgz"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ForwardButton {
|
||||||
|
width: 60
|
||||||
|
height: 60
|
||||||
|
source: "go-next.svgz"
|
||||||
|
}
|
||||||
|
|
||||||
|
SlideCounter {}
|
||||||
|
|
||||||
Slide {
|
Slide {
|
||||||
|
/* This first slide ignores the "normal" slide layout and places
|
||||||
|
* an image and text by itself. The anchors need to be connected
|
||||||
|
* to place the items properly.
|
||||||
|
*/
|
||||||
Image {
|
Image {
|
||||||
id: background1 // Must be unique
|
id: background1 // Must be unique
|
||||||
source: "squid.png"
|
source: "squid.png"
|
||||||
|
@ -50,53 +64,32 @@ Presentation
|
||||||
}
|
}
|
||||||
|
|
||||||
Slide {
|
Slide {
|
||||||
Image {
|
/* Make this one narrower to prevent overlap of wide text with nav buttons */
|
||||||
id: background2
|
width: parent.width * 0.9 - 120
|
||||||
source: "squid2.png"
|
x: parent.width * 0.05 + 60
|
||||||
width: 200; height: 200
|
/* For just a slide with text, things can be simplified using properties */
|
||||||
fillMode: Image.PreserveAspectFit
|
title: qsTr("Welcome to Fancy GNU/Linux.")
|
||||||
anchors.centerIn: parent
|
centeredText: qsTr("This is example branding for your GNU/Linux distribution. " +
|
||||||
}
|
|
||||||
Text {
|
|
||||||
id: namelabel2
|
|
||||||
anchors.horizontalCenter: background2.horizontalCenter
|
|
||||||
anchors.top: background2.bottom
|
|
||||||
text: qsTr("Welcome to Fancy GNU/Linux.")
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: presentation.width
|
|
||||||
horizontalAlignment: Text.Center
|
|
||||||
font.pointSize: 20
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
anchors.horizontalCenter: background2.horizontalCenter
|
|
||||||
anchors.top: namelabel2.bottom
|
|
||||||
text: qsTr("This is example branding for your GNU/Linux distribution. " +
|
|
||||||
"Long texts in the slideshow are translated and word-wrapped appropriately. " +
|
"Long texts in the slideshow are translated and word-wrapped appropriately. " +
|
||||||
"Calamares is a distribution-independent installer framework. ")
|
"Calamares is a distribution-independent installer framework. ")
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
width: presentation.width
|
|
||||||
horizontalAlignment: Text.Center
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Slide {
|
Slide {
|
||||||
Image {
|
|
||||||
id: background3
|
|
||||||
source: "squid3.png"
|
|
||||||
width: 200; height: 200
|
|
||||||
fillMode: Image.PreserveAspectFit
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
centeredText: qsTr("This is a third Slide element.")
|
centeredText: qsTr("This is a third Slide element.")
|
||||||
}
|
}
|
||||||
|
|
||||||
Slide {
|
Slide {
|
||||||
|
/* Note that these overlap because both are centered. The z-order puts the background
|
||||||
|
* in back. While you can use the properties of the Slide, it's not easy to get at
|
||||||
|
* the anchors of the items.
|
||||||
|
*/
|
||||||
Image {
|
Image {
|
||||||
id: background4
|
id: background4
|
||||||
source: "squid4.png"
|
source: "squid4.png"
|
||||||
width: 200; height: 200
|
width: 200; height: 200
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
z: -1
|
||||||
}
|
}
|
||||||
centeredText: qsTr("This is a fourth Slide element.")
|
centeredText: qsTr("This is a fourth Slide element.")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue