First draft
This commit is contained in:
124
qml/BobbycarMainWindow.qml
Normal file
124
qml/BobbycarMainWindow.qml
Normal file
@@ -0,0 +1,124 @@
|
||||
import QtQuick 2.9
|
||||
import QtQml 2.11
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Imagine 2.3
|
||||
import QtQuick.Window 2.0
|
||||
import QtWebEngine 1.0
|
||||
import "./leftPanes"
|
||||
import "./rightPanes"
|
||||
import "./inputdemo"
|
||||
|
||||
ApplicationWindow {
|
||||
id: window
|
||||
width: 800
|
||||
height: 480
|
||||
minimumWidth: 800
|
||||
minimumHeight: 480
|
||||
title: "Bobbycar"
|
||||
|
||||
readonly property color colorGlow: "#1d6d64"
|
||||
readonly property color colorWarning: "#d5232f"
|
||||
readonly property color colorMain: "#6affcd"
|
||||
readonly property color colorBright: "#ffffff"
|
||||
readonly property color colorLightGrey: "#888"
|
||||
readonly property color colorDarkGrey: "#333"
|
||||
|
||||
readonly property int fontSizeExtraSmall: Qt.application.font.pixelSize * 0.8
|
||||
readonly property int fontSizeMedium: Qt.application.font.pixelSize * 1.5
|
||||
readonly property int fontSizeLarge: Qt.application.font.pixelSize * 2
|
||||
readonly property int fontSizeExtraLarge: Qt.application.font.pixelSize * 5
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
spacing: 10
|
||||
|
||||
StackLayout {
|
||||
currentIndex: rightTabBar.currentIndex == 0 ? 1 : (rightTabBar.currentIndex == 1 ? 2 : 0)
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
spacing: 10
|
||||
|
||||
LeftButtonBar {
|
||||
id: leftTabBar
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
currentIndex: leftTabBar.currentIndex
|
||||
|
||||
Layout.preferredWidth: 200
|
||||
//Layout.maximumWidth: 150
|
||||
Layout.fillWidth: false
|
||||
|
||||
NavigationPane {
|
||||
}
|
||||
|
||||
MusicPane {
|
||||
}
|
||||
|
||||
MessagePane {
|
||||
}
|
||||
|
||||
CommandPane {
|
||||
}
|
||||
|
||||
SettingsPane {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: colorMain
|
||||
implicitWidth: 1
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
CenterPane {
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: colorMain
|
||||
implicitWidth: 1
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
StackLayout {
|
||||
currentIndex: rightTabBar.currentIndex
|
||||
|
||||
Layout.preferredWidth: 150
|
||||
Layout.maximumWidth: 150
|
||||
Layout.fillWidth: false
|
||||
|
||||
StatusPane {
|
||||
}
|
||||
|
||||
StatusPane {
|
||||
}
|
||||
|
||||
AirCondPane {
|
||||
}
|
||||
|
||||
SeatsPane {
|
||||
}
|
||||
|
||||
StatisticsPane {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
WebEngineView {
|
||||
anchors.fill: parent
|
||||
url: "https://maps.google.com"
|
||||
}
|
||||
|
||||
InputDemo {
|
||||
}
|
||||
}
|
||||
|
||||
RightButtonBar {
|
||||
id: rightTabBar
|
||||
}
|
||||
}
|
||||
}
|
71
qml/CenterPane.qml
Normal file
71
qml/CenterPane.qml
Normal file
@@ -0,0 +1,71 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
ColumnLayout {
|
||||
Layout.preferredWidth: 250
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
GlowingLabel {
|
||||
id: timeLabel
|
||||
font.pixelSize: fontSizeExtraLarge
|
||||
text: Qt.formatTime(new Date(), "hh:mm:ss")
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
id: dateLabel
|
||||
color: colorLightGrey
|
||||
font.pixelSize: fontSizeMedium
|
||||
text: Qt.formatDate(new Date(), "dd.MM.yyyy")
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: 2
|
||||
Layout.bottomMargin: 10
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 1000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered:
|
||||
{
|
||||
const ts = new Date();
|
||||
timeLabel.text = Qt.formatTime(ts, "hh:mm:ss");
|
||||
dateLabel.text = Qt.formatDate(ts, "dd.MM.yyyy");
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
source: "qrc:/icons/car.png"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
Column {
|
||||
x: parent.width * 0.88
|
||||
y: parent.height * 0.56
|
||||
spacing: 3
|
||||
|
||||
Image {
|
||||
source: "qrc:/icons/warning.png"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: CustomGlow {
|
||||
spread: 0.2
|
||||
samples: 40
|
||||
color: colorWarning
|
||||
}
|
||||
}
|
||||
|
||||
GlowingLabel {
|
||||
text: qsTr("FOC err 4")
|
||||
color: colorWarning
|
||||
glowColor: Qt.rgba(colorWarning.r, colorWarning.g, colorWarning.b, 0.4)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
57
qml/CustomGlow.qml
Normal file
57
qml/CustomGlow.qml
Normal file
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** BSD License Usage
|
||||
** Alternatively, you may use this file under the terms of the BSD license
|
||||
** as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||
** contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtGraphicalEffects 1.0
|
||||
|
||||
Glow {
|
||||
color: glowColor
|
||||
samples: 20
|
||||
spread: 0.3
|
||||
}
|
70
qml/FeatureButton.qml
Normal file
70
qml/FeatureButton.qml
Normal file
@@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** BSD License Usage
|
||||
** Alternatively, you may use this file under the terms of the BSD license
|
||||
** as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||
** contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
Button {
|
||||
id: button
|
||||
checkable: true
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
leftPadding: 4
|
||||
rightPadding: 4
|
||||
topPadding: 12
|
||||
bottomPadding: 12
|
||||
implicitWidth: 60
|
||||
implicitHeight: 90
|
||||
|
||||
icon.name: "placeholder"
|
||||
icon.width: 44
|
||||
icon.height: 44
|
||||
display: Button.TextUnderIcon
|
||||
}
|
90
qml/GlowingLabel.qml
Normal file
90
qml/GlowingLabel.qml
Normal file
@@ -0,0 +1,90 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the examples of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:BSD$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** BSD License Usage
|
||||
** Alternatively, you may use this file under the terms of the BSD license
|
||||
** as follows:
|
||||
**
|
||||
** "Redistribution and use in source and binary forms, with or without
|
||||
** modification, are permitted provided that the following conditions are
|
||||
** met:
|
||||
** * Redistributions of source code must retain the above copyright
|
||||
** notice, this list of conditions and the following disclaimer.
|
||||
** * Redistributions in binary form must reproduce the above copyright
|
||||
** notice, this list of conditions and the following disclaimer in
|
||||
** the documentation and/or other materials provided with the
|
||||
** distribution.
|
||||
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||
** contributors may be used to endorse or promote products derived
|
||||
** from this software without specific prior written permission.
|
||||
**
|
||||
**
|
||||
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
// This container and the transform on the Label are
|
||||
// necessary to get precise bounding rect of the text for layouting reasons,
|
||||
// since some of the labels' font sizes can get quite large.
|
||||
Item {
|
||||
id: root
|
||||
implicitHeight: labelTextMetrics.tightBoundingRect.height
|
||||
implicitWidth: label.implicitWidth
|
||||
|
||||
property alias text: label.text
|
||||
property alias font: label.font
|
||||
property alias horizontalAlignment: label.horizontalAlignment
|
||||
property alias verticalAlignment: label.verticalAlignment
|
||||
property bool glowEnabled: true
|
||||
property color glowColor: colorGlow
|
||||
property color color: colorBright
|
||||
|
||||
Label {
|
||||
id: label
|
||||
anchors.baseline: root.baseline
|
||||
color: root.color
|
||||
|
||||
layer.enabled: root.glowEnabled
|
||||
layer.effect: CustomGlow {
|
||||
color: glowColor
|
||||
}
|
||||
|
||||
TextMetrics {
|
||||
id: labelTextMetrics
|
||||
text: label.text
|
||||
font: label.font
|
||||
}
|
||||
|
||||
transform: Translate {
|
||||
y: -labelTextMetrics.tightBoundingRect.y
|
||||
}
|
||||
}
|
||||
}
|
70
qml/LeftButtonBar.qml
Normal file
70
qml/LeftButtonBar.qml
Normal file
@@ -0,0 +1,70 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
Container {
|
||||
id: leftTabBar
|
||||
|
||||
currentIndex: 0
|
||||
|
||||
Layout.fillWidth: false
|
||||
Layout.fillHeight: true
|
||||
|
||||
ButtonGroup {
|
||||
buttons: columnLayout.children
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
id: columnLayout
|
||||
spacing: 3
|
||||
|
||||
Repeater {
|
||||
model: leftTabBar.contentModel
|
||||
}
|
||||
}
|
||||
|
||||
FeatureButton {
|
||||
text: qsTr("Navigation")
|
||||
icon.name: "navigation"
|
||||
Layout.fillHeight: true
|
||||
property int myIndex: 0
|
||||
onClicked: leftTabBar.currentIndex = myIndex
|
||||
checked: leftTabBar.currentIndex == myIndex
|
||||
}
|
||||
|
||||
FeatureButton {
|
||||
text: qsTr("Music")
|
||||
icon.name: "music"
|
||||
Layout.fillHeight: true
|
||||
property int myIndex: 1
|
||||
onClicked: leftTabBar.currentIndex = myIndex
|
||||
checked: leftTabBar.currentIndex == myIndex
|
||||
}
|
||||
|
||||
FeatureButton {
|
||||
text: qsTr("Message")
|
||||
icon.name: "message"
|
||||
Layout.fillHeight: true
|
||||
property int myIndex: 2
|
||||
onClicked: leftTabBar.currentIndex = myIndex
|
||||
checked: leftTabBar.currentIndex == myIndex
|
||||
}
|
||||
|
||||
FeatureButton {
|
||||
text: qsTr("Command")
|
||||
icon.name: "command"
|
||||
Layout.fillHeight: true
|
||||
property int myIndex: 3
|
||||
onClicked: leftTabBar.currentIndex = myIndex
|
||||
checked: leftTabBar.currentIndex == myIndex
|
||||
}
|
||||
|
||||
FeatureButton {
|
||||
text: qsTr("Settings")
|
||||
icon.name: "settings"
|
||||
Layout.fillHeight: true
|
||||
property int myIndex: 4
|
||||
onClicked: leftTabBar.currentIndex = myIndex
|
||||
checked: leftTabBar.currentIndex == myIndex
|
||||
}
|
||||
}
|
80
qml/RightButtonBar.qml
Normal file
80
qml/RightButtonBar.qml
Normal file
@@ -0,0 +1,80 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
Container {
|
||||
id: rightTabBar
|
||||
|
||||
currentIndex: 2
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
ButtonGroup {
|
||||
buttons: rightTabBarContentLayout.children
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
id: rightTabBarContentLayout
|
||||
spacing: 3
|
||||
|
||||
Repeater {
|
||||
model: rightTabBar.contentModel
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
FeatureButton {
|
||||
id: mapsButton
|
||||
text: qsTr("Maps")
|
||||
icon.name: "windows"
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
property int myIndex: 0
|
||||
onClicked: rightTabBar.currentIndex = myIndex
|
||||
checked: rightTabBar.currentIndex == myIndex
|
||||
}
|
||||
FeatureButton {
|
||||
text: qsTr("Windows")
|
||||
icon.name: "windows"
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
property int myIndex: 1
|
||||
onClicked: rightTabBar.currentIndex = myIndex
|
||||
checked: rightTabBar.currentIndex == myIndex
|
||||
}
|
||||
FeatureButton {
|
||||
text: qsTr("Air Con.")
|
||||
icon.name: "air-con"
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
property int myIndex: 2
|
||||
onClicked: rightTabBar.currentIndex = myIndex
|
||||
checked: rightTabBar.currentIndex == myIndex
|
||||
}
|
||||
FeatureButton {
|
||||
text: qsTr("Seats")
|
||||
icon.name: "seats"
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
property int myIndex: 3
|
||||
onClicked: rightTabBar.currentIndex = myIndex
|
||||
checked: rightTabBar.currentIndex == myIndex
|
||||
}
|
||||
FeatureButton {
|
||||
text: qsTr("Statistics")
|
||||
icon.name: "statistics"
|
||||
|
||||
Layout.fillHeight: true
|
||||
|
||||
property int myIndex: 4
|
||||
onClicked: rightTabBar.currentIndex = myIndex
|
||||
checked: rightTabBar.currentIndex == myIndex
|
||||
}
|
||||
}
|
104
qml/inputdemo/AutoScroller.qml
Normal file
104
qml/inputdemo/AutoScroller.qml
Normal file
@@ -0,0 +1,104 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 or (at your option) any later version
|
||||
** approved by the KDE Free Qt Foundation. The licenses are as published by
|
||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.VirtualKeyboard 2.1
|
||||
|
||||
Item {
|
||||
|
||||
property var innerFlickable
|
||||
property var outerFlickable
|
||||
property var inputItem: InputContext.priv.inputItem
|
||||
|
||||
onInputItemChanged: {
|
||||
innerFlickable = null
|
||||
outerFlickable = null
|
||||
if (inputItem !== null) {
|
||||
var parent_ = inputItem.parent
|
||||
while (parent_) {
|
||||
if (parent_.maximumFlickVelocity) {
|
||||
if (innerFlickable) {
|
||||
outerFlickable = parent_
|
||||
break
|
||||
} else {
|
||||
innerFlickable = parent_
|
||||
}
|
||||
}
|
||||
parent_ = parent_.parent
|
||||
}
|
||||
delayedLoading.restart()
|
||||
}
|
||||
}
|
||||
|
||||
function ensureVisible(flickable) {
|
||||
if (Qt.inputMethod.visible && inputItem && flickable && flickable.visible && flickable.interactive) {
|
||||
|
||||
var verticallyFlickable = (flickable.flickableDirection === Flickable.HorizontalAndVerticalFlick || flickable.flickableDirection === Flickable.VerticalFlick
|
||||
|| (flickable.flickableDirection === Flickable.AutoFlickDirection && flickable.contentHeight > flickable.height))
|
||||
var horizontallyFlickable = (flickable.flickableDirection === Flickable.HorizontalAndVerticalFlick || flickable.flickableDirection === Flickable.HorizontalFlick
|
||||
|| (flickable.flickableDirection === Flickable.AutoFlickDirection && flickable.contentWidth > flickable.width))
|
||||
|
||||
if ((!verticallyFlickable && !horizontallyFlickable) || !inputItem.hasOwnProperty("cursorRectangle"))
|
||||
return
|
||||
|
||||
var cursorRectangle = flickable.contentItem.mapFromItem(inputItem, inputItem.cursorRectangle.x, inputItem.cursorRectangle.y)
|
||||
|
||||
var oldContentY = flickable.contentY
|
||||
if (verticallyFlickable) {
|
||||
var scrollMarginVertical = (flickable && flickable.scrollMarginVertical) ? flickable.scrollMarginVertical : 10
|
||||
if (flickable.contentY >= cursorRectangle.y - scrollMarginVertical)
|
||||
flickable.contentY = Math.max(0, cursorRectangle.y - scrollMarginVertical)
|
||||
else if (flickable.contentY + flickable.height <= cursorRectangle.y + inputItem.cursorRectangle.height + scrollMarginVertical)
|
||||
flickable.contentY = Math.min(flickable.contentHeight - flickable.height, cursorRectangle.y + inputItem.cursorRectangle.height - flickable.height + scrollMarginVertical)
|
||||
}
|
||||
if (horizontallyFlickable) {
|
||||
var scrollMarginHorizontal = (flickable && flickable.scrollMarginHorizontal) ? flickable.scrollMarginHorizontal : 10
|
||||
if (flickable.contentX >= cursorRectangle.x - scrollMarginHorizontal)
|
||||
flickable.contentX = Math.max(0, cursorRectangle.x - scrollMarginHorizontal)
|
||||
else if (flickable.contentX + flickable.width <= cursorRectangle.x + inputItem.cursorRectangle.width + scrollMarginHorizontal)
|
||||
flickable.contentX = Math.min(flickable.contentWidth - flickable.width, cursorRectangle.x + inputItem.cursorRectangle.width - flickable.width + scrollMarginHorizontal)
|
||||
}
|
||||
}
|
||||
}
|
||||
Timer {
|
||||
id: delayedLoading
|
||||
interval: 10
|
||||
onTriggered: {
|
||||
ensureVisible(innerFlickable)
|
||||
ensureVisible(outerFlickable)
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
ignoreUnknownSignals: true
|
||||
target: Qt.inputMethod
|
||||
function onAnimatingChanged() { if (inputItem && !Qt.inputMethod.animating) delayedLoading.restart() }
|
||||
function onKeyboardRectangleChanged() { if (inputItem) delayedLoading.restart() }
|
||||
function onCursorRectangleChanged() { if (inputItem && inputItem.activeFocus) delayedLoading.restart() }
|
||||
}
|
||||
}
|
118
qml/inputdemo/Basic.qml
Normal file
118
qml/inputdemo/Basic.qml
Normal file
@@ -0,0 +1,118 @@
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.VirtualKeyboard 2.1
|
||||
import "."
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
color: "#F6F6F6"
|
||||
|
||||
// Only set with CONFIG+=disable-desktop.
|
||||
property bool handwritingInputPanelActive: false
|
||||
|
||||
Flickable {
|
||||
id: flickable
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
contentWidth: content.width
|
||||
contentHeight: content.height
|
||||
interactive: contentHeight > height
|
||||
flickableDirection: Flickable.VerticalFlick
|
||||
|
||||
property real scrollMarginVertical: 20
|
||||
|
||||
ScrollBar.vertical: ScrollBar {}
|
||||
|
||||
MouseArea {
|
||||
id: content
|
||||
width: flickable.width
|
||||
height: textEditors.height + 24
|
||||
|
||||
onClicked: focus = true
|
||||
|
||||
Column {
|
||||
id: textEditors
|
||||
spacing: 15
|
||||
x: 12
|
||||
y: 12
|
||||
width: parent.width - 26
|
||||
|
||||
Label {
|
||||
color: "#565758"
|
||||
text: "Tap fields to enter text"
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
font.pixelSize: 22
|
||||
}
|
||||
TextField {
|
||||
width: parent.width
|
||||
placeholderText: "One line field"
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: passwordField.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: passwordField
|
||||
width: parent.width
|
||||
echoMode: TextInput.Password
|
||||
placeholderText: "Password field"
|
||||
inputMethodHints: Qt.ImhNoAutoUppercase | Qt.ImhPreferLowercase | Qt.ImhSensitiveData | Qt.ImhNoPredictiveText
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: upperCaseField.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: upperCaseField
|
||||
width: parent.width
|
||||
placeholderText: "Upper case field"
|
||||
inputMethodHints: Qt.ImhUppercaseOnly
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: lowerCaseField.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: lowerCaseField
|
||||
width: parent.width
|
||||
placeholderText: "Lower case field"
|
||||
inputMethodHints: Qt.ImhLowercaseOnly
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: phoneNumberField.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: phoneNumberField
|
||||
validator: RegExpValidator { regExp: /^[0-9\+\-\#\*\ ]{6,}$/ }
|
||||
width: parent.width
|
||||
placeholderText: "Phone number field"
|
||||
inputMethodHints: Qt.ImhDialableCharactersOnly
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: formattedNumberField.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: formattedNumberField
|
||||
width: parent.width
|
||||
placeholderText: "Formatted number field"
|
||||
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: digitsField.focus = true
|
||||
}
|
||||
TextField {
|
||||
id: digitsField
|
||||
width: parent.width
|
||||
placeholderText: "Digits only field"
|
||||
inputMethodHints: Qt.ImhDigitsOnly
|
||||
enterKeyAction: EnterKeyAction.Next
|
||||
onAccepted: textArea.focus = true
|
||||
}
|
||||
TextArea {
|
||||
id: textArea
|
||||
width: parent.width
|
||||
placeholderText: "Multiple line field"
|
||||
height: Math.max(206, implicitHeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Hide the text fields' cursors when fullscreen handwriting is active.
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
visible: handwritingInputPanelActive
|
||||
}
|
||||
}
|
41
qml/inputdemo/FloatingButton_Active.svg
Normal file
41
qml/inputdemo/FloatingButton_Active.svg
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="390px" height="390px" viewBox="0 0 390 390" style="enable-background:new 0 0 390 390;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.3;enable-background:new ;}
|
||||
.st1{opacity:0.5;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{fill:#5CAA15;}
|
||||
.st4{fill:none;}
|
||||
</style>
|
||||
<g id="Active">
|
||||
<g>
|
||||
<circle class="st0" cx="195" cy="195" r="191"/>
|
||||
<g class="st1">
|
||||
<path class="st2" d="M195,4c105.5,0,191,85.5,191,191s-85.5,191-191,191S4,300.5,4,195S89.5,4,195,4 M195,0
|
||||
c-26.3,0-51.9,5.2-75.9,15.3c-23.2,9.8-44.1,23.9-62,41.8s-32,38.8-41.8,62C5.2,143.1,0,168.7,0,195s5.2,51.9,15.3,75.9
|
||||
c9.8,23.2,23.9,44.1,41.8,62s38.8,32,62,41.8c24,10.2,49.6,15.3,75.9,15.3s51.9-5.2,75.9-15.3c23.2-9.8,44.1-23.9,62-41.8
|
||||
s32-38.8,41.8-62c10.2-24,15.3-49.6,15.3-75.9s-5.2-51.9-15.3-75.9c-9.8-23.2-23.9-44.1-41.8-62s-38.8-32-62-41.8
|
||||
C246.9,5.2,221.3,0,195,0L195,0z"/>
|
||||
</g>
|
||||
</g>
|
||||
<circle class="st3" cx="195" cy="195" r="141"/>
|
||||
</g>
|
||||
<g id="icon">
|
||||
<g>
|
||||
<g>
|
||||
<path class="st2" d="M155.6,247.3c-10.1,0-18.9-5-23.1-13.6c-10.1-21,5.4-37.4,21.7-54.7c1.2-1.2,2.4-2.5,3.6-3.8
|
||||
c5.3-5.7,5.2-11.5,3.5-14.8c-1.8-3.4-5.5-4.9-10.2-4.2c-16.5,2.6-21.2,26.4-21.2,26.6l-11.9-2.2c0.3-1.3,6.4-32.3,31.2-36.3
|
||||
c9.8-1.6,18.5,2.4,22.7,10.4c4.7,8.9,2.6,20.1-5.3,28.6c-1.2,1.3-2.4,2.6-3.6,3.8c-16.7,17.8-25.9,28.5-19.6,41.4
|
||||
c3.3,6.8,11.1,7.6,16.9,6.3c9.2-2.1,19.8-11.1,19.7-29.5c-0.2-28.1,16.2-41.8,30.2-44.9c14.5-3.2,28.4,3.6,34.7,17
|
||||
c1.3,2.8,2.3,5.4,3.1,8.1c13.3,0.7,25.5,4.3,26,4.4l-3.4,11.5c-0.1,0-9.7-2.8-20.6-3.8c0.5,16.5-8.6,28.9-20.1,34.7
|
||||
c-11.9,6-24,3.8-28.9-5.2c-3.1-5.6-1.9-14.7,2.9-22.5c7.9-13,21.3-17.4,31.5-18.8c-0.4-1.2-0.9-2.4-1.4-3.4
|
||||
c-3.9-8.3-12.2-12.4-21.1-10.4c-9.7,2.2-21,12.1-20.8,33.1c0.2,25.5-15.6,38.1-29,41.3C160.5,247,158,247.3,155.6,247.3z
|
||||
M237.8,197.7c-14,1.5-20.6,8.5-23.4,12.9c-3.3,5.2-3.4,9.8-2.9,10.9c1.6,2.9,7.3,3,13,0.2C235.3,216.2,238.3,206.6,237.8,197.7z
|
||||
"/>
|
||||
</g>
|
||||
<rect x="118" y="144" class="st4" width="156" height="104"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
41
qml/inputdemo/FloatingButton_Available.svg
Normal file
41
qml/inputdemo/FloatingButton_Available.svg
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="390px" height="390px" viewBox="0 0 390 390" style="enable-background:new 0 0 390 390;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.3;enable-background:new ;}
|
||||
.st1{opacity:0.5;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{fill:#26282A;}
|
||||
.st4{fill:none;}
|
||||
</style>
|
||||
<g id="Available">
|
||||
<g>
|
||||
<circle class="st0" cx="195" cy="195" r="191"/>
|
||||
<g class="st1">
|
||||
<path class="st2" d="M195,4c105.5,0,191,85.5,191,191s-85.5,191-191,191S4,300.5,4,195S89.5,4,195,4 M195,0
|
||||
c-26.3,0-51.9,5.2-75.9,15.3c-23.2,9.8-44.1,23.9-62,41.8s-32,38.8-41.8,62C5.2,143.1,0,168.7,0,195s5.2,51.9,15.3,75.9
|
||||
c9.8,23.2,23.9,44.1,41.8,62s38.8,32,62,41.8c24,10.2,49.6,15.3,75.9,15.3s51.9-5.2,75.9-15.3c23.2-9.8,44.1-23.9,62-41.8
|
||||
s32-38.8,41.8-62c10.2-24,15.3-49.6,15.3-75.9s-5.2-51.9-15.3-75.9c-9.8-23.2-23.9-44.1-41.8-62s-38.8-32-62-41.8
|
||||
C246.9,5.2,221.3,0,195,0L195,0z"/>
|
||||
</g>
|
||||
</g>
|
||||
<circle class="st3" cx="195" cy="195" r="141"/>
|
||||
</g>
|
||||
<g id="icon">
|
||||
<g>
|
||||
<g>
|
||||
<path class="st2" d="M155.6,247.3c-10.1,0-18.9-5-23.1-13.6c-10.1-21,5.4-37.4,21.7-54.7c1.2-1.2,2.4-2.5,3.6-3.8
|
||||
c5.3-5.7,5.2-11.5,3.5-14.8c-1.8-3.4-5.5-4.9-10.2-4.2c-16.5,2.6-21.2,26.4-21.2,26.6l-11.9-2.2c0.3-1.3,6.4-32.3,31.2-36.3
|
||||
c9.8-1.6,18.5,2.4,22.7,10.4c4.7,8.9,2.6,20.1-5.3,28.6c-1.2,1.3-2.4,2.6-3.6,3.8c-16.7,17.8-25.9,28.5-19.6,41.4
|
||||
c3.3,6.8,11.1,7.6,16.9,6.3c9.2-2.1,19.8-11.1,19.7-29.5c-0.2-28.1,16.2-41.8,30.2-44.9c14.5-3.2,28.4,3.6,34.7,17
|
||||
c1.3,2.8,2.3,5.4,3.1,8.1c13.3,0.7,25.5,4.3,26,4.4l-3.4,11.5c-0.1,0-9.7-2.8-20.6-3.8c0.5,16.5-8.6,28.9-20.1,34.7
|
||||
c-11.9,6-24,3.8-28.9-5.2c-3.1-5.6-1.9-14.7,2.9-22.5c7.9-13,21.3-17.4,31.5-18.8c-0.4-1.2-0.9-2.4-1.4-3.4
|
||||
c-3.9-8.3-12.2-12.4-21.1-10.4c-9.7,2.2-21,12.1-20.8,33.1c0.2,25.5-15.6,38.1-29,41.3C160.5,247,158,247.3,155.6,247.3z
|
||||
M237.8,197.7c-14,1.5-20.6,8.5-23.4,12.9c-3.3,5.2-3.4,9.8-2.9,10.9c1.6,2.9,7.3,3,13,0.2C235.3,216.2,238.3,206.6,237.8,197.7z
|
||||
"/>
|
||||
</g>
|
||||
<rect x="118" y="144" class="st4" width="156" height="104"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
39
qml/inputdemo/FloatingButton_Unavailable.svg
Normal file
39
qml/inputdemo/FloatingButton_Unavailable.svg
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="390px" height="390px" viewBox="0 0 390 390" style="enable-background:new 0 0 390 390;" xml:space="preserve">
|
||||
<style type="text/css">
|
||||
.st0{opacity:0.3;enable-background:new ;}
|
||||
.st1{opacity:0.5;}
|
||||
.st2{fill:#FFFFFF;}
|
||||
.st3{fill:none;}
|
||||
</style>
|
||||
<g id="Unavailable">
|
||||
<g>
|
||||
<circle class="st0" cx="195" cy="195" r="191"/>
|
||||
<g class="st1">
|
||||
<path class="st2" d="M195,4c105.5,0,191,85.5,191,191s-85.5,191-191,191S4,300.5,4,195S89.5,4,195,4 M195,0
|
||||
c-26.3,0-51.9,5.2-75.9,15.3c-23.2,9.8-44.1,23.9-62,41.8s-32,38.8-41.8,62C5.2,143.1,0,168.7,0,195s5.2,51.9,15.3,75.9
|
||||
c9.8,23.2,23.9,44.1,41.8,62s38.8,32,62,41.8c24,10.2,49.6,15.3,75.9,15.3s51.9-5.2,75.9-15.3c23.2-9.8,44.1-23.9,62-41.8
|
||||
s32-38.8,41.8-62c10.2-24,15.3-49.6,15.3-75.9s-5.2-51.9-15.3-75.9c-9.8-23.2-23.9-44.1-41.8-62s-38.8-32-62-41.8
|
||||
C246.9,5.2,221.3,0,195,0L195,0z"/>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
<g id="icon">
|
||||
<g>
|
||||
<g>
|
||||
<path class="st2" d="M155.6,247.3c-10.1,0-18.9-5-23.1-13.6c-10.1-21,5.4-37.4,21.7-54.7c1.2-1.2,2.4-2.5,3.6-3.8
|
||||
c5.3-5.7,5.2-11.5,3.5-14.8c-1.8-3.4-5.5-4.9-10.2-4.2c-16.5,2.6-21.2,26.4-21.2,26.6l-11.9-2.2c0.3-1.3,6.4-32.3,31.2-36.3
|
||||
c9.8-1.6,18.5,2.4,22.7,10.4c4.7,8.9,2.6,20.1-5.3,28.6c-1.2,1.3-2.4,2.6-3.6,3.8c-16.7,17.8-25.9,28.5-19.6,41.4
|
||||
c3.3,6.8,11.1,7.6,16.9,6.3c9.2-2.1,19.8-11.1,19.7-29.5c-0.2-28.1,16.2-41.8,30.2-44.9c14.5-3.2,28.4,3.6,34.7,17
|
||||
c1.3,2.8,2.3,5.4,3.1,8.1c13.3,0.7,25.5,4.3,26,4.4l-3.4,11.5c-0.1,0-9.7-2.8-20.6-3.8c0.5,16.5-8.6,28.9-20.1,34.7
|
||||
c-11.9,6-24,3.8-28.9-5.2c-3.1-5.6-1.9-14.7,2.9-22.5c7.9-13,21.3-17.4,31.5-18.8c-0.4-1.2-0.9-2.4-1.4-3.4
|
||||
c-3.9-8.3-12.2-12.4-21.1-10.4c-9.7,2.2-21,12.1-20.8,33.1c0.2,25.5-15.6,38.1-29,41.3C160.5,247,158,247.3,155.6,247.3z
|
||||
M237.8,197.7c-14,1.5-20.6,8.5-23.4,12.9c-3.3,5.2-3.4,9.8-2.9,10.9c1.6,2.9,7.3,3,13,0.2C235.3,216.2,238.3,206.6,237.8,197.7z
|
||||
"/>
|
||||
</g>
|
||||
<rect x="118" y="144" class="st3" width="156" height="104"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
165
qml/inputdemo/HandwritingModeButton.qml
Normal file
165
qml/inputdemo/HandwritingModeButton.qml
Normal file
@@ -0,0 +1,165 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2016 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 or (at your option) any later version
|
||||
** approved by the KDE Free Qt Foundation. The licenses are as published by
|
||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
|
||||
Item {
|
||||
id: handwritingModeButton
|
||||
state: "unavailable"
|
||||
property bool floating
|
||||
property bool flipable
|
||||
readonly property real __minWidthHeight: Math.min(width, height)
|
||||
|
||||
signal clicked()
|
||||
signal doubleClicked()
|
||||
|
||||
Flipable {
|
||||
id: flipableImage
|
||||
anchors.fill: parent
|
||||
|
||||
property bool flipped
|
||||
|
||||
front: Image {
|
||||
sourceSize.width: handwritingModeButton.__minWidthHeight
|
||||
sourceSize.height: handwritingModeButton.__minWidthHeight
|
||||
smooth: false
|
||||
source: "qrc:/content/FloatingButton_Unavailable.svg"
|
||||
}
|
||||
|
||||
back: Image {
|
||||
id: buttonImage
|
||||
sourceSize.width: handwritingModeButton.__minWidthHeight
|
||||
sourceSize.height: handwritingModeButton.__minWidthHeight
|
||||
smooth: false
|
||||
source: "qrc:/content/FloatingButton_Available.svg"
|
||||
}
|
||||
|
||||
states: State {
|
||||
PropertyChanges { target: rotation; angle: 180 }
|
||||
when: flipableImage.flipped
|
||||
}
|
||||
|
||||
transform: Rotation {
|
||||
id: rotation
|
||||
origin.x: flipableImage.width / 2
|
||||
origin.y: flipableImage.height / 2
|
||||
axis { x: 0; y: 1; z: 0 }
|
||||
angle: 0
|
||||
}
|
||||
|
||||
transitions: Transition {
|
||||
enabled: handwritingModeButton.flipable
|
||||
NumberAnimation { target: rotation; property: "angle"; duration: 400 }
|
||||
}
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "available"
|
||||
PropertyChanges { target: flipableImage; flipped: true }
|
||||
},
|
||||
State {
|
||||
name: "active"
|
||||
PropertyChanges { target: flipableImage; flipped: true }
|
||||
PropertyChanges { target: buttonImage; source: "qrc:/content/FloatingButton_Active.svg" }
|
||||
}
|
||||
]
|
||||
|
||||
function snapHorizontal() {
|
||||
if (!floating)
|
||||
return
|
||||
if (mouseArea.drag.maximumX > mouseArea.drag.minimumX) {
|
||||
if (x + 20 >= mouseArea.drag.maximumX) {
|
||||
anchors.left = undefined
|
||||
anchors.right = parent.right
|
||||
} else if (x - 20 <= mouseArea.drag.minimumX) {
|
||||
anchors.right = undefined
|
||||
anchors.left = parent.left
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function snapVertical() {
|
||||
if (!floating)
|
||||
return
|
||||
if (mouseArea.drag.maximumY > mouseArea.drag.minimumY) {
|
||||
if (y + 20 >= mouseArea.drag.maximumY) {
|
||||
anchors.top = undefined
|
||||
anchors.bottom = parent.bottom
|
||||
} else if (y - 20 <= mouseArea.drag.minimumY) {
|
||||
anchors.bottom = undefined
|
||||
anchors.top = parent.top
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
drag {
|
||||
target: handwritingModeButton.floating ? handwritingModeButton : undefined
|
||||
axis: Drag.XAxis | Drag.YAxis
|
||||
minimumX: 0
|
||||
maximumX: handwritingModeButton.parent.width - handwritingModeButton.width
|
||||
onMaximumXChanged: !mouseArea.drag.active && handwritingModeButton.snapHorizontal()
|
||||
minimumY: 0
|
||||
maximumY: handwritingModeButton.parent.height - handwritingModeButton.height
|
||||
onMaximumYChanged: !mouseArea.drag.active && handwritingModeButton.snapVertical()
|
||||
}
|
||||
onPressed: {
|
||||
if (!handwritingModeButton.floating)
|
||||
return
|
||||
handwritingModeButton.anchors.left = undefined
|
||||
handwritingModeButton.anchors.top = undefined
|
||||
handwritingModeButton.anchors.right = undefined
|
||||
handwritingModeButton.anchors.bottom = undefined
|
||||
}
|
||||
onReleased: {
|
||||
handwritingModeButton.snapHorizontal()
|
||||
handwritingModeButton.snapVertical()
|
||||
}
|
||||
onClicked: {
|
||||
handwritingModeButton.snapHorizontal()
|
||||
handwritingModeButton.snapVertical()
|
||||
clickTimer.restart()
|
||||
}
|
||||
onDoubleClicked: {
|
||||
clickTimer.stop()
|
||||
handwritingModeButton.snapHorizontal()
|
||||
handwritingModeButton.snapVertical()
|
||||
handwritingModeButton.doubleClicked()
|
||||
}
|
||||
Timer {
|
||||
id: clickTimer
|
||||
interval: Qt.styleHints ? Qt.styleHints.mouseDoubleClickInterval / 3 : 0
|
||||
repeat: false
|
||||
onTriggered: handwritingModeButton.clicked()
|
||||
}
|
||||
}
|
||||
}
|
144
qml/inputdemo/InputDemo.qml
Normal file
144
qml/inputdemo/InputDemo.qml
Normal file
@@ -0,0 +1,144 @@
|
||||
import QtQuick 2.0
|
||||
import QtQml 2.11
|
||||
import QtQuick.Window 2.2
|
||||
import QtQuick.VirtualKeyboard 2.2
|
||||
import QtQuick.VirtualKeyboard.Settings 2.2
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 0
|
||||
|
||||
id: appContainer
|
||||
anchors.centerIn: parent
|
||||
|
||||
Basic {
|
||||
id: virtualKeyboard
|
||||
anchors.left: parent.left
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
handwritingInputPanelActive: handwritingInputPanel.available && handwritingInputPanel.active
|
||||
}
|
||||
|
||||
/* Handwriting input panel for full screen handwriting input.
|
||||
|
||||
This component is an optional add-on for the InputPanel component, that
|
||||
is, its use does not affect the operation of the InputPanel component,
|
||||
but it also can not be used as a standalone component.
|
||||
|
||||
The handwriting input panel is positioned to cover the entire area of
|
||||
application. The panel itself is transparent, but once it is active the
|
||||
user can draw handwriting on it.
|
||||
*/
|
||||
HandwritingInputPanel {
|
||||
z: 79
|
||||
id: handwritingInputPanel
|
||||
anchors.fill: parent
|
||||
inputPanel: inputPanel
|
||||
Rectangle {
|
||||
z: -1
|
||||
anchors.fill: parent
|
||||
color: "black"
|
||||
opacity: 0.10
|
||||
}
|
||||
}
|
||||
|
||||
/* Container area for the handwriting mode button.
|
||||
|
||||
Handwriting mode button can be moved freely within the container area.
|
||||
In this example, a single click changes the handwriting mode and a
|
||||
double-click changes the availability of the full screen handwriting input.
|
||||
*/
|
||||
Item {
|
||||
z: 99
|
||||
visible: handwritingInputPanel.enabled && Qt.inputMethod.visible
|
||||
anchors { left: parent.left; top: parent.top; right: parent.right; bottom: inputPanel.top; }
|
||||
HandwritingModeButton {
|
||||
id: handwritingModeButton
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.margins: 10
|
||||
floating: true
|
||||
flipable: true
|
||||
width: 76
|
||||
height: width
|
||||
state: handwritingInputPanel.state
|
||||
onClicked: handwritingInputPanel.active = !handwritingInputPanel.active
|
||||
onDoubleClicked: handwritingInputPanel.available = !handwritingInputPanel.available
|
||||
}
|
||||
}
|
||||
|
||||
/* Keyboard input panel.
|
||||
|
||||
The keyboard is anchored to the bottom of the application.
|
||||
*/
|
||||
InputPanel {
|
||||
id: inputPanel
|
||||
z: 89
|
||||
y: yPositionWhenHidden
|
||||
x: Screen.orientation === Qt.LandscapeOrientation ? 0 : (parent.width-parent.height) / 2
|
||||
width: Screen.orientation === Qt.LandscapeOrientation ? parent.width : parent.height
|
||||
|
||||
keyboard.shadowInputControl.height: (Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width) - keyboard.height
|
||||
|
||||
property real yPositionWhenHidden: Screen.orientation === Qt.LandscapeOrientation ? parent.height : parent.width + (parent.height-parent.width) / 2
|
||||
|
||||
states: State {
|
||||
name: "visible"
|
||||
/* The visibility of the InputPanel can be bound to the Qt.inputMethod.visible property,
|
||||
but then the handwriting input panel and the keyboard input panel can be visible
|
||||
at the same time. Here the visibility is bound to InputPanel.active property instead,
|
||||
which allows the handwriting panel to control the visibility when necessary.
|
||||
*/
|
||||
when: inputPanel.active
|
||||
PropertyChanges {
|
||||
target: inputPanel
|
||||
y: inputPanel.yPositionWhenHidden - inputPanel.height
|
||||
}
|
||||
}
|
||||
transitions: Transition {
|
||||
id: inputPanelTransition
|
||||
from: ""
|
||||
to: "visible"
|
||||
reversible: true
|
||||
enabled: !VirtualKeyboardSettings.fullScreenMode
|
||||
ParallelAnimation {
|
||||
NumberAnimation {
|
||||
properties: "y"
|
||||
duration: 250
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
}
|
||||
Binding {
|
||||
target: InputContext
|
||||
property: "animating"
|
||||
value: inputPanelTransition.running
|
||||
//restoreMode: Binding.RestoreBinding
|
||||
}
|
||||
AutoScroller {}
|
||||
}
|
||||
|
||||
Binding {
|
||||
target: VirtualKeyboardSettings
|
||||
property: "fullScreenMode"
|
||||
value: appContainer.height > 0 && (appContainer.width / appContainer.height) > (16.0 / 9.0)
|
||||
//restoreMode: Binding.RestoreBinding
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
property bool inLandscapeOrientation: Screen.orientation === Qt.LandscapeOrientation
|
||||
|
||||
Screen.orientationUpdateMask: Qt.LandscapeOrientation | Qt.PortraitOrientation
|
||||
|
||||
Binding {
|
||||
target: appContainer.Window.window !== null ? appContainer.Window.window.contentItem : null
|
||||
property: "rotation"
|
||||
value: inLandscapeOrientation ? 0 : 90
|
||||
}
|
||||
}
|
53
qml/inputdemo/TextArea.qml
Normal file
53
qml/inputdemo/TextArea.qml
Normal file
@@ -0,0 +1,53 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 or (at your option) any later version
|
||||
** approved by the KDE Free Qt Foundation. The licenses are as published by
|
||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3 as Controls
|
||||
import QtQuick.VirtualKeyboard 2.3
|
||||
|
||||
Controls.TextArea {
|
||||
id: control
|
||||
color: "#2B2C2E"
|
||||
selectionColor: Qt.rgba(0.0, 0.0, 0.0, 0.15)
|
||||
selectedTextColor: color
|
||||
selectByMouse: true
|
||||
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||
|
||||
property int enterKeyAction: EnterKeyAction.None
|
||||
readonly property bool enterKeyEnabled: enterKeyAction === EnterKeyAction.None || text.length > 0 || inputMethodComposing
|
||||
|
||||
EnterKeyAction.actionId: control.enterKeyAction
|
||||
EnterKeyAction.enabled: control.enterKeyEnabled
|
||||
|
||||
background: Rectangle {
|
||||
color: "#FFFFFF"
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "#5CAA15" : "#BDBEBF"
|
||||
}
|
||||
}
|
53
qml/inputdemo/TextField.qml
Normal file
53
qml/inputdemo/TextField.qml
Normal file
@@ -0,0 +1,53 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Virtual Keyboard module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:GPL$
|
||||
** 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 The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3 or (at your option) any later version
|
||||
** approved by the KDE Free Qt Foundation. The licenses are as published by
|
||||
** the Free Software Foundation and appearing in the file LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.10
|
||||
import QtQuick.Controls 2.3 as Controls
|
||||
import QtQuick.VirtualKeyboard 2.3
|
||||
|
||||
Controls.TextField {
|
||||
id: control
|
||||
color: "#2B2C2E"
|
||||
selectionColor: Qt.rgba(0.0, 0.0, 0.0, 0.15)
|
||||
selectedTextColor: color
|
||||
selectByMouse: true
|
||||
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||
|
||||
property int enterKeyAction: EnterKeyAction.None
|
||||
readonly property bool enterKeyEnabled: enterKeyAction === EnterKeyAction.None || acceptableInput || inputMethodComposing
|
||||
|
||||
EnterKeyAction.actionId: control.enterKeyAction
|
||||
EnterKeyAction.enabled: control.enterKeyEnabled
|
||||
|
||||
background: Rectangle {
|
||||
color: "#FFFFFF"
|
||||
border.width: 1
|
||||
border.color: control.activeFocus ? "#5CAA15" : "#BDBEBF"
|
||||
}
|
||||
}
|
10
qml/leftPanes/CommandPane.qml
Normal file
10
qml/leftPanes/CommandPane.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Label {
|
||||
text: 'Command'
|
||||
}
|
||||
}
|
27
qml/leftPanes/MessagePane.qml
Normal file
27
qml/leftPanes/MessagePane.qml
Normal file
@@ -0,0 +1,27 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import QtLocation 5.6
|
||||
import QtPositioning 5.6
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Plugin {
|
||||
id: mapPlugin
|
||||
name: "osm"
|
||||
// name: "mapboxgl"
|
||||
// name: "esri"
|
||||
// specify plugin parameters if necessary
|
||||
// PluginParameter {
|
||||
// name:
|
||||
// value:
|
||||
// }
|
||||
}
|
||||
|
||||
Map {
|
||||
anchors.fill: parent
|
||||
plugin: mapPlugin
|
||||
center: QtPositioning.coordinate(47.0582267, 15.4460315)
|
||||
zoomLevel: 14
|
||||
}
|
||||
}
|
198
qml/leftPanes/MusicPane.qml
Normal file
198
qml/leftPanes/MusicPane.qml
Normal file
@@ -0,0 +1,198 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 16
|
||||
|
||||
ButtonGroup {
|
||||
id: viewButtonGroup
|
||||
buttons: viewTypeRowLayout.children
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: viewTypeRowLayout
|
||||
spacing: 3
|
||||
|
||||
Layout.bottomMargin: 12
|
||||
|
||||
Button {
|
||||
text: qsTr("Compact")
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
checked: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Button {
|
||||
text: qsTr("Full")
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
checkable: true
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
GlowingLabel {
|
||||
text: qsTr("VOLUME")
|
||||
color: "white"
|
||||
font.pixelSize: fontSizeMedium
|
||||
}
|
||||
|
||||
Dial {
|
||||
id: volumeDial
|
||||
from: 0
|
||||
value: 42
|
||||
to: 100
|
||||
stepSize: 1
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.minimumWidth: 64
|
||||
Layout.minimumHeight: 64
|
||||
Layout.preferredWidth: 128
|
||||
Layout.preferredHeight: 128
|
||||
Layout.maximumWidth: 128
|
||||
Layout.maximumHeight: 128
|
||||
Layout.fillHeight: true
|
||||
|
||||
Label {
|
||||
text: volumeDial.value.toFixed(0)
|
||||
color: "white"
|
||||
font.pixelSize: Qt.application.font.pixelSize * 3
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
ButtonGroup {
|
||||
id: audioSourceButtonGroup
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.topMargin: 16
|
||||
|
||||
GlowingLabel {
|
||||
id: radioOption
|
||||
text: qsTr("RADIO")
|
||||
color: "white"
|
||||
font.pixelSize: fontSizeMedium
|
||||
horizontalAlignment: Label.AlignLeft
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
GlowingLabel {
|
||||
text: qsTr("AUX")
|
||||
color: colorLightGrey
|
||||
font.pixelSize: fontSizeMedium * 0.8
|
||||
horizontalAlignment: Label.AlignHCenter
|
||||
glowEnabled: false
|
||||
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
GlowingLabel {
|
||||
text: qsTr("MP3")
|
||||
color: colorDarkGrey
|
||||
font.pixelSize: fontSizeMedium * 0.6
|
||||
horizontalAlignment: Label.AlignRight
|
||||
glowEnabled: false
|
||||
|
||||
Layout.alignment: Qt.AlignBottom
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Frame {
|
||||
id: stationFrame
|
||||
leftPadding: 1
|
||||
rightPadding: 1
|
||||
topPadding: 1
|
||||
bottomPadding: 1
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredHeight: 128
|
||||
|
||||
ListView {
|
||||
clip: true
|
||||
anchors.fill: parent
|
||||
|
||||
ScrollIndicator.vertical: ScrollIndicator {
|
||||
parent: stationFrame
|
||||
anchors.top: parent.top
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 1
|
||||
anchors.bottom: parent.bottom
|
||||
}
|
||||
|
||||
model: ListModel {
|
||||
ListElement { name: "V-Radio"; frequency: "105.5 MHz" }
|
||||
ListElement { name: "World News"; frequency: "93.4 MHz" }
|
||||
ListElement { name: "TekStep FM"; frequency: "95.0 MHz" }
|
||||
ListElement { name: "Classic Radio"; frequency: "89.9 MHz" }
|
||||
ListElement { name: "Buena Vista FM"; frequency: "100.8 MHz" }
|
||||
ListElement { name: "Drive-by Radio"; frequency: "99.1 MHz" }
|
||||
ListElement { name: "Unknown #1"; frequency: "104.5 MHz" }
|
||||
ListElement { name: "Unknown #2"; frequency: "91.2 MHz" }
|
||||
ListElement { name: "Unknown #3"; frequency: "93.8 MHz" }
|
||||
ListElement { name: "Unknown #4"; frequency: "80.4 MHz" }
|
||||
ListElement { name: "Unknown #5"; frequency: "101.1 MHz" }
|
||||
ListElement { name: "Unknown #6"; frequency: "92.2 MHz" }
|
||||
}
|
||||
delegate: ItemDelegate {
|
||||
id: stationDelegate
|
||||
width: parent.width
|
||||
height: 22
|
||||
text: model.name
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
contentItem: RowLayout {
|
||||
Label {
|
||||
text: model.name
|
||||
font: stationDelegate.font
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Label {
|
||||
text: model.frequency
|
||||
font: stationDelegate.font
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Frame {
|
||||
Layout.fillWidth: true
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Label {
|
||||
text: qsTr("Sort by")
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
RadioButton {
|
||||
text: qsTr("Name")
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
}
|
||||
RadioButton {
|
||||
text: qsTr("Frequency")
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
}
|
||||
RadioButton {
|
||||
text: qsTr("Favourites")
|
||||
font.pixelSize: fontSizeExtraSmall
|
||||
checked: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
27
qml/leftPanes/NavigationPane.qml
Normal file
27
qml/leftPanes/NavigationPane.qml
Normal file
@@ -0,0 +1,27 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import QtLocation 5.6
|
||||
import QtPositioning 5.6
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Plugin {
|
||||
id: mapPlugin
|
||||
// name: "osm"
|
||||
// name: "mapboxgl"
|
||||
name: "esri"
|
||||
// specify plugin parameters if necessary
|
||||
// PluginParameter {
|
||||
// name:
|
||||
// value:
|
||||
// }
|
||||
}
|
||||
|
||||
Map {
|
||||
anchors.fill: parent
|
||||
plugin: mapPlugin
|
||||
center: QtPositioning.coordinate(47.0582267, 15.4460315)
|
||||
zoomLevel: 14
|
||||
}
|
||||
}
|
10
qml/leftPanes/SettingsPane.qml
Normal file
10
qml/leftPanes/SettingsPane.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Label {
|
||||
text: 'Settings'
|
||||
}
|
||||
}
|
5
qml/main-dev.qml
Normal file
5
qml/main-dev.qml
Normal file
@@ -0,0 +1,5 @@
|
||||
import QtQuick 2.9
|
||||
|
||||
BobbycarMainWindow {
|
||||
visible: true
|
||||
}
|
9
qml/main-raspberry.qml
Normal file
9
qml/main-raspberry.qml
Normal file
@@ -0,0 +1,9 @@
|
||||
import QtQuick 2.9
|
||||
|
||||
BobbycarMainWindow {
|
||||
id: window
|
||||
|
||||
Component.onCompleted: {
|
||||
window.showFullScreen();
|
||||
}
|
||||
}
|
32
qml/qml.qrc
Normal file
32
qml/qml.qrc
Normal file
@@ -0,0 +1,32 @@
|
||||
<RCC>
|
||||
<qresource prefix="/qml">
|
||||
<file>FeatureButton.qml</file>
|
||||
<file>GlowingLabel.qml</file>
|
||||
<file>CustomGlow.qml</file>
|
||||
<file>BobbycarMainWindow.qml</file>
|
||||
<file>main-dev.qml</file>
|
||||
<file>main-raspberry.qml</file>
|
||||
<file>CenterPane.qml</file>
|
||||
<file>leftPanes/CommandPane.qml</file>
|
||||
<file>leftPanes/MessagePane.qml</file>
|
||||
<file>leftPanes/MusicPane.qml</file>
|
||||
<file>leftPanes/NavigationPane.qml</file>
|
||||
<file>leftPanes/SettingsPane.qml</file>
|
||||
<file>rightPanes/AirCondPane.qml</file>
|
||||
<file>rightPanes/SeatsPane.qml</file>
|
||||
<file>rightPanes/StatisticsPane.qml</file>
|
||||
<file>rightPanes/StatusPane.qml</file>
|
||||
<file>rightPanes/WindowsPane.qml</file>
|
||||
<file>LeftButtonBar.qml</file>
|
||||
<file>RightButtonBar.qml</file>
|
||||
<file>inputdemo/AutoScroller.qml</file>
|
||||
<file>inputdemo/FloatingButton_Active.svg</file>
|
||||
<file>inputdemo/FloatingButton_Available.svg</file>
|
||||
<file>inputdemo/FloatingButton_Unavailable.svg</file>
|
||||
<file>inputdemo/HandwritingModeButton.qml</file>
|
||||
<file>inputdemo/InputDemo.qml</file>
|
||||
<file>inputdemo/TextArea.qml</file>
|
||||
<file>inputdemo/TextField.qml</file>
|
||||
<file>inputdemo/Basic.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
159
qml/rightPanes/AirCondPane.qml
Normal file
159
qml/rightPanes/AirCondPane.qml
Normal file
@@ -0,0 +1,159 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
ColumnLayout {
|
||||
Row {
|
||||
spacing: 8
|
||||
|
||||
Image {
|
||||
source: "qrc:/icons/weather.png"
|
||||
}
|
||||
|
||||
Column {
|
||||
spacing: 8
|
||||
|
||||
Row {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
GlowingLabel {
|
||||
id: outsideTempValueLabel
|
||||
text: qsTr("31")
|
||||
font.pixelSize: fontSizeLarge
|
||||
}
|
||||
|
||||
GlowingLabel {
|
||||
text: qsTr("°C")
|
||||
font.pixelSize: Qt.application.font.pixelSize * 2.5
|
||||
anchors.baseline: outsideTempValueLabel.baseline
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr("Graz")
|
||||
color: colorLightGrey
|
||||
font.pixelSize: fontSizeMedium
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: airConRowLayout
|
||||
spacing: 8
|
||||
|
||||
Layout.preferredWidth: 32
|
||||
Layout.preferredHeight: 380
|
||||
Layout.fillHeight: true
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
SwitchDelegate {
|
||||
text: qsTr("AC")
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// QTBUG-63269
|
||||
Item {
|
||||
implicitHeight: temperatureValueLabel.implicitHeight
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
Label {
|
||||
text: qsTr("Temperature")
|
||||
anchors.baseline: temperatureValueLabel.bottom
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
GlowingLabel {
|
||||
id: temperatureValueLabel
|
||||
text: qsTr("24°C")
|
||||
font.pixelSize: fontSizeLarge
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
|
||||
Slider {
|
||||
value: 0.35
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
// QTBUG-63269
|
||||
Item {
|
||||
implicitHeight: powerValueLabel.implicitHeight
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
|
||||
Label {
|
||||
text: qsTr("Power")
|
||||
anchors.baseline: powerValueLabel.bottom
|
||||
anchors.left: parent.left
|
||||
}
|
||||
|
||||
GlowingLabel {
|
||||
id: powerValueLabel
|
||||
text: qsTr("10%")
|
||||
font.pixelSize: fontSizeLarge
|
||||
anchors.right: parent.right
|
||||
}
|
||||
}
|
||||
|
||||
Slider {
|
||||
value: 0.25
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
SwitchDelegate {
|
||||
text: qsTr("Low")
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 16
|
||||
}
|
||||
|
||||
SwitchDelegate {
|
||||
text: qsTr("High")
|
||||
checked: true
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
SwitchDelegate {
|
||||
text: qsTr("Defog")
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
SwitchDelegate {
|
||||
text: qsTr("Recirculate")
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
topPadding: 0
|
||||
bottomPadding: 0
|
||||
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
}
|
10
qml/rightPanes/SeatsPane.qml
Normal file
10
qml/rightPanes/SeatsPane.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Label {
|
||||
text: 'Seats'
|
||||
}
|
||||
}
|
10
qml/rightPanes/StatisticsPane.qml
Normal file
10
qml/rightPanes/StatisticsPane.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Label {
|
||||
text: 'Statistics'
|
||||
}
|
||||
}
|
10
qml/rightPanes/StatusPane.qml
Normal file
10
qml/rightPanes/StatusPane.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Label {
|
||||
text: 'Status'
|
||||
}
|
||||
}
|
10
qml/rightPanes/WindowsPane.qml
Normal file
10
qml/rightPanes/WindowsPane.qml
Normal file
@@ -0,0 +1,10 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Controls 2.3
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
Label {
|
||||
text: 'Window'
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user