Commit cf56178d authored by Jens Bache-Wiig's avatar Jens Bache-Wiig Committed by Thomas Hartmann

Port welcome screen to Qt Quick 2

This ports the welcome screen to use QtQuick 2.0.
I have disabled the plugin on Qt4 builds.

Change-Id: Ia921d0747c8f7d4441c88fc9fb77b822496091f4
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent 328a24ed
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
Rectangle {
id: myApp
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import QtQuick 2.1
import widgets 1.0
Rectangle {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
ListModel {
ListElement {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
ListModel {
ListElement {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
ListModel {
ListElement {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
ListModel {
ListElement {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
ListModel {
ListElement {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
import widgets 1.0
Rectangle {
......@@ -82,6 +82,8 @@ Rectangle {
anchors.rightMargin: 80
anchors.right: parent.right
model: qtVersionModel
textRole: "text"
onCurrentIndexChanged: {
if (comboBox.model === undefined)
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import QtQuick 2.1
import widgets 1.0
Rectangle {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
import widgets 1.0
Rectangle {
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
import widgets 1.0
Rectangle {
......@@ -36,13 +36,13 @@ Rectangle {
color: "#edf0f2"
id: root
property var fonts: CustomFonts {}
property var colors: CustomColors { }
Rectangle {
id: canvas
width: Math.min(1024, parent.width)
//this is a workaround for QTCREATORBUG-6803
anchors.topMargin: (root.height > 700) ? 0 : 0
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
......
......@@ -27,8 +27,8 @@
**
****************************************************************************/
import QtQuick 1.0
import qtcomponents 1.0
import QtQuick 2.1
import QtQuick.Controls 1.0
ChoiceList {
ComboBox {
}
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
QtObject {
property color linkColor: "#445ba8"
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import QtQuick 2.1
QtObject {
property alias linkFont: linkText.font
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import QtQuick 2.1
Row {
id: customTab
......
......@@ -27,64 +27,36 @@
**
****************************************************************************/
import QtQuick 1.0
import qtcomponents 1.0
GridView {
id: gridView
interactive: false
clip: true
cellHeight: 240
cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1)
cacheBuffer: 1000
import QtQuick 2.1
import QtQuick.Controls 1.0
ScrollView {
x: Math.max((width - (cellWidth * columns)) / 2, 0);
delegate: Delegate {
id: delegate
property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1
property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: model.imageSource === undefined ? helpSource : mockupSource
videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource
caption: model.name;
description: model.description
isVideo: model.isVideo === true
videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags
}
WheelArea {
id: wheelarea
anchors.fill: parent
verticalMinimumValue: vscrollbar.minimumValue
verticalMaximumValue: vscrollbar.maximumValue
onVerticalValueChanged: gridView.contentY = verticalValue
verticalValue: gridView.contentY
}
ScrollBar {
id: vscrollbar
orientation: Qt.Vertical
property int availableHeight : gridView.height
visible: contentHeight > availableHeight
maximumValue: contentHeight > availableHeight ? gridView.contentHeight - availableHeight : 0
minimumValue: 0
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.topMargin: styleitem.style == "mac" ? 1 : 0
onValueChanged: gridView.contentY = value
anchors.rightMargin: styleitem.frameoffset
anchors.bottomMargin: hscrollbar.visible ? hscrollbar.height : styleitem.frameoffset
value: gridView.contentY
property alias model: gridView.model
GridView {
id: gridView
interactive: false
cellHeight: 240
cellWidth: 216
property int columns: Math.max(Math.floor(width / cellWidth), 1)
delegate: Delegate {
id: delegate
property bool isHelpImage: model.imageUrl.search(/qthelp/) != -1
property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
property string mockupSource: model.imageSource
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
imageSource: model.imageSource === undefined ? helpSource : mockupSource
videoSource: model.imageSource === undefined ? model.imageUrl : mockupSource
caption: model.name;
description: model.description
isVideo: model.isVideo === true
videoLength: model.videoLength !== undefined ? model.videoLength : ""
tags: model.tags
}
}
}
......@@ -27,8 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import qtcomponents 1.0
import QtQuick 2.1
Rectangle {
id: delegate
......@@ -64,17 +63,6 @@ Rectangle {
searchBar.text += " " + tagStr
}
CustomColors {
id: colors
}
CustomFonts {
id: fonts
}
QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent }
BorderImage {
id: image1
x: 11
......@@ -228,6 +216,7 @@ Rectangle {
id: mousearea1
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: {
delegate.state="hover"
}
......
import QtQuick 1.1
import qtcomponents 1.0
import QtQuick 2.1
Item {
id: gettingStartedItem
......@@ -13,16 +12,6 @@ Item {
signal clicked
CustomColors {
id: colors
}
CustomFonts {
id: fonts
}
QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent }
Rectangle {
y: 170
width: 20
......@@ -106,6 +95,7 @@ Item {
MouseArea {
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onEntered: {
gettingStartedItem.state="hover"
}
......
import QtQuick 1.1
import QtQuick 2.1
import widgets 1.0
Row {
......
......@@ -27,8 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import qtcomponents 1.0
import QtQuick 2.1
Text {
id: root
......@@ -52,14 +51,6 @@ Text {
property bool enlargeMouseArea: true
CustomFonts {
id: fonts
}
CustomColors {
id: colors
}
Rectangle {
color: "#909090"
radius: 6
......@@ -89,8 +80,7 @@ Text {
anchors.margins: enlargeMouseArea ? -8 : 0
hoverEnabled: true
QStyleItem { cursor: "pointinghandcursor"; anchors.fill: parent }
cursorShape: Qt.PointingHandCursor
onEntered: {
if (!root.active)
mouseArea.state = "hovered"
......
......@@ -27,8 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import qtcomponents 1.0 as Components
import QtQuick 2.1
Item {
id: tabBar
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
Image {
id: logo
......
......@@ -27,16 +27,16 @@
**
****************************************************************************/
import QtQuick 1.1
import QtQuick 1.0
import QtQuick 2.1
Item {
id: pageCaption
width: 960
height: 40
property int textOffset: captionText.x + captionText.width
property int textOffset: captionText.x + captionText.width
property alias caption: captionText.text
Text {
id: captionText
y: 9
......@@ -55,8 +55,4 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
}
CustomColors {
id: colors
}
}
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
Item {
id: pageLoader
......
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.0
import QtQuick 2.1
Item {
id: projectItem
......@@ -48,10 +48,6 @@ Item {
anchors.verticalCenter: projectNameText.verticalCenter
}
CustomFonts {
id: fonts
}
LinkedText {
id: projectNameText
y: 2
......
......@@ -27,23 +27,21 @@
**
****************************************************************************/
import QtQuick 1.0
import qtcomponents 1.0
import QtQuick 2.1
import QtQuick.Controls 1.0
ScrollArea {
property bool scrollBarVisible: projectList.verticalScrollBar.visible
ScrollView {
id: projectList
property alias model: repeater.model
Behavior on verticalScrollBar.opacity {
PropertyAnimation {
property bool scrollBarVisible: false//projectList.verticalScrollBar.visible
property alias model: repeater.model
// Behavior on verticalScrollBar.opacity {
// PropertyAnimation {
}
}
// }
// }
frame: false
horizontalScrollBar.visible: false
clip: true
// frameVisible: false
Column {
id: column
......
......@@ -27,35 +27,42 @@
**
****************************************************************************/
import QtQuick 1.0
import qtcomponents 1.0
import QtQuick 2.1
Rectangle {
id: searchBar
width: 930
height: 31
height: 27
color: "#ffffff"
radius: 6
border.color: "#cccccc"
property alias placeholderText: lineEdit.placeholderText
property alias text: lineEdit.text
CustomFonts {
id: fonts
}
property alias placeholderText: placeHolderText.text
property alias text: lineEdit.text
TextField {
TextInput {
id: lineEdit
placeholderText: qsTr("Search...")
anchors.topMargin: 1
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 12
anchors.leftMargin: 12
anchors.verticalCenter: parent.verticalCenter
background: Item {}
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
font.pixelSize: 14
font.bold: false
font.family: "Helvetica"
}
Text {
id: placeHolderText
visible: !lineEdit.text.length
text: qsTr("Search...")
anchors.fill: lineEdit
font: lineEdit.font
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
color: "gray"
}
}
......@@ -27,7 +27,7 @@
**
****************************************************************************/
import QtQuick 1.1
import QtQuick 2.1
Item {
x: 5
......@@ -36,10 +36,6 @@ Item {
height: column.height
property alias name: text.text
CustomFonts {
id: fonts
}
Column {
id: column
spacing: 4
......@@ -100,14 +96,13 @@ Item {
Item {
z: -1
property int margin: 6
height: innerColumn.height + margin * 2
height: expanded ? innerColumn.height + margin * 2 : 0
width: delegate.ListView.view.width - 8 - margin * 2
opacity: delegate.expanded ? 1 : 0
Behavior on opacity {
Behavior on height {
ParallelAnimation {
PauseAnimation { duration: delegate.expanded ? 100 : 0; }
PropertyAnimation { duration: 100; }
PropertyAnimation { duration: 160 ; easing.type: Easing.OutCubic }
}
}
......
......@@ -27,33 +27,25 @@
**
****************************************************************************/
import QtQuick 1.0
import qtcomponents 1.0
import QtQuick 2.1
import widgets 1.0
Item {
property alias model: root.model
id: root
property var model
property int topMargin: 6
height: Math.min(root.contentHeight + topMargin, parent.height - 260)
property alias scrollBarVisible: vscrollbar.visible
height: Math.min(content.contentHeight + topMargin, parent.height - 260)
ListView {
id: root
id: content
model: root.model
anchors.fill: parent
anchors.topMargin: topMargin
snapMode: ListView.SnapToItem
property int delegateHeight: currentItem.height + spacing
//property int delegateHeight: 22
interactive: false
spacing: 4
cacheBuffer: 800 //We need a big cache to avoid artefacts caused by delegate recreation
clip: true
delegate: SessionItem {
function fullSessionName()
{
......@@ -64,35 +56,7 @@ Item {
newSessionName = qsTr("%1 (current session)").arg(sessionName);
return newSessionName;
}
name: fullSessionName()
}
WheelArea {
id: wheelarea
anchors.fill: parent
verticalMinimumValue: vscrollbar.minimumValue
verticalMaximumValue: vscrollbar.maximumValue
onVerticalValueChanged: root.contentY = verticalValue
}
ScrollBar {
id: vscrollbar
orientation: Qt.Vertical
property int availableHeight : root.height
visible: root.contentHeight > availableHeight
maximumValue: root.contentHeight > availableHeight ? root.contentHeight - availableHeight : 0
minimumValue: 0
anchors.right: parent.right
anchors.top: parent.top
anchors.bottom: parent.bottom
singleStep: root.delegateHeight
anchors.topMargin: styleitem.style === "mac" ? 1 : 0
onValueChanged: root.contentY = value
anchors.rightMargin: styleitem.frameoffset
anchors.bottomMargin: styleitem.frameoffset
value: root.contentY