Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Page component and update ApplicationWindow and examples gallery #9

Merged
merged 2 commits into from Oct 27, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
90 changes: 23 additions & 67 deletions examples/touch/content/ButtonPage.qml
Expand Up @@ -43,79 +43,35 @@ import QtQuick.Controls 1.0 //needed for the Stack attached property
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0

Rectangle {
Page {
id: root
width: parent.width
height: parent.height

color: "black"
ToolBar {
id: toolbar
anchors.top: parent.top
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
opacity: (root.Stack.view && (root.Stack.view.depth > 1)) ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"
Behavior on opacity { NumberAnimation{} }
Image {
anchors.verticalCenter: parent.verticalCenter
source: "../images/navigation_previous_item.png"
}
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
onClicked: root.Stack.view.pop()
}
}

Text {
font.pixelSize: 42
Behavior on x { NumberAnimation { easing.type: Easing.OutCubic } }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
color: "white"
text: "Buttons"
}
}
tools: ToolBarLayoutExample { title: "Buttons" }

Item {
anchors.top: toolbar.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
Column {
spacing: 40
anchors.centerIn: parent

Column {
spacing: 40
anchors.centerIn: parent

Button {
property bool isGlacier: Theme.name == "Glacier"
anchors.margins: 20
text: isGlacier ? "Set Ugly Theme" : "Set Nice Theme"
onClicked: isGlacier ? Theme.loadFromFile("ugly.json")
: Theme.loadFromFile("glacier.json")
}
Button {
property bool isGlacier: Theme.name == "Glacier"
anchors.margins: 20
text: isGlacier ? "Set Ugly Theme" : "Set Nice Theme"
onClicked: isGlacier ? Theme.loadFromFile("ugly.json")
: Theme.loadFromFile("glacier.json")
}

Button {
anchors.margins: 20
enabled: false
text: "Disabled"
}
Button {
anchors.margins: 20
enabled: false
text: "Disabled"
}

Button {
anchors.margins: 20
primary: true
text: "Go back"
onClicked: if (stackView) stackView.pop()
}
Button {
anchors.margins: 20
primary: true
text: "Go back"
onClicked: if (stackView) stackView.pop()
}
}

}
50 changes: 3 additions & 47 deletions examples/touch/content/LiveCoding.qml
Expand Up @@ -22,60 +22,16 @@ import QtQuick.Controls 1.0 //needed for the Stack attached property
import QtQuick.Controls.Nemo 1.0
import QtQuick.Layouts 1.0

Rectangle {
Page {
id: root
width: parent.width
height: parent.height

color: "black"
property var oldItem
property var newItem

ToolBar {
id: toolbar
anchors.top: parent.top
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
opacity: (root.Stack.view && (root.Stack.view.depth > 1)) ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"

Behavior on opacity { NumberAnimation{} }

Image {
anchors.verticalCenter: parent.verticalCenter
source: "../images/navigation_previous_item.png"
}

MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
onClicked: root.Stack.view.pop()
}
}

Text {
font.pixelSize: 42
Behavior on x { NumberAnimation { easing.type: Easing.OutCubic } }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
color: "white"
text: "Live Coding Arena"
}
}
tools: ToolBarLayoutExample { title: "Live Coding Arena" }

SplitView {
anchors.top: toolbar.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.fill: parent

//If we don't wrap ColumnLayout in an Item, the split view doesn't work :/
Item {
Expand Down
89 changes: 20 additions & 69 deletions examples/touch/content/ProgressBarPage.qml
Expand Up @@ -38,21 +38,14 @@
**
****************************************************************************/





import QtQuick 2.1
import QtQuick.Controls 1.0 //needed for the Stack attached property
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0

Rectangle {
Page {
id: root
width: parent.width
height: parent.height

color: "black"
property real progress: 0
SequentialAnimation on progress {
loops: Animation.Infinite
Expand All @@ -69,71 +62,29 @@ Rectangle {
}
}

ToolBar {
id: toolbar
anchors.top: parent.top
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
opacity: (root.Stack.view && (root.Stack.view.depth > 1)) ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"
Behavior on opacity { NumberAnimation{} }
Image {
anchors.verticalCenter: parent.verticalCenter
source: "../images/navigation_previous_item.png"
}
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
onClicked: root.Stack.view.pop()
}
}

Text {
font.pixelSize: 42
Behavior on x { NumberAnimation { easing.type: Easing.OutCubic } }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
color: "white"
text: "Progress Bars"
}
}

Item {
anchors.top: toolbar.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
tools: ToolBarLayoutExample { title: "Progress Bars" }

Column {
spacing: 40
anchors.centerIn: parent
Column {
spacing: 40
anchors.centerIn: parent

ProgressBar {
anchors.margins: 20
width: 400
value: progress
}
ProgressBar {
anchors.margins: 20
width: 400
value: progress
}

ProgressBar {
anchors.margins: 20
width: 400
value: 1 - progress
}
ProgressBar {
anchors.margins: 20
width: 400
value: 1 - progress
}

ProgressBar {
anchors.margins: 20
style: touchStyle
value: 1
width: 400
}
ProgressBar {
anchors.margins: 20
style: touchStyle
value: 1
width: 400
}
}

Expand Down
87 changes: 19 additions & 68 deletions examples/touch/content/SliderPage.qml
Expand Up @@ -38,83 +38,34 @@
**
****************************************************************************/





import QtQuick 2.1
import QtQuick.Controls 1.0 //needed for the Stack attached property
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0

Rectangle {
Page {
id: root
width: parent.width
height: parent.height

color: "black"
ToolBar {
id: toolbar
anchors.top: parent.top
Rectangle {
id: backButton
width: opacity ? 60 : 0
anchors.left: parent.left
anchors.leftMargin: 20
opacity: (root.Stack.view && (root.Stack.view.depth > 1)) ? 1 : 0
anchors.verticalCenter: parent.verticalCenter
antialiasing: true
height: 60
radius: 4
color: backmouse.pressed ? "#222" : "transparent"
Behavior on opacity { NumberAnimation{} }
Image {
anchors.verticalCenter: parent.verticalCenter
source: "../images/navigation_previous_item.png"
}
MouseArea {
id: backmouse
anchors.fill: parent
anchors.margins: -10
onClicked: root.Stack.view.pop()
}
}

Text {
font.pixelSize: 42
Behavior on x { NumberAnimation { easing.type: Easing.OutCubic } }
x: backButton.x + backButton.width + 20
anchors.verticalCenter: parent.verticalCenter
color: "white"
text: "Sliders"
}
}
tools: ToolBarLayoutExample { title: "Sliders" }

Item {
anchors.top: toolbar.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
Column {
spacing: 12
anchors.centerIn: parent

Column {
spacing: 12
anchors.centerIn: parent

Slider {
anchors.margins: 20
//style: touchStyle
value: 0
}
Slider {
anchors.margins: 20
//style: touchStyle
value: 0.5
}
Slider {
anchors.margins: 20
style: touchStyle
value: 1.0
}
Slider {
anchors.margins: 20
//style: touchStyle
value: 0
}
Slider {
anchors.margins: 20
//style: touchStyle
value: 0.5
}
Slider {
anchors.margins: 20
style: touchStyle
value: 1.0
}
}

Expand Down