Skip to content

Commit

Permalink
Initial restructure to support themes
Browse files Browse the repository at this point in the history
  • Loading branch information
Iktwo committed Sep 16, 2016
1 parent 4dc8d0c commit 0fb5a54
Show file tree
Hide file tree
Showing 13 changed files with 851 additions and 152 deletions.
115 changes: 106 additions & 9 deletions src/qml/IntroView.qml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import QtQuick 2.5
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.2
import com.iktwo.qutelauncher 1.0 as QL

FocusScope {
id: root

property alias currentIndex: listView.currentIndex
property alias model: listView.model
property alias progress: animationController.progress
Expand All @@ -13,9 +16,14 @@ FocusScope {
property alias rectangleDividerHeight: rectangleDivider.height
property alias dragging: listView.dragging

property int navbarMargin
property int statusbarMargin

readonly property double xPosition: (listView.contentX / listView.width)
readonly property bool movingLeft: listView.movingLeft

signal done

onXPositionChanged: {
if (currentIndex < 0)
return
Expand Down Expand Up @@ -61,7 +69,7 @@ FocusScope {

anchors.fill: parent

ColorAnimation on color { }
ColorAnimation on color { duration: 325 }
}

ListView {
Expand Down Expand Up @@ -98,16 +106,31 @@ FocusScope {

preferredHighlightBegin: 0
preferredHighlightEnd: width
cacheBuffer: width * 3
maximumFlickVelocity: width * 2

delegate: Rectangle {
delegate: Item {
height: ListView.view.height
width: ListView.view.width

color: "transparent"
Loader {
id: loader

border {
color: "black"
width: 1
anchors {
fill: parent
topMargin: statusbarMargin
bottomMargin: navbarMargin
}

source: "intro/" + model.name
}

Connections {
target: loader.item

ignoreUnknownSignals: true

onDone: root.done()
}
}
}
Expand All @@ -118,10 +141,10 @@ FocusScope {
anchors {
left: parent.left
right: parent.right
bottom: parent.bottom
bottom: parent.bottom; bottomMargin: root.navbarMargin
}

height: 57
height: 56 * QL.ScreenValues.dp

Rectangle {
id: rectangleDivider
Expand All @@ -131,10 +154,84 @@ FocusScope {
right: parent.right
}

height: 1
height: 1 * QL.ScreenValues.dp

color: "#44ffffff"
}

Row {
anchors.centerIn: parent

spacing: 8 * QL.ScreenValues.dp

Repeater {
model: root.model.count

Item {
height: 16 * QL.ScreenValues.dp
width: height

Rectangle {
id: rectangleIndicator

property bool active: index === listView.currentIndex

anchors.centerIn: parent

height: 10 * QL.ScreenValues.dp
width: height
radius: height
opacity: active ? 1 : 0.6

state: "inactive"
states: [
State {
name: "active"
when: rectangleIndicator.active

PropertyChanges {
target: rectangleIndicator
height: 16 * QL.ScreenValues.dp
width: 16 * QL.ScreenValues.dp
}
},
State {
name: "inactive"
when: !rectangleIndicator.active

PropertyChanges {
target: rectangleIndicator
height: 10 * QL.ScreenValues.dp
width: 10 * QL.ScreenValues.dp
}
}
]

transitions: [
Transition {
from: "active"
to: "inactive"
reversible: true

ParallelAnimation {
NumberAnimation {
property: "height"
duration: 175
easing.type: Easing.OutQuad
}

NumberAnimation {
property: "width"
duration: 175
easing.type: Easing.OutQuad
}
}
}
]
}
}
}
}
}

AnimationController {
Expand Down
2 changes: 1 addition & 1 deletion src/qml/config/Dimensions.qml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import QtQuick 2.0
import com.iktwo.qutelauncher 1.0 as QL

Item {
property int navbarShadowBorderSize: 5 * QL.ScreenValues.dp
property int barsShadowSize: 85 * QL.ScreenValues.dp
}
16 changes: 16 additions & 0 deletions src/qml/intro/IntroEnd.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import QtQuick 2.6
import QtQuick.Controls 1.4
import com.iktwo.qutelauncher 1.0 as QL

Item {
id: root

signal done

Button {
anchors.centerIn: parent

text: "DONE"
onClicked: root.done()
}
}
56 changes: 56 additions & 0 deletions src/qml/intro/IntroMain.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import QtQuick 2.6
import QtQuick.Controls 1.4
import com.iktwo.qutelauncher 1.0 as QL

Item {

Column {
anchors {
fill: parent
margins: 8 * QL.ScreenValues.dp
}

Label {
anchors {
left: parent.left
right: parent.right
}

text: qsTr("QuteLauncher")
color: "#ffffff"
horizontalAlignment: Text.AlignHCenter

font.pointSize: 22
}

Item {
height: 16 * QL.ScreenValues.dp
}

Label {
anchors {
left: parent.left
right: parent.right
}

text: "**PLACEHOLDER** Customizable open source Android launcher. Get the source code and contribute at https://iktwo.github.io/QuteLauncher/"
color: "#ffffff"
horizontalAlignment: Text.AlignJustify
wrapMode: Text.Wrap

font.pointSize: 16
}

Item {
height: 24 * QL.ScreenValues.dp
}

Image {
anchors.horizontalCenter: parent.horizontalCenter

width: Math.min(parent.width, parent.height) * 0.34
height: width
source: "qrc:/images/icon"
}
}
}
Loading

0 comments on commit 0fb5a54

Please sign in to comment.