diff options
Diffstat (limited to 'qml/touch')
-rw-r--r-- | qml/touch/ListViewDelegate.qml | 158 | ||||
-rw-r--r-- | qml/touch/Separator.qml | 29 | ||||
-rw-r--r-- | qml/touch/TouchLabel.qml | 79 | ||||
-rw-r--r-- | qml/touch/TouchScrollView.qml | 59 | ||||
-rw-r--r-- | qml/touch/TouchSlider.qml | 81 | ||||
-rw-r--r-- | qml/touch/TouchTextField.qml | 115 | ||||
-rw-r--r-- | qml/touch/images/BackArrow.png | bin | 0 -> 376 bytes | |||
-rw-r--r-- | qml/touch/images/Circle.png | bin | 0 -> 1219 bytes | |||
-rw-r--r-- | qml/touch/images/Clear.png | bin | 0 -> 1783 bytes | |||
-rw-r--r-- | qml/touch/images/Pointer.png | bin | 0 -> 5674 bytes | |||
-rw-r--r-- | qml/touch/images/Pointer_pressed.png | bin | 0 -> 5690 bytes | |||
-rw-r--r-- | qml/touch/images/darkclose.png | bin | 0 -> 3328 bytes | |||
-rw-r--r-- | qml/touch/images/magnifier.png | bin | 0 -> 3422 bytes |
13 files changed, 521 insertions, 0 deletions
diff --git a/qml/touch/ListViewDelegate.qml b/qml/touch/ListViewDelegate.qml new file mode 100644 index 0000000..eecce49 --- /dev/null +++ b/qml/touch/ListViewDelegate.qml @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import org.qtproject.demo.weather 1.0 + +Rectangle { + id: rect + height: 118 * ApplicationInfo.ratio + width: parent.width + signal clicked + signal deleteCity + + property bool isSearchView: false + + color: mouseNext.pressed ? ApplicationInfo.colors.smokeGray : ApplicationInfo.colors.white + + GridLayout { + id: _grid + anchors.fill: parent + flow: Qt.LeftToRight + rowSpacing: 4 * ApplicationInfo.ratio + columnSpacing: 0 + columns: 2 + Rectangle { + Layout.preferredWidth: ApplicationInfo.hMargin + Layout.fillHeight: true + opacity: 0 + } + Loader { + sourceComponent: isSearchView ? searchViewRow : cityViewRow + Layout.fillHeight: true + Layout.fillWidth: true + } + Rectangle { + id: separator + Layout.fillWidth: true + Layout.fillHeight: true + Layout.columnSpan: 2 + } + } + Rectangle { + z: 1 + height: 1 + anchors.bottom: parent.bottom + width: parent.width + color: ApplicationInfo.colors.paleGray + } + MouseArea { + id: mouseNext + anchors.left: parent.left + width: parent.width - 80 * ApplicationInfo.ratio - ApplicationInfo.hMargin + height: parent.height + onClicked: rect.clicked() + } + + property Component searchViewRow: RowLayout { + spacing: 0 + TouchLabel { + color: ApplicationInfo.colors.mediumGray + id: countryLabel + text: country + pixelSize: 28 + Layout.alignment: Qt.AlignBaseline + Layout.fillWidth: true + Layout.maximumWidth: rect.width - 2 * ApplicationInfo.hMargin + } + Rectangle { + Layout.preferredWidth: ApplicationInfo.hMargin + Layout.fillHeight: true + opacity: 0 + } + } + + property Component cityViewRow: RowLayout { + spacing: 0 + TouchLabel { + id: city + text: name + font.weight: Font.DemiBold + Layout.maximumWidth: maximumWidth * 2 + Layout.alignment: Qt.AlignBaseline + } + Item { + implicitWidth: 12 * ApplicationInfo.ratio + Layout.minimumWidth: implicitWidth + } + TouchLabel { + color: ApplicationInfo.colors.mediumGray + id: countryLabel + text: country + pixelSize: 28 + Layout.alignment: Qt.AlignBaseline | Qt.AlignLeft + Layout.fillWidth: true + Layout.minimumWidth: 0 + } + MouseArea { + id: deleteMouse + implicitWidth: 110 * ApplicationInfo.ratio + implicitHeight: 110 * ApplicationInfo.ratio + Layout.minimumWidth: implicitWidth + onClicked: if (!isSearchView) rect.deleteCity() + Image { + id: imageRemove + anchors.centerIn: parent + source: ApplicationInfo.getImagePath("darkclose.png") + width: 31 * ApplicationInfo.ratio + height: 31 * ApplicationInfo.ratio + } + Rectangle { + anchors.fill: parent + color: ApplicationInfo.colors.smokeGray + opacity: deleteMouse.pressed ? 1 : 0 + z: -1 + radius: 8 + } + } + } +} diff --git a/qml/touch/Separator.qml b/qml/touch/Separator.qml new file mode 100644 index 0000000..dd7516e --- /dev/null +++ b/qml/touch/Separator.qml @@ -0,0 +1,29 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc +** All rights reserved. +** For any questions to Digia, please use contact form at http://qt.digia.com +** +** This file is part of the QtQuick Enterprise Controls Demos. +** +** $QT_BEGIN_LICENSE$ +** Licensees holding valid Qt Commercial licenses may use this file in +** accordance with the Qt Commercial License Agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. +** +** If you have questions regarding the use of this file, please use +** contact form at http://qt.digia.com +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Layouts 1.0 +import org.qtproject.demo.weather 1.0 + +Rectangle { + Layout.minimumWidth: SystemInfo.hMargin + Layout.minimumHeight: SystemInfo.hMargin + opacity: 0 +} diff --git a/qml/touch/TouchLabel.qml b/qml/touch/TouchLabel.qml new file mode 100644 index 0000000..bea6b3b --- /dev/null +++ b/qml/touch/TouchLabel.qml @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Layouts 1.0 +import org.qtproject.demo.weather 1.0 + +Label { + id: label + property int pixelSize: 34 + property real letterSpacing: -0.25 + + font.family: "Open Sans" + font.pixelSize: pixelSize * ApplicationInfo.ratio * 1.1 // increasing fonts + font.letterSpacing: letterSpacing * ApplicationInfo.ratio + color: ApplicationInfo.colors.doubleDarkGray + verticalAlignment: Text.AlignBottom + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + linkColor: ApplicationInfo.colors.blue + + function expectedTextWidth(value) + { + dayText.text = value + return dayText.width + } + + property int maximumWidth: (ApplicationInfo.constants.isMobile ? ApplicationInfo.applicationWidth : 1120) / 4 + Layout.minimumWidth: Math.min(Layout.maximumWidth, implicitWidth + 1) + + Text { + id: dayText + visible: false + font.family: label.font.family + font.pixelSize: label.font.pixelSize + font.letterSpacing: label.font.letterSpacing + wrapMode: label.wrapMode + elide: label.elide + } +} diff --git a/qml/touch/TouchScrollView.qml b/qml/touch/TouchScrollView.qml new file mode 100644 index 0000000..5d2c211 --- /dev/null +++ b/qml/touch/TouchScrollView.qml @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles 1.0 +import org.qtproject.demo.weather 1.0 + +ScrollView { + frameVisible: false + style: ScrollViewStyle { + property int handleWidth: 20 * ApplicationInfo.ratio + transientScrollBars: true + padding{ top: 4 ; bottom: 4 ; right: 4} + property bool hovered: false + } + Rectangle { + anchors.fill: parent + color: ApplicationInfo.colors.white + } +} diff --git a/qml/touch/TouchSlider.qml b/qml/touch/TouchSlider.qml new file mode 100644 index 0000000..6969239 --- /dev/null +++ b/qml/touch/TouchSlider.qml @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles 1.0 +import org.qtproject.demo.weather 1.0 + +Slider { + id: slider + implicitHeight: ApplicationInfo.sliderHandleHeight + ApplicationInfo.ratio * 25 + style: SliderStyle { + groove: Rectangle { + Rectangle { + id: beforeHandle + width: control.value * ApplicationInfo.sliderGapWidth + ApplicationInfo.sliderHandleWidth/2 + height: 20 * ApplicationInfo.ratio + color: ApplicationInfo.colors.blue + radius: 90 + z: -1 + } + Rectangle { + id: afterHandle + anchors.left: beforeHandle.right + anchors.right: parent.right + height: 20 * ApplicationInfo.ratio + color: ApplicationInfo.colors.darkGray + radius: 90 + z: -1 + } + } + handle: Item { + width: ApplicationInfo.sliderHandleWidth + height: ApplicationInfo.sliderHandleHeight + Image { + anchors.centerIn: parent + source: ApplicationInfo.getImagePath(control.pressed ? "Pointer_pressed.png" : "Pointer.png") + width: ApplicationInfo.sliderHandleWidth + 16 * ApplicationInfo.ratio + height: ApplicationInfo.sliderHandleHeight + 16 * ApplicationInfo.ratio + } + } + } +} diff --git a/qml/touch/TouchTextField.qml b/qml/touch/TouchTextField.qml new file mode 100644 index 0000000..9e0ffb0 --- /dev/null +++ b/qml/touch/TouchTextField.qml @@ -0,0 +1,115 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the FOO module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.1 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles 1.0 +import org.qtproject.demo.weather 1.0 + +TextField { + id: textfield + signal clearButtonClicked + implicitWidth: parent.width + property bool isEmpty: true + style: TextFieldStyle { + background : + Rectangle { + radius: 8 + border.width: 1 + border.color: Qt.darker(ApplicationInfo.colors.blue, 1.6) + color: ApplicationInfo.colors.white + gradient: Gradient { + GradientStop { position: 0 ; color: "#ddd"} + GradientStop { position: 0.05 ; color: "#fff"} + } + + implicitHeight: 60 * ApplicationInfo.ratio + opacity: 1 + } + padding.left : (12 + 50) * ApplicationInfo.ratio + padding.right: (12 + 50) * ApplicationInfo.ratio + font.pixelSize: 28 * ApplicationInfo.ratio + font.family: "Open Sans" + font.letterSpacing: -0.25 * ApplicationInfo.ratio + selectedTextColor : ApplicationInfo.colors.lightGray + selectionColor : ApplicationInfo.colors.darkBlue + textColor : ApplicationInfo.colors.mediumGray + } + + Item { + id: item + anchors.left: parent.left + anchors.top: parent.top + height: parent.height + width: parent.height + Image { + opacity: 0.9 + anchors.centerIn: item + height: iconSize + width: iconSize + source: ApplicationInfo.getImagePath("magnifier.png") + property int iconSize: 50 * ApplicationInfo.ratio + } + } + + onTextChanged: isEmpty = (text === "") + inputMethodHints: Qt.ImhNoPredictiveText + MouseArea { + z: 2 + opacity: !textfield.isEmpty ? 1 : 0 + Behavior on opacity {NumberAnimation{}} + anchors.right: parent.right + anchors.rightMargin: 4 * ApplicationInfo.ratio + anchors.top: parent.top + height: parent.height + width: parent.height + Image { + anchors.centerIn: parent + source: ApplicationInfo.getImagePath("Clear.png") + property int iconSize: 40 * ApplicationInfo.ratio + opacity: parent.pressed ? 1 : 0.9 + width: iconSize + height: iconSize + } + onClicked: textfield.clearButtonClicked() + } +} + diff --git a/qml/touch/images/BackArrow.png b/qml/touch/images/BackArrow.png Binary files differnew file mode 100644 index 0000000..9070d0f --- /dev/null +++ b/qml/touch/images/BackArrow.png diff --git a/qml/touch/images/Circle.png b/qml/touch/images/Circle.png Binary files differnew file mode 100644 index 0000000..7b229ec --- /dev/null +++ b/qml/touch/images/Circle.png diff --git a/qml/touch/images/Clear.png b/qml/touch/images/Clear.png Binary files differnew file mode 100644 index 0000000..883dffd --- /dev/null +++ b/qml/touch/images/Clear.png diff --git a/qml/touch/images/Pointer.png b/qml/touch/images/Pointer.png Binary files differnew file mode 100644 index 0000000..45b075e --- /dev/null +++ b/qml/touch/images/Pointer.png diff --git a/qml/touch/images/Pointer_pressed.png b/qml/touch/images/Pointer_pressed.png Binary files differnew file mode 100644 index 0000000..776e0d1 --- /dev/null +++ b/qml/touch/images/Pointer_pressed.png diff --git a/qml/touch/images/darkclose.png b/qml/touch/images/darkclose.png Binary files differnew file mode 100644 index 0000000..2f90820 --- /dev/null +++ b/qml/touch/images/darkclose.png diff --git a/qml/touch/images/magnifier.png b/qml/touch/images/magnifier.png Binary files differnew file mode 100644 index 0000000..42033b5 --- /dev/null +++ b/qml/touch/images/magnifier.png |