docs: 添加涉密文件自检工具实施计划
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Window 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.ApplicationWindow {
|
||||
id: window
|
||||
|
||||
color: Material.backgroundColor
|
||||
|
||||
overlay.modal: Rectangle {
|
||||
color: window.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
|
||||
overlay.modeless: Rectangle {
|
||||
color: window.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
/*
|
||||
A implementation of CSS's box-shadow, used by ElevationEffect for a Material Design
|
||||
elevation shadow effect.
|
||||
*/
|
||||
RectangularGlow {
|
||||
// The 4 properties from CSS box-shadow, plus the inherited color property
|
||||
property int offsetX
|
||||
property int offsetY
|
||||
property int blurRadius
|
||||
property int spreadRadius
|
||||
|
||||
// The source item the shadow is being applied to, used for correctly
|
||||
// calculating the corner radious
|
||||
property Item source
|
||||
|
||||
property bool fullWidth
|
||||
property bool fullHeight
|
||||
|
||||
x: (parent.width - width)/2 + offsetX
|
||||
y: (parent.height - height)/2 + offsetY
|
||||
|
||||
implicitWidth: source ? source.width : parent.width
|
||||
implicitHeight: source ? source.height : parent.height
|
||||
|
||||
width: implicitWidth + 2 * spreadRadius + (fullWidth ? 2 * cornerRadius : 0)
|
||||
height: implicitHeight + 2 * spreadRadius + (fullHeight ? 2 * cornerRadius : 0)
|
||||
glowRadius: blurRadius/2
|
||||
spread: 0.05
|
||||
cornerRadius: blurRadius + (source && source.radius || 0)
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.BusyIndicator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
|
||||
contentItem: BusyIndicatorImpl {
|
||||
implicitWidth: control.Material.touchTarget
|
||||
implicitHeight: control.Material.touchTarget
|
||||
color: control.Material.accentColor
|
||||
|
||||
running: control.running
|
||||
opacity: control.running ? 1 : 0
|
||||
Behavior on opacity { OpacityAnimator { duration: 250 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Button {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topInset: 6
|
||||
bottomInset: 6
|
||||
padding: 12
|
||||
horizontalPadding: padding - 4
|
||||
spacing: 6
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: !enabled ? Material.hintTextColor :
|
||||
flat && highlighted ? Material.accentColor :
|
||||
highlighted ? Material.primaryHighlightedTextColor : Material.foreground
|
||||
|
||||
Material.elevation: flat ? control.down || control.hovered ? 2 : 0
|
||||
: control.down ? 8 : 2
|
||||
Material.background: flat ? "transparent" : undefined
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: !control.enabled ? control.Material.hintTextColor :
|
||||
control.flat && control.highlighted ? control.Material.accentColor :
|
||||
control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.foreground
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 64
|
||||
implicitHeight: control.Material.buttonHeight
|
||||
|
||||
radius: 2
|
||||
color: !control.enabled ? control.Material.buttonDisabledColor :
|
||||
control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor
|
||||
|
||||
PaddedRectangle {
|
||||
y: parent.height - 4
|
||||
width: parent.width
|
||||
height: 4
|
||||
radius: 2
|
||||
topPadding: -2
|
||||
clip: true
|
||||
visible: control.checkable && (!control.highlighted || control.flat)
|
||||
color: control.checked && control.enabled ? control.Material.accentColor : control.Material.secondaryTextColor
|
||||
}
|
||||
|
||||
// The layer is disabled when the button color is transparent so you can do
|
||||
// Material.background: "transparent" and get a proper flat button without needing
|
||||
// to set Material.elevation as well
|
||||
layer.enabled: control.enabled && control.Material.buttonColor.a > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
|
||||
Ripple {
|
||||
clipRadius: 2
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.flat && control.highlighted ? control.Material.highlightedRippleColor : control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.CheckBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 8
|
||||
padding: 8
|
||||
verticalPadding: padding + 7
|
||||
|
||||
indicator: CheckIndicator {
|
||||
x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
|
||||
Ripple {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 28; height: 28
|
||||
|
||||
z: -1
|
||||
anchor: control
|
||||
pressed: control.pressed
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.CheckDelegate {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: 8
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
indicator: CheckIndicator {
|
||||
x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
}
|
||||
|
||||
contentItem: IconLabel {
|
||||
leftPadding: !control.mirrored ? 0 : control.indicator.width + control.spacing
|
||||
rightPadding: control.mirrored ? 0 : control.indicator.width + control.spacing
|
||||
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.highlighted ? control.Material.listHighlightColor : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
Rectangle {
|
||||
id: indicatorItem
|
||||
implicitWidth: 18
|
||||
implicitHeight: 18
|
||||
color: "transparent"
|
||||
border.color: !control.enabled ? control.Material.hintTextColor
|
||||
: checkState !== Qt.Unchecked ? control.Material.accentColor : control.Material.secondaryTextColor
|
||||
border.width: checkState !== Qt.Unchecked ? width / 2 : 2
|
||||
radius: 2
|
||||
|
||||
property Item control
|
||||
property int checkState: control.checkState
|
||||
|
||||
Behavior on border.width {
|
||||
NumberAnimation {
|
||||
duration: 100
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on border.color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: This needs to be transparent
|
||||
Image {
|
||||
id: checkImage
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 14
|
||||
height: 14
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/check.png"
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
scale: indicatorItem.checkState === Qt.Checked ? 1 : 0
|
||||
Behavior on scale { NumberAnimation { duration: 100 } }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 12
|
||||
height: 3
|
||||
|
||||
scale: indicatorItem.checkState === Qt.PartiallyChecked ? 1 : 0
|
||||
Behavior on scale { NumberAnimation { duration: 100 } }
|
||||
}
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "checked"
|
||||
when: indicatorItem.checkState === Qt.Checked
|
||||
},
|
||||
State {
|
||||
name: "partiallychecked"
|
||||
when: indicatorItem.checkState === Qt.PartiallyChecked
|
||||
}
|
||||
]
|
||||
|
||||
transitions: Transition {
|
||||
SequentialAnimation {
|
||||
NumberAnimation {
|
||||
target: indicatorItem
|
||||
property: "scale"
|
||||
// Go down 2 pixels in size.
|
||||
to: 1 - 2 / indicatorItem.width
|
||||
duration: 120
|
||||
}
|
||||
NumberAnimation {
|
||||
target: indicatorItem
|
||||
property: "scale"
|
||||
to: 1
|
||||
duration: 120
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Window 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Controls.impl 2.15
|
||||
import QtQuick.Templates 2.15 as T
|
||||
import QtQuick.Controls.Material 2.15
|
||||
import QtQuick.Controls.Material.impl 2.15
|
||||
|
||||
T.ComboBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
topInset: 6
|
||||
bottomInset: 6
|
||||
|
||||
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
|
||||
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
|
||||
|
||||
Material.elevation: flat ? control.pressed || control.hovered ? 2 : 0
|
||||
: control.pressed ? 8 : 2
|
||||
Material.background: flat ? "transparent" : undefined
|
||||
Material.foreground: flat ? undefined : Material.primaryTextColor
|
||||
|
||||
delegate: MenuItem {
|
||||
width: ListView.view.width
|
||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
|
||||
Material.foreground: control.currentIndex === index ? ListView.view.contentItem.Material.accent : ListView.view.contentItem.Material.foreground
|
||||
highlighted: control.highlightedIndex === index
|
||||
hoverEnabled: control.hoverEnabled
|
||||
}
|
||||
|
||||
indicator: ColorImage {
|
||||
x: control.mirrored ? control.padding : control.width - width - control.padding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/drop-indicator.png"
|
||||
}
|
||||
|
||||
contentItem: T.TextField {
|
||||
padding: 6
|
||||
leftPadding: control.editable ? 2 : control.mirrored ? 0 : 12
|
||||
rightPadding: control.editable ? 2 : control.mirrored ? 12 : 0
|
||||
|
||||
text: control.editable ? control.editText : control.displayText
|
||||
|
||||
enabled: control.editable
|
||||
autoScroll: control.editable
|
||||
readOnly: control.down
|
||||
inputMethodHints: control.inputMethodHints
|
||||
validator: control.validator
|
||||
selectByMouse: control.selectTextByMouse
|
||||
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
selectionColor: control.Material.accentColor
|
||||
selectedTextColor: control.Material.primaryHighlightedTextColor
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
cursorDelegate: CursorDelegate { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 120
|
||||
implicitHeight: control.Material.buttonHeight
|
||||
|
||||
radius: control.flat ? 0 : 2
|
||||
color: !control.editable ? control.Material.dialogColor : "transparent"
|
||||
|
||||
layer.enabled: control.enabled && !control.editable && control.Material.background.a > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: control.editable
|
||||
y: parent.y + control.baselineOffset
|
||||
width: parent.width
|
||||
height: control.activeFocus ? 2 : 1
|
||||
color: control.editable && control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
Ripple {
|
||||
clip: control.flat
|
||||
clipRadius: control.flat ? 0 : 2
|
||||
x: control.editable && control.indicator ? control.indicator.x : 0
|
||||
width: control.editable && control.indicator ? control.indicator.width : parent.width
|
||||
height: parent.height
|
||||
pressed: control.pressed
|
||||
anchor: control.editable && control.indicator ? control.indicator : control
|
||||
active: control.pressed || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
|
||||
popup: T.Popup {
|
||||
y: control.editable ? control.height - 5 : 0
|
||||
width: control.width
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
|
||||
transformOrigin: Item.Top
|
||||
topMargin: 12
|
||||
bottomMargin: 12
|
||||
|
||||
Material.theme: control.Material.theme
|
||||
Material.accent: control.Material.accent
|
||||
Material.primary: control.Material.primary
|
||||
|
||||
enter: Transition {
|
||||
// grow_fade_in
|
||||
NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
// shrink_fade_out
|
||||
NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
clip: true
|
||||
implicitHeight: contentHeight
|
||||
model: control.delegateModel
|
||||
currentIndex: control.highlightedIndex
|
||||
highlightMoveDuration: 0
|
||||
|
||||
T.ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
color: parent.Material.dialogColor
|
||||
|
||||
layer.enabled: control.enabled
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: 8
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
Rectangle {
|
||||
id: cursor
|
||||
|
||||
color: parent.Material.accentColor
|
||||
width: 2
|
||||
visible: parent.activeFocus && !parent.readOnly && parent.selectionStart === parent.selectionEnd
|
||||
|
||||
Connections {
|
||||
target: cursor.parent
|
||||
function onCursorPositionChanged() {
|
||||
// keep a moving cursor visible
|
||||
cursor.opacity = 1
|
||||
timer.restart()
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: timer
|
||||
running: cursor.parent.activeFocus && !cursor.parent.readOnly && interval != 0
|
||||
repeat: true
|
||||
interval: Qt.styleHints.cursorFlashTime / 2
|
||||
onTriggered: cursor.opacity = !cursor.opacity ? 1 : 0
|
||||
// force the cursor visible when gaining focus
|
||||
onRunningChanged: cursor.opacity = 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.DelayButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topInset: 6
|
||||
bottomInset: 6
|
||||
padding: 12
|
||||
horizontalPadding: padding - 4
|
||||
|
||||
Material.elevation: control.down ? 8 : 2
|
||||
|
||||
transition: Transition {
|
||||
NumberAnimation {
|
||||
duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress)
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: !control.enabled ? control.Material.hintTextColor : control.Material.foreground
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
// TODO: Add a proper ripple/ink effect for mouse/touch input and focus state
|
||||
background: Rectangle {
|
||||
implicitWidth: 64
|
||||
implicitHeight: control.Material.buttonHeight
|
||||
|
||||
radius: 2
|
||||
color: !control.enabled ? control.Material.buttonDisabledColor : control.Material.buttonColor
|
||||
|
||||
PaddedRectangle {
|
||||
y: parent.height - 4
|
||||
width: parent.width
|
||||
height: 4
|
||||
radius: 2
|
||||
topPadding: -2
|
||||
clip: true
|
||||
color: control.checked && control.enabled ? control.Material.accentColor : control.Material.secondaryTextColor
|
||||
|
||||
PaddedRectangle {
|
||||
width: parent.width * control.progress
|
||||
height: 4
|
||||
radius: 2
|
||||
topPadding: -2
|
||||
rightPadding: Math.max(-2, width - parent.width)
|
||||
clip: true
|
||||
color: control.Material.accentColor
|
||||
}
|
||||
}
|
||||
|
||||
layer.enabled: control.enabled && control.Material.buttonColor.a > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
|
||||
Ripple {
|
||||
clipRadius: 2
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Dial {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding) || 100 // ### remove 100 in Qt 6
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding) || 100 // ### remove 100 in Qt 6
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 100
|
||||
|
||||
x: control.width / 2 - width / 2
|
||||
y: control.height / 2 - height / 2
|
||||
width: Math.max(64, Math.min(control.width, control.height))
|
||||
height: width
|
||||
color: "transparent"
|
||||
radius: width / 2
|
||||
|
||||
border.color: control.enabled ? control.Material.accentColor : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
handle: SliderHandle {
|
||||
x: control.background.x + control.background.width / 2 - control.handle.width / 2
|
||||
y: control.background.y + control.background.height / 2 - control.handle.height / 2
|
||||
transform: [
|
||||
Translate {
|
||||
y: -control.background.height * 0.4 + control.handle.height / 2
|
||||
},
|
||||
Rotation {
|
||||
angle: control.angle
|
||||
origin.x: control.handle.width / 2
|
||||
origin.y: control.handle.height / 2
|
||||
}
|
||||
]
|
||||
implicitWidth: 10
|
||||
implicitHeight: 10
|
||||
|
||||
value: control.value
|
||||
handleHasFocus: control.visualFocus
|
||||
handlePressed: control.pressed
|
||||
handleHovered: control.hovered
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Dialog {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 24
|
||||
topPadding: 20
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
enter: Transition {
|
||||
// grow_fade_in
|
||||
NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
// shrink_fade_out
|
||||
NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
visible: control.title
|
||||
elide: Label.ElideRight
|
||||
padding: 24
|
||||
bottomPadding: 0
|
||||
// TODO: QPlatformTheme::TitleBarFont
|
||||
font.bold: true
|
||||
font.pixelSize: 16
|
||||
background: PaddedRectangle {
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
bottomPadding: -2
|
||||
clip: true
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
visible: count > 0
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.DialogButtonBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 8
|
||||
padding: 8
|
||||
verticalPadding: 2
|
||||
alignment: Qt.AlignRight
|
||||
buttonLayout: T.DialogButtonBox.AndroidLayout
|
||||
|
||||
Material.foreground: Material.accent
|
||||
|
||||
delegate: Button { flat: true }
|
||||
|
||||
contentItem: ListView {
|
||||
model: control.contentModel
|
||||
spacing: control.spacing
|
||||
orientation: ListView.Horizontal
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
snapMode: ListView.SnapToItem
|
||||
}
|
||||
|
||||
background: PaddedRectangle {
|
||||
implicitHeight: control.Material.dialogButtonBoxHeight
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
// Rounded corners should be only at the top or at the bottom
|
||||
topPadding: control.position === T.DialogButtonBox.Footer ? -2 : 0
|
||||
bottomPadding: control.position === T.DialogButtonBox.Header ? -2 : 0
|
||||
clip: true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Drawer {
|
||||
id: control
|
||||
|
||||
parent: T.Overlay.overlay
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: !dim && edge === Qt.BottomEdge && Material.elevation === 0
|
||||
leftPadding: !dim && edge === Qt.RightEdge && Material.elevation === 0
|
||||
rightPadding: !dim && edge === Qt.LeftEdge && Material.elevation === 0
|
||||
bottomPadding: !dim && edge === Qt.TopEdge && Material.elevation === 0
|
||||
|
||||
enter: Transition { SmoothedAnimation { velocity: 5 } }
|
||||
exit: Transition { SmoothedAnimation { velocity: 5 } }
|
||||
|
||||
Material.elevation: !interactive && !dim ? 0 : 16
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Material.dialogColor
|
||||
|
||||
Rectangle {
|
||||
readonly property bool horizontal: control.edge === Qt.LeftEdge || control.edge === Qt.RightEdge
|
||||
width: horizontal ? 1 : parent.width
|
||||
height: horizontal ? parent.height : 1
|
||||
color: control.Material.dividerColor
|
||||
x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0
|
||||
y: control.edge === Qt.TopEdge ? parent.height - 1 : 0
|
||||
visible: !control.dim && control.Material.elevation === 0
|
||||
}
|
||||
|
||||
layer.enabled: control.position > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
fullHeight: true
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,279 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
/*
|
||||
An effect for standard Material Design elevation shadows. Useful for using as \c layer.effect.
|
||||
*/
|
||||
Item {
|
||||
id: effect
|
||||
|
||||
/*
|
||||
The source the effect is applied to.
|
||||
*/
|
||||
property var source
|
||||
|
||||
/*
|
||||
The elevation of the \l source Item.
|
||||
*/
|
||||
property int elevation: 0
|
||||
|
||||
/*
|
||||
Set to \c true if the \l source Item is the same width as its parent and the shadow
|
||||
should be full width instead of rounding around the corner of the Item.
|
||||
|
||||
\sa fullHeight
|
||||
*/
|
||||
property bool fullWidth: false
|
||||
|
||||
/*
|
||||
Set to \c true if the \l source Item is the same height as its parent and the shadow
|
||||
should be full height instead of rounding around the corner of the Item.
|
||||
|
||||
\sa fullWidth
|
||||
*/
|
||||
property bool fullHeight: false
|
||||
|
||||
/*
|
||||
\internal
|
||||
|
||||
The actual source Item the effect is applied to.
|
||||
*/
|
||||
readonly property Item sourceItem: source.sourceItem
|
||||
|
||||
/*
|
||||
* The following shadow values are taken from Angular Material
|
||||
*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2014-2016 Google, Inc. http://angularjs.org
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
/*
|
||||
\internal
|
||||
|
||||
The shadows to use for each possible elevation. There are three shadows that when combined
|
||||
make up the elevation.
|
||||
*/
|
||||
readonly property var _shadows: [
|
||||
[{offset: 0, blur: 0, spread: 0},
|
||||
{offset: 0, blur: 0, spread: 0},
|
||||
{offset: 0, blur: 0, spread: 0}],
|
||||
|
||||
[{offset: 1, blur: 3, spread: 0},
|
||||
{offset: 1, blur: 1, spread: 0},
|
||||
{offset: 2, blur: 1, spread: -1}],
|
||||
|
||||
[{offset: 1, blur: 5, spread: 0},
|
||||
{offset: 2, blur: 2, spread: 0},
|
||||
{offset: 3, blur: 1, spread: -2}],
|
||||
|
||||
[{offset: 1, blur: 8, spread: 0},
|
||||
{offset: 3, blur: 4, spread: 0},
|
||||
{offset: 3, blur: 3, spread: -2}],
|
||||
|
||||
[{offset: 2, blur: 4, spread: -1},
|
||||
{offset: 4, blur: 5, spread: 0},
|
||||
{offset: 1, blur: 10, spread: 0}],
|
||||
|
||||
[{offset: 3, blur: 5, spread: -1},
|
||||
{offset: 5, blur: 8, spread: 0},
|
||||
{offset: 1, blur: 14, spread: 0}],
|
||||
|
||||
[{offset: 3, blur: 5, spread: -1},
|
||||
{offset: 6, blur: 10, spread: 0},
|
||||
{offset: 1, blur: 18, spread: 0}],
|
||||
|
||||
[{offset: 4, blur: 5, spread: -2},
|
||||
{offset: 7, blur: 10, spread: 1},
|
||||
{offset: 2, blur: 16, spread: 1}],
|
||||
|
||||
[{offset: 5, blur: 5, spread: -3},
|
||||
{offset: 8, blur: 10, spread: 1},
|
||||
{offset: 3, blur: 14, spread: 2}],
|
||||
|
||||
[{offset: 5, blur: 6, spread: -3},
|
||||
{offset: 9, blur: 12, spread: 1},
|
||||
{offset: 3, blur: 16, spread: 2}],
|
||||
|
||||
[{offset: 6, blur: 6, spread: -3},
|
||||
{offset: 10, blur: 14, spread: 1},
|
||||
{offset: 4, blur: 18, spread: 3}],
|
||||
|
||||
[{offset: 6, blur: 7, spread: -4},
|
||||
{offset: 11, blur: 15, spread: 1},
|
||||
{offset: 4, blur: 20, spread: 3}],
|
||||
|
||||
[{offset: 7, blur: 8, spread: -4},
|
||||
{offset: 12, blur: 17, spread: 2},
|
||||
{offset: 5, blur: 22, spread: 4}],
|
||||
|
||||
[{offset: 7, blur: 8, spread: -4},
|
||||
{offset: 13, blur: 19, spread: 2},
|
||||
{offset: 5, blur: 24, spread: 4}],
|
||||
|
||||
[{offset: 7, blur: 9, spread: -4},
|
||||
{offset: 14, blur: 21, spread: 2},
|
||||
{offset: 5, blur: 26, spread: 4}],
|
||||
|
||||
[{offset: 8, blur: 9, spread: -5},
|
||||
{offset: 15, blur: 22, spread: 2},
|
||||
{offset: 6, blur: 28, spread: 5}],
|
||||
|
||||
[{offset: 8, blur: 10, spread: -5},
|
||||
{offset: 16, blur: 24, spread: 2},
|
||||
{offset: 6, blur: 30, spread: 5}],
|
||||
|
||||
[{offset: 8, blur: 11, spread: -5},
|
||||
{offset: 17, blur: 26, spread: 2},
|
||||
{offset: 6, blur: 32, spread: 5}],
|
||||
|
||||
[{offset: 9, blur: 11, spread: -5},
|
||||
{offset: 18, blur: 28, spread: 2},
|
||||
{offset: 7, blur: 34, spread: 6}],
|
||||
|
||||
[{offset: 9, blur: 12, spread: -6},
|
||||
{offset: 19, blur: 29, spread: 2},
|
||||
{offset: 7, blur: 36, spread: 6}],
|
||||
|
||||
[{offset: 10, blur: 13, spread: -6},
|
||||
{offset: 20, blur: 31, spread: 3},
|
||||
{offset: 8, blur: 38, spread: 7}],
|
||||
|
||||
[{offset: 10, blur: 13, spread: -6},
|
||||
{offset: 21, blur: 33, spread: 3},
|
||||
{offset: 8, blur: 40, spread: 7}],
|
||||
|
||||
[{offset: 10, blur: 14, spread: -6},
|
||||
{offset: 22, blur: 35, spread: 3},
|
||||
{offset: 8, blur: 42, spread: 7}],
|
||||
|
||||
[{offset: 11, blur: 14, spread: -7},
|
||||
{offset: 23, blur: 36, spread: 3},
|
||||
{offset: 9, blur: 44, spread: 8}],
|
||||
|
||||
[{offset: 11, blur: 15, spread: -7},
|
||||
{offset: 24, blur: 38, spread: 3},
|
||||
{offset: 9, blur: 46, spread: 8}]
|
||||
]
|
||||
|
||||
/*
|
||||
\internal
|
||||
|
||||
The current shadow based on the elevation.
|
||||
*/
|
||||
readonly property var _shadow: _shadows[Math.max(0, Math.min(elevation, _shadows.length - 1))]
|
||||
|
||||
// Nest the shadows and source view in two items rendered as a layer
|
||||
// so the shadow is not clipped by the bounds of the source view
|
||||
Item {
|
||||
property int margin: -100
|
||||
|
||||
x: margin
|
||||
y: margin
|
||||
width: parent.width - 2 * margin
|
||||
height: parent.height - 2 * margin
|
||||
|
||||
// By rendering as a layer, the shadow will never show through the source item,
|
||||
// even when the source item's opacity is less than 1
|
||||
layer.enabled: true
|
||||
|
||||
// The box shadows automatically pick up the size of the source Item and not
|
||||
// the size of the parent, so we don't need to worry about the extra padding
|
||||
// in the parent Item
|
||||
BoxShadow {
|
||||
offsetY: effect._shadow[0].offset
|
||||
blurRadius: effect._shadow[0].blur
|
||||
spreadRadius: effect._shadow[0].spread
|
||||
color: Qt.rgba(0,0,0, 0.2)
|
||||
|
||||
fullWidth: effect.fullWidth
|
||||
fullHeight: effect.fullHeight
|
||||
source: effect.sourceItem
|
||||
}
|
||||
|
||||
BoxShadow {
|
||||
offsetY: effect._shadow[1].offset
|
||||
blurRadius: effect._shadow[1].blur
|
||||
spreadRadius: effect._shadow[1].spread
|
||||
color: Qt.rgba(0,0,0, 0.14)
|
||||
|
||||
fullWidth: effect.fullWidth
|
||||
fullHeight: effect.fullHeight
|
||||
source: effect.sourceItem
|
||||
}
|
||||
|
||||
BoxShadow {
|
||||
offsetY: effect._shadow[2].offset
|
||||
blurRadius: effect._shadow[2].blur
|
||||
spreadRadius: effect._shadow[2].spread
|
||||
color: Qt.rgba(0,0,0, 0.12)
|
||||
|
||||
fullWidth: effect.fullWidth
|
||||
fullHeight: effect.fullHeight
|
||||
source: effect.sourceItem
|
||||
}
|
||||
|
||||
ShaderEffect {
|
||||
property alias source: effect.source
|
||||
|
||||
x: (parent.width - width)/2
|
||||
y: (parent.height - height)/2
|
||||
width: effect.sourceItem.width
|
||||
height: effect.sourceItem.height
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Frame {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
verticalPadding: Material.frameVerticalPadding
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
color: control.Material.elevation > 0 ? control.Material.backgroundColor : "transparent"
|
||||
border.color: control.Material.frameColor
|
||||
|
||||
layer.enabled: control.enabled && control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.GroupBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding,
|
||||
implicitLabelWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 6
|
||||
padding: 12
|
||||
topPadding: Material.frameVerticalPadding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
|
||||
bottomPadding: Material.frameVerticalPadding
|
||||
|
||||
label: Text {
|
||||
x: control.leftPadding
|
||||
width: control.availableWidth
|
||||
|
||||
text: control.title
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
y: control.topPadding - control.bottomPadding
|
||||
width: parent.width
|
||||
height: parent.height - control.topPadding + control.bottomPadding
|
||||
|
||||
radius: 2
|
||||
color: control.Material.elevation > 0 ? control.Material.backgroundColor : "transparent"
|
||||
border.color: control.Material.frameColor
|
||||
|
||||
layer.enabled: control.enabled && control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Templates 2.15 as T
|
||||
import QtQuick.Controls.Material 2.15
|
||||
import QtQuick.Controls.Material.impl 2.15
|
||||
|
||||
T.HorizontalHeaderView {
|
||||
id: control
|
||||
|
||||
implicitWidth: syncView ? syncView.width : 0
|
||||
implicitHeight: contentHeight
|
||||
|
||||
delegate: Rectangle {
|
||||
// Qt6: add cellPadding (and font etc) as public API in headerview
|
||||
readonly property real cellPadding: 8
|
||||
|
||||
implicitWidth: text.implicitWidth + (cellPadding * 2)
|
||||
implicitHeight: Math.max(control.height, text.implicitHeight + (cellPadding * 2))
|
||||
color: control.Material.backgroundColor
|
||||
|
||||
Text {
|
||||
id: text
|
||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole]
|
||||
: model[control.textRole])
|
||||
: modelData
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.ItemDelegate {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: 8
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.highlighted ? control.Material.listHighlightColor : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.Label {
|
||||
id: control
|
||||
|
||||
color: enabled ? Material.foreground : Material.hintTextColor
|
||||
linkColor: Material.accentColor
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
import QtQuick.Window 2.12
|
||||
|
||||
T.Menu {
|
||||
id: control
|
||||
|
||||
Material.elevation: 8
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
margins: 0
|
||||
verticalPadding: 8
|
||||
|
||||
transformOrigin: !cascade ? Item.Top : (mirrored ? Item.TopRight : Item.TopLeft)
|
||||
|
||||
delegate: MenuItem { }
|
||||
|
||||
enter: Transition {
|
||||
// grow_fade_in
|
||||
NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
// shrink_fade_out
|
||||
NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight
|
||||
|
||||
model: control.contentModel
|
||||
interactive: Window.window
|
||||
? contentHeight + control.topPadding + control.bottomPadding > Window.window.height
|
||||
: false
|
||||
clip: true
|
||||
currentIndex: control.currentIndex
|
||||
|
||||
ScrollIndicator.vertical: ScrollIndicator {}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: control.Material.menuItemHeight
|
||||
|
||||
radius: 3
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.MenuBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
delegate: MenuBarItem { }
|
||||
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
Repeater {
|
||||
model: control.contentModel
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 40
|
||||
color: control.Material.dialogColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.MenuBarItem {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: 12
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
color: control.highlighted ? control.Material.listHighlightColor : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.highlighted
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.MenuItem {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: Material.menuItemVerticalPadding
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
indicator: CheckIndicator {
|
||||
x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
visible: control.checkable
|
||||
control: control
|
||||
checkState: control.checked ? Qt.Checked : Qt.Unchecked
|
||||
}
|
||||
|
||||
arrow: ColorImage {
|
||||
x: control.mirrored ? control.padding : control.width - width - control.padding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
visible: control.subMenu
|
||||
mirror: control.mirrored
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/images/arrow-indicator.png"
|
||||
}
|
||||
|
||||
contentItem: IconLabel {
|
||||
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
|
||||
readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
|
||||
leftPadding: !control.mirrored ? indicatorPadding : arrowPadding
|
||||
rightPadding: control.mirrored ? indicatorPadding : arrowPadding
|
||||
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: control.Material.menuItemHeight
|
||||
color: control.highlighted ? control.Material.listHighlightColor : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.highlighted
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.MenuSeparator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
verticalPadding: 8
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 1
|
||||
color: control.Material.dividerColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.Page {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Material.backgroundColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.PageIndicator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
spacing: 6
|
||||
|
||||
delegate: Rectangle {
|
||||
implicitWidth: 8
|
||||
implicitHeight: 8
|
||||
|
||||
radius: width / 2
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
|
||||
opacity: index === currentIndex ? 0.95 : pressed ? 0.7 : 0.45
|
||||
Behavior on opacity { OpacityAnimator { duration: 100 } }
|
||||
}
|
||||
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
|
||||
Repeater {
|
||||
model: control.count
|
||||
delegate: control.delegate
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Pane {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Material.backgroundColor
|
||||
radius: control.Material.elevation > 0 ? 2 : 0
|
||||
|
||||
layer.enabled: control.enabled && control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Popup {
|
||||
id: control
|
||||
|
||||
Material.elevation: 24
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
|
||||
enter: Transition {
|
||||
// grow_fade_in
|
||||
NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
// shrink_fade_out
|
||||
NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: 2
|
||||
color: control.Material.dialogColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: control.Material.backgroundDimColor
|
||||
Behavior on opacity { NumberAnimation { duration: 150 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.ProgressBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentItem: ProgressBarImpl {
|
||||
implicitHeight: 4
|
||||
|
||||
scale: control.mirrored ? -1 : 1
|
||||
color: control.Material.accentColor
|
||||
progress: control.position
|
||||
indeterminate: control.visible && control.indeterminate
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 4
|
||||
y: (control.height - height) / 2
|
||||
height: 4
|
||||
|
||||
color: Qt.rgba(control.Material.accentColor.r, control.Material.accentColor.g, control.Material.accentColor.b, 0.25)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.RadioButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 8
|
||||
padding: 8
|
||||
verticalPadding: padding + 6
|
||||
|
||||
indicator: RadioIndicator {
|
||||
x: control.text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
|
||||
Ripple {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 28; height: 28
|
||||
|
||||
z: -1
|
||||
anchor: control
|
||||
pressed: control.pressed
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.RadioDelegate {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: 8
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
indicator: RadioIndicator {
|
||||
x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
}
|
||||
|
||||
contentItem: IconLabel {
|
||||
leftPadding: !control.mirrored ? 0 : control.indicator.width + control.spacing
|
||||
rightPadding: control.mirrored ? 0 : control.indicator.width + control.spacing
|
||||
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.highlighted ? control.Material.listHighlightColor : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
Rectangle {
|
||||
id: indicator
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
radius: width / 2
|
||||
border.width: 2
|
||||
border.color: !control.enabled ? control.Material.hintTextColor
|
||||
: control.checked || control.down ? control.Material.accentColor : control.Material.secondaryTextColor
|
||||
color: "transparent"
|
||||
|
||||
property Item control
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 10
|
||||
height: 10
|
||||
radius: width / 2
|
||||
color: parent.border.color
|
||||
visible: indicator.control.checked || indicator.control.down
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.RangeSlider {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
first.implicitHandleWidth + leftPadding + rightPadding,
|
||||
second.implicitHandleWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
first.implicitHandleHeight + topPadding + bottomPadding,
|
||||
second.implicitHandleHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
|
||||
first.handle: SliderHandle {
|
||||
x: control.leftPadding + (control.horizontal ? control.first.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.first.visualPosition * (control.availableHeight - height))
|
||||
value: first.value
|
||||
handleHasFocus: activeFocus
|
||||
handlePressed: first.pressed
|
||||
handleHovered: first.hovered
|
||||
}
|
||||
|
||||
second.handle: SliderHandle {
|
||||
x: control.leftPadding + (control.horizontal ? control.second.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.second.visualPosition * (control.availableHeight - height))
|
||||
value: second.value
|
||||
handleHasFocus: activeFocus
|
||||
handlePressed: second.pressed
|
||||
handleHovered: second.hovered
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0)
|
||||
implicitWidth: control.horizontal ? 200 : 48
|
||||
implicitHeight: control.horizontal ? 48 : 200
|
||||
width: control.horizontal ? control.availableWidth : 4
|
||||
height: control.horizontal ? 4 : control.availableHeight
|
||||
scale: control.horizontal && control.mirrored ? -1 : 1
|
||||
color: control.enabled ? Color.transparent(control.Material.accentColor, 0.33) : control.Material.sliderDisabledColor
|
||||
|
||||
Rectangle {
|
||||
x: control.horizontal ? control.first.position * parent.width : 0
|
||||
y: control.horizontal ? 0 : control.second.visualPosition * parent.height
|
||||
width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width : 4
|
||||
height: control.horizontal ? 4 : control.second.position * parent.height - control.first.position * parent.height
|
||||
|
||||
color: control.enabled ? control.Material.accentColor : control.Material.sliderDisabledColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,240 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
|
||||
/*
|
||||
A cross-graphics API implementation of QtGraphicalEffects' RectangularGlow.
|
||||
*/
|
||||
Item {
|
||||
id: rootItem
|
||||
|
||||
/*
|
||||
This property defines how many pixels outside the item area are reached
|
||||
by the glow.
|
||||
|
||||
The value ranges from 0.0 (no glow) to inf (infinite glow). By default,
|
||||
the property is set to \c 0.0.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Output examples with different glowRadius values
|
||||
\li
|
||||
\li
|
||||
\row
|
||||
\li \image RectangularGlow_glowRadius1.png
|
||||
\li \image RectangularGlow_glowRadius2.png
|
||||
\li \image RectangularGlow_glowRadius3.png
|
||||
\row
|
||||
\li \b { glowRadius: 10 }
|
||||
\li \b { glowRadius: 20 }
|
||||
\li \b { glowRadius: 40 }
|
||||
\row
|
||||
\li \l spread: 0
|
||||
\li \l spread: 0
|
||||
\li \l spread: 0
|
||||
\row
|
||||
\li \l color: #ffffff
|
||||
\li \l color: #ffffff
|
||||
\li \l color: #ffffff
|
||||
\row
|
||||
\li \l cornerRadius: 25
|
||||
\li \l cornerRadius: 25
|
||||
\li \l cornerRadius: 25
|
||||
\endtable
|
||||
|
||||
*/
|
||||
property real glowRadius: 0.0
|
||||
|
||||
/*
|
||||
This property defines how large part of the glow color is strenghtened
|
||||
near the source edges.
|
||||
|
||||
The value ranges from 0.0 (no strenght increase) to 1.0 (maximum
|
||||
strenght increase). By default, the property is set to \c 0.0.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Output examples with different spread values
|
||||
\li
|
||||
\li
|
||||
\row
|
||||
\li \image RectangularGlow_spread1.png
|
||||
\li \image RectangularGlow_spread2.png
|
||||
\li \image RectangularGlow_spread3.png
|
||||
\row
|
||||
\li \b { spread: 0.0 }
|
||||
\li \b { spread: 0.5 }
|
||||
\li \b { spread: 1.0 }
|
||||
\row
|
||||
\li \l glowRadius: 20
|
||||
\li \l glowRadius: 20
|
||||
\li \l glowRadius: 20
|
||||
\row
|
||||
\li \l color: #ffffff
|
||||
\li \l color: #ffffff
|
||||
\li \l color: #ffffff
|
||||
\row
|
||||
\li \l cornerRadius: 25
|
||||
\li \l cornerRadius: 25
|
||||
\li \l cornerRadius: 25
|
||||
\endtable
|
||||
*/
|
||||
property real spread: 0.0
|
||||
|
||||
/*
|
||||
This property defines the RGBA color value which is used for the glow.
|
||||
|
||||
By default, the property is set to \c "white".
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Output examples with different color values
|
||||
\li
|
||||
\li
|
||||
\row
|
||||
\li \image RectangularGlow_color1.png
|
||||
\li \image RectangularGlow_color2.png
|
||||
\li \image RectangularGlow_color3.png
|
||||
\row
|
||||
\li \b { color: #ffffff }
|
||||
\li \b { color: #55ff55 }
|
||||
\li \b { color: #5555ff }
|
||||
\row
|
||||
\li \l glowRadius: 20
|
||||
\li \l glowRadius: 20
|
||||
\li \l glowRadius: 20
|
||||
\row
|
||||
\li \l spread: 0
|
||||
\li \l spread: 0
|
||||
\li \l spread: 0
|
||||
\row
|
||||
\li \l cornerRadius: 25
|
||||
\li \l cornerRadius: 25
|
||||
\li \l cornerRadius: 25
|
||||
\endtable
|
||||
*/
|
||||
property color color: "white"
|
||||
|
||||
/*
|
||||
This property defines the corner radius that is used to draw a glow with
|
||||
rounded corners.
|
||||
|
||||
The value ranges from 0.0 to half of the effective width or height of
|
||||
the glow, whichever is smaller. This can be calculated with: \c{
|
||||
min(width, height) / 2.0 + glowRadius}
|
||||
|
||||
By default, the property is bound to glowRadius property. The glow
|
||||
behaves as if the rectangle was blurred when adjusting the glowRadius
|
||||
property.
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Output examples with different cornerRadius values
|
||||
\li
|
||||
\li
|
||||
\row
|
||||
\li \image RectangularGlow_cornerRadius1.png
|
||||
\li \image RectangularGlow_cornerRadius2.png
|
||||
\li \image RectangularGlow_cornerRadius3.png
|
||||
\row
|
||||
\li \b { cornerRadius: 0 }
|
||||
\li \b { cornerRadius: 25 }
|
||||
\li \b { cornerRadius: 50 }
|
||||
\row
|
||||
\li \l glowRadius: 20
|
||||
\li \l glowRadius: 20
|
||||
\li \l glowRadius: 20
|
||||
\row
|
||||
\li \l spread: 0
|
||||
\li \l spread: 0
|
||||
\li \l spread: 0
|
||||
\row
|
||||
\li \l color: #ffffff
|
||||
\li \l color: #ffffff
|
||||
\li \l color: #ffffff
|
||||
\endtable
|
||||
*/
|
||||
property real cornerRadius: glowRadius
|
||||
|
||||
/*
|
||||
This property allows the effect output pixels to be cached in order to
|
||||
improve the rendering performance.
|
||||
|
||||
Every time the source or effect properties are changed, the pixels in
|
||||
the cache must be updated. Memory consumption is increased, because an
|
||||
extra buffer of memory is required for storing the effect output.
|
||||
|
||||
It is recommended to disable the cache when the source or the effect
|
||||
properties are animated.
|
||||
|
||||
By default, the property is set to \c false.
|
||||
*/
|
||||
property bool cached: false
|
||||
|
||||
ShaderEffectSource {
|
||||
id: cacheItem
|
||||
anchors.fill: shaderItem
|
||||
visible: rootItem.cached
|
||||
smooth: true
|
||||
sourceItem: shaderItem
|
||||
live: true
|
||||
hideSource: visible
|
||||
}
|
||||
|
||||
ShaderEffect {
|
||||
id: shaderItem
|
||||
|
||||
x: (parent.width - width) / 2.0
|
||||
y: (parent.height - height) / 2.0
|
||||
width: parent.width + rootItem.glowRadius * 2 + cornerRadius * 2
|
||||
height: parent.height + rootItem.glowRadius * 2 + cornerRadius * 2
|
||||
|
||||
function clampedCornerRadius() {
|
||||
var maxCornerRadius = Math.min(rootItem.width, rootItem.height) / 2 + rootItem.glowRadius;
|
||||
return Math.max(0, Math.min(rootItem.cornerRadius, maxCornerRadius))
|
||||
}
|
||||
|
||||
property color color: rootItem.color
|
||||
property real inverseSpread: 1.0 - rootItem.spread
|
||||
property real relativeSizeX: ((inverseSpread * inverseSpread) * rootItem.glowRadius + cornerRadius * 2.0) / width
|
||||
property real relativeSizeY: relativeSizeX * (width / height)
|
||||
property real spread: rootItem.spread / 2.0
|
||||
property real cornerRadius: clampedCornerRadius()
|
||||
|
||||
fragmentShader: "qrc:/qt-project.org/imports/QtQuick/Controls.2/Material/shaders/RectangularGlow.frag"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.RoundButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topInset: 6
|
||||
leftInset: 6
|
||||
rightInset: 6
|
||||
bottomInset: 6
|
||||
padding: 12
|
||||
spacing: 6
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: !enabled ? Material.hintTextColor :
|
||||
flat && highlighted ? Material.accentColor :
|
||||
highlighted ? Material.primaryHighlightedTextColor : Material.foreground
|
||||
|
||||
Material.elevation: flat ? control.down || control.hovered ? 2 : 0
|
||||
: control.down ? 12 : 6
|
||||
Material.background: flat ? "transparent" : undefined
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: !control.enabled ? control.Material.hintTextColor :
|
||||
control.flat && control.highlighted ? control.Material.accentColor :
|
||||
control.highlighted ? control.Material.primaryHighlightedTextColor : control.Material.foreground
|
||||
}
|
||||
|
||||
// TODO: Add a proper ripple/ink effect for mouse/touch input and focus state
|
||||
background: Rectangle {
|
||||
implicitWidth: control.Material.buttonHeight
|
||||
implicitHeight: control.Material.buttonHeight
|
||||
|
||||
radius: control.radius
|
||||
color: !control.enabled ? control.Material.buttonDisabledColor
|
||||
: control.checked || control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
radius: control.radius
|
||||
visible: control.hovered || control.visualFocus
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
radius: control.radius
|
||||
visible: control.down
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
|
||||
// The layer is disabled when the button color is transparent so that you can do
|
||||
// Material.background: "transparent" and get a proper flat button without needing
|
||||
// to set Material.elevation as well
|
||||
layer.enabled: control.enabled && control.Material.buttonColor.a > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.ScrollBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: control.interactive ? 1 : 2
|
||||
visible: control.policy !== T.ScrollBar.AlwaysOff
|
||||
minimumSize: orientation == Qt.Horizontal ? height / width : width / height
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: control.interactive ? 13 : 4
|
||||
implicitHeight: control.interactive ? 13 : 4
|
||||
|
||||
color: control.pressed ? control.Material.scrollBarPressedColor :
|
||||
control.interactive && control.hovered ? control.Material.scrollBarHoveredColor : control.Material.scrollBarColor
|
||||
opacity: 0.0
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: control.interactive ? 16 : 4
|
||||
implicitHeight: control.interactive ? 16 : 4
|
||||
color: "#0e000000"
|
||||
opacity: 0.0
|
||||
visible: control.interactive
|
||||
}
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
|
||||
}
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
to: "active"
|
||||
NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 1.0 }
|
||||
},
|
||||
Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PropertyAction{ targets: [control.contentItem, control.background]; property: "opacity"; value: 1.0 }
|
||||
PauseAnimation { duration: 2450 }
|
||||
NumberAnimation { targets: [control.contentItem, control.background]; property: "opacity"; to: 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.ScrollIndicator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 2
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 4
|
||||
implicitHeight: 4
|
||||
|
||||
color: control.Material.scrollBarColor
|
||||
visible: control.size < 1.0
|
||||
opacity: 0.0
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: control.active
|
||||
PropertyChanges { target: control.contentItem; opacity: 0.75 }
|
||||
}
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 450 }
|
||||
NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.Slider {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitHandleWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitHandleHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
|
||||
handle: SliderHandle {
|
||||
x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
|
||||
value: control.value
|
||||
handleHasFocus: control.visualFocus
|
||||
handlePressed: control.pressed
|
||||
handleHovered: control.hovered
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2)
|
||||
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0)
|
||||
implicitWidth: control.horizontal ? 200 : 48
|
||||
implicitHeight: control.horizontal ? 48 : 200
|
||||
width: control.horizontal ? control.availableWidth : 4
|
||||
height: control.horizontal ? 4 : control.availableHeight
|
||||
scale: control.horizontal && control.mirrored ? -1 : 1
|
||||
color: control.enabled ? Color.transparent(control.Material.accentColor, 0.33) : control.Material.sliderDisabledColor
|
||||
|
||||
Rectangle {
|
||||
x: control.horizontal ? 0 : (parent.width - width) / 2
|
||||
y: control.horizontal ? (parent.height - height) / 2 : control.visualPosition * parent.height
|
||||
width: control.horizontal ? control.position * parent.width : 4
|
||||
height: control.horizontal ? 4 : control.position * parent.height
|
||||
|
||||
color: control.enabled ? control.Material.accentColor : control.Material.sliderDisabledColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: initialSize
|
||||
implicitHeight: initialSize
|
||||
|
||||
property real value: 0
|
||||
property bool handleHasFocus: false
|
||||
property bool handlePressed: false
|
||||
property bool handleHovered: false
|
||||
readonly property int initialSize: 13
|
||||
readonly property var control: parent
|
||||
|
||||
Rectangle {
|
||||
id: handleRect
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
radius: width / 2
|
||||
scale: root.handlePressed ? 1.5 : 1
|
||||
color: control.enabled ? root.control.Material.accentColor : root.control.Material.sliderDisabledColor
|
||||
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: 250
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ripple {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 22; height: 22
|
||||
pressed: root.handlePressed
|
||||
active: root.handlePressed || root.handleHasFocus || root.handleHovered
|
||||
color: root.control.Material.highlightedRippleColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.SpinBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentItem.implicitWidth +
|
||||
up.implicitIndicatorWidth +
|
||||
down.implicitIndicatorWidth)
|
||||
implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitBackgroundHeight,
|
||||
up.implicitIndicatorHeight,
|
||||
down.implicitIndicatorHeight)
|
||||
|
||||
spacing: 6
|
||||
topPadding: 8
|
||||
bottomPadding: 16
|
||||
leftPadding: (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0))
|
||||
rightPadding: (control.mirrored ? (down.indicator ? down.indicator.width : 0) : (up.indicator ? up.indicator.width : 0))
|
||||
|
||||
validator: IntValidator {
|
||||
locale: control.locale.name
|
||||
bottom: Math.min(control.from, control.to)
|
||||
top: Math.max(control.from, control.to)
|
||||
}
|
||||
|
||||
contentItem: TextInput {
|
||||
text: control.displayText
|
||||
|
||||
font: control.font
|
||||
color: enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
selectionColor: control.Material.textSelectionColor
|
||||
selectedTextColor: control.Material.foreground
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
|
||||
cursorDelegate: CursorDelegate { }
|
||||
|
||||
readOnly: !control.editable
|
||||
validator: control.validator
|
||||
inputMethodHints: control.inputMethodHints
|
||||
}
|
||||
|
||||
up.indicator: Item {
|
||||
x: control.mirrored ? 0 : parent.width - width
|
||||
implicitWidth: control.Material.touchTarget
|
||||
implicitHeight: control.Material.touchTarget
|
||||
height: parent.height
|
||||
width: height
|
||||
|
||||
Ripple {
|
||||
clipRadius: 2
|
||||
x: control.spacing
|
||||
y: control.spacing
|
||||
width: parent.width - 2 * control.spacing
|
||||
height: parent.height - 2 * control.spacing
|
||||
pressed: control.up.pressed
|
||||
active: control.up.pressed || control.up.hovered || control.visualFocus
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: Math.min(parent.width / 3, parent.height / 3)
|
||||
height: 2
|
||||
color: enabled ? control.Material.foreground : control.Material.spinBoxDisabledIconColor
|
||||
}
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 2
|
||||
height: Math.min(parent.width / 3, parent.height / 3)
|
||||
color: enabled ? control.Material.foreground : control.Material.spinBoxDisabledIconColor
|
||||
}
|
||||
}
|
||||
|
||||
down.indicator: Item {
|
||||
x: control.mirrored ? parent.width - width : 0
|
||||
implicitWidth: control.Material.touchTarget
|
||||
implicitHeight: control.Material.touchTarget
|
||||
height: parent.height
|
||||
width: height
|
||||
|
||||
Ripple {
|
||||
clipRadius: 2
|
||||
x: control.spacing
|
||||
y: control.spacing
|
||||
width: parent.width - 2 * control.spacing
|
||||
height: parent.height - 2 * control.spacing
|
||||
pressed: control.down.pressed
|
||||
active: control.down.pressed || control.down.hovered || control.visualFocus
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: parent.width / 3
|
||||
height: 2
|
||||
color: enabled ? control.Material.foreground : control.Material.spinBoxDisabledIconColor
|
||||
}
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: 192
|
||||
implicitHeight: control.Material.touchTarget
|
||||
|
||||
Rectangle {
|
||||
x: parent.width / 2 - width / 2
|
||||
y: parent.y + parent.height - height - control.bottomPadding / 2
|
||||
width: control.availableWidth
|
||||
height: control.activeFocus ? 2 : 1
|
||||
color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.13
|
||||
import QtQuick.Templates 2.13 as T
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Controls.impl 2.13
|
||||
import QtQuick.Controls.Material 2.13
|
||||
|
||||
T.SplitView {
|
||||
id: control
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
handle: Rectangle {
|
||||
implicitWidth: control.orientation === Qt.Horizontal ? 6 : control.width
|
||||
implicitHeight: control.orientation === Qt.Horizontal ? control.height : 6
|
||||
color: T.SplitHandle.pressed ? control.Material.background
|
||||
: Qt.lighter(control.Material.background, T.SplitHandle.hovered ? 1.2 : 1.1)
|
||||
|
||||
Rectangle {
|
||||
color: control.Material.secondaryTextColor
|
||||
width: control.orientation === Qt.Horizontal ? thickness : length
|
||||
height: control.orientation === Qt.Horizontal ? length : thickness
|
||||
radius: thickness
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
|
||||
property int length: parent.T.SplitHandle.pressed ? 3 : 8
|
||||
readonly property int thickness: parent.T.SplitHandle.pressed ? 3 : 1
|
||||
|
||||
Behavior on length {
|
||||
NumberAnimation {
|
||||
duration: 100
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.StackView {
|
||||
id: control
|
||||
|
||||
popEnter: Transition {
|
||||
// slide_in_left
|
||||
NumberAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * -control.width; to: 0; duration: 200; easing.type: Easing.OutCubic }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
popExit: Transition {
|
||||
// slide_out_right
|
||||
NumberAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * control.width; duration: 200; easing.type: Easing.OutCubic }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
pushEnter: Transition {
|
||||
// slide_in_right
|
||||
NumberAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0; duration: 200; easing.type: Easing.OutCubic }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
pushExit: Transition {
|
||||
// slide_out_left
|
||||
NumberAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width; duration: 200; easing.type: Easing.OutCubic }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
replaceEnter: Transition {
|
||||
// slide_in_right
|
||||
NumberAnimation { property: "x"; from: (control.mirrored ? -0.5 : 0.5) * control.width; to: 0; duration: 200; easing.type: Easing.OutCubic }
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
replaceExit: Transition {
|
||||
// slide_out_left
|
||||
NumberAnimation { property: "x"; from: 0; to: (control.mirrored ? -0.5 : 0.5) * -control.width; duration: 200; easing.type: Easing.OutCubic }
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 200; easing.type: Easing.OutCubic }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.SwipeDelegate {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: 8
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
swipe.transition: Transition { SmoothedAnimation { velocity: 3; easing.type: Easing.InOutCubic } }
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.Material.backgroundColor
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: control.highlighted
|
||||
color: control.Material.listHighlightColor
|
||||
}
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
enabled: control.swipe.position === 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.SwipeView {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentItem: ListView {
|
||||
model: control.contentModel
|
||||
interactive: control.interactive
|
||||
currentIndex: control.currentIndex
|
||||
focus: control.focus
|
||||
|
||||
spacing: control.spacing
|
||||
orientation: control.orientation
|
||||
snapMode: ListView.SnapOneItem
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
|
||||
highlightRangeMode: ListView.StrictlyEnforceRange
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: 0
|
||||
highlightMoveDuration: 250
|
||||
maximumFlickVelocity: 4 * (control.orientation === Qt.Horizontal ? width : height)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
|
||||
T.Switch {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 8
|
||||
spacing: 8
|
||||
|
||||
indicator: SwitchIndicator {
|
||||
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
|
||||
Ripple {
|
||||
x: parent.handle.x + parent.handle.width / 2 - width / 2
|
||||
y: parent.handle.y + parent.handle.height / 2 - height / 2
|
||||
width: 28; height: 28
|
||||
pressed: control.pressed
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.checked ? control.Material.highlightedRippleColor : control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
leftPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.SwitchDelegate {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 16
|
||||
verticalPadding: Material.switchDelegateVerticalPadding
|
||||
spacing: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: enabled ? Material.foreground : Material.hintTextColor
|
||||
|
||||
indicator: SwitchIndicator {
|
||||
x: control.text ? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
}
|
||||
|
||||
contentItem: IconLabel {
|
||||
leftPadding: !control.mirrored ? 0 : control.indicator.width + control.spacing
|
||||
rightPadding: control.mirrored ? 0 : control.indicator.width + control.spacing
|
||||
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon ? Qt.AlignCenter : Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.delegateHeight
|
||||
|
||||
color: control.highlighted ? control.Material.listHighlightColor : "transparent"
|
||||
|
||||
Ripple {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
|
||||
clip: visible
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
Item {
|
||||
id: indicator
|
||||
implicitWidth: 38
|
||||
implicitHeight: 32
|
||||
|
||||
property Item control
|
||||
property alias handle: handle
|
||||
|
||||
Material.elevation: 1
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: 14
|
||||
radius: height / 2
|
||||
y: parent.height / 2 - height / 2
|
||||
color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedTrackColor : indicator.control.Material.switchUncheckedTrackColor)
|
||||
: indicator.control.Material.switchDisabledTrackColor
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: handle
|
||||
x: Math.max(0, Math.min(parent.width - width, indicator.control.visualPosition * parent.width - (width / 2)))
|
||||
y: (parent.height - height) / 2
|
||||
width: 20
|
||||
height: 20
|
||||
radius: width / 2
|
||||
color: indicator.control.enabled ? (indicator.control.checked ? indicator.control.Material.switchCheckedHandleColor : indicator.control.Material.switchUncheckedHandleColor)
|
||||
: indicator.control.Material.switchDisabledHandleColor
|
||||
|
||||
Behavior on x {
|
||||
enabled: !indicator.control.pressed
|
||||
SmoothedAnimation {
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
layer.enabled: indicator.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: indicator.Material.elevation
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.TabBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 1
|
||||
|
||||
contentItem: ListView {
|
||||
model: control.contentModel
|
||||
currentIndex: control.currentIndex
|
||||
|
||||
spacing: control.spacing
|
||||
orientation: ListView.Horizontal
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
flickableDirection: Flickable.AutoFlickIfNeeded
|
||||
snapMode: ListView.SnapToItem
|
||||
|
||||
highlightMoveDuration: 250
|
||||
highlightResizeDuration: 0
|
||||
highlightFollowsCurrentItem: true
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
preferredHighlightBegin: 48
|
||||
preferredHighlightEnd: width - 48
|
||||
|
||||
highlight: Item {
|
||||
z: 2
|
||||
Rectangle {
|
||||
height: 2
|
||||
width: parent.width
|
||||
y: control.position === T.TabBar.Footer ? 0 : parent.height - height
|
||||
color: control.Material.accentColor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.Material.backgroundColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
fullWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.TabButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
spacing: 6
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: !enabled ? Material.hintTextColor : down || checked ? Material.accentColor : Material.foreground
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: !control.enabled ? control.Material.hintTextColor : control.down || control.checked ? control.Material.accentColor : control.Material.foreground
|
||||
}
|
||||
|
||||
background: Ripple {
|
||||
implicitHeight: control.Material.touchTarget
|
||||
|
||||
clip: true
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.down || control.visualFocus || control.hovered
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.TextArea {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(contentWidth + leftPadding + rightPadding,
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
placeholder.implicitWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(contentHeight + topPadding + bottomPadding,
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
placeholder.implicitHeight + 1 + topPadding + bottomPadding)
|
||||
|
||||
topPadding: 8
|
||||
bottomPadding: 16
|
||||
|
||||
color: enabled ? Material.foreground : Material.hintTextColor
|
||||
selectionColor: Material.accentColor
|
||||
selectedTextColor: Material.primaryHighlightedTextColor
|
||||
placeholderTextColor: Material.hintTextColor
|
||||
cursorDelegate: CursorDelegate { }
|
||||
|
||||
PlaceholderText {
|
||||
id: placeholder
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
width: control.width - (control.leftPadding + control.rightPadding)
|
||||
height: control.height - (control.topPadding + control.bottomPadding)
|
||||
text: control.placeholderText
|
||||
font: control.font
|
||||
color: control.placeholderTextColor
|
||||
verticalAlignment: control.verticalAlignment
|
||||
elide: Text.ElideRight
|
||||
renderType: control.renderType
|
||||
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
y: parent.height - height - control.bottomPadding / 2
|
||||
implicitWidth: 120
|
||||
height: control.activeFocus ? 2 : 1
|
||||
color: control.activeFocus ? control.Material.accentColor : control.Material.hintTextColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.TextField {
|
||||
id: control
|
||||
|
||||
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|
||||
|| Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding,
|
||||
placeholder.implicitHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: 8
|
||||
bottomPadding: 16
|
||||
|
||||
color: enabled ? Material.foreground : Material.hintTextColor
|
||||
selectionColor: Material.accentColor
|
||||
selectedTextColor: Material.primaryHighlightedTextColor
|
||||
placeholderTextColor: Material.hintTextColor
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
|
||||
cursorDelegate: CursorDelegate { }
|
||||
|
||||
PlaceholderText {
|
||||
id: placeholder
|
||||
x: control.leftPadding
|
||||
y: control.topPadding
|
||||
width: control.width - (control.leftPadding + control.rightPadding)
|
||||
height: control.height - (control.topPadding + control.bottomPadding)
|
||||
text: control.placeholderText
|
||||
font: control.font
|
||||
color: control.placeholderTextColor
|
||||
verticalAlignment: control.verticalAlignment
|
||||
elide: Text.ElideRight
|
||||
renderType: control.renderType
|
||||
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
y: control.height - height - control.bottomPadding + 8
|
||||
implicitWidth: 120
|
||||
height: control.activeFocus || control.hovered ? 2 : 1
|
||||
color: control.activeFocus ? control.Material.accentColor
|
||||
: (control.hovered ? control.Material.primaryTextColor : control.Material.hintTextColor)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.ToolBar {
|
||||
id: control
|
||||
|
||||
Material.elevation: 4
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
Material.foreground: Material.toolTextColor
|
||||
|
||||
spacing: 16
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 48
|
||||
color: control.Material.toolBarColor
|
||||
|
||||
layer.enabled: control.Material.elevation > 0
|
||||
layer.effect: ElevationEffect {
|
||||
elevation: control.Material.elevation
|
||||
fullWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Controls.Material 2.12
|
||||
import QtQuick.Controls.Material.impl 2.12
|
||||
|
||||
T.ToolButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
spacing: 6
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: !enabled ? Material.hintTextColor : checked || highlighted ? Material.accent : Material.foreground
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: !control.enabled ? control.Material.hintTextColor :
|
||||
control.checked || control.highlighted ? control.Material.accent : control.Material.foreground
|
||||
}
|
||||
|
||||
background: Ripple {
|
||||
implicitWidth: control.Material.touchTarget
|
||||
implicitHeight: control.Material.touchTarget
|
||||
|
||||
readonly property bool square: control.contentItem.width <= control.contentItem.height
|
||||
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
clip: !square
|
||||
width: square ? parent.height / 2 : parent.width
|
||||
height: square ? parent.height / 2 : parent.height
|
||||
pressed: control.pressed
|
||||
anchor: control
|
||||
active: control.enabled && (control.down || control.visualFocus || control.hovered)
|
||||
color: control.Material.rippleColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.ToolSeparator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
horizontalPadding: vertical ? 12 : 5
|
||||
verticalPadding: vertical ? 5 : 12
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: vertical ? 1 : 38
|
||||
implicitHeight: vertical ? 38 : 1
|
||||
color: control.Material.hintTextColor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.ToolTip {
|
||||
id: control
|
||||
|
||||
x: parent ? (parent.width - implicitWidth) / 2 : 0
|
||||
y: -implicitHeight - 24
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
margins: 12
|
||||
padding: 8
|
||||
horizontalPadding: padding + 8
|
||||
|
||||
closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
|
||||
|
||||
Material.theme: Material.Dark
|
||||
|
||||
enter: Transition {
|
||||
// toast_enter
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutQuad; duration: 500 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
// toast_exit
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.InQuad; duration: 500 }
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
text: control.text
|
||||
font: control.font
|
||||
wrapMode: Text.Wrap
|
||||
color: control.Material.foreground
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: control.Material.tooltipHeight
|
||||
color: control.Material.tooltipColor
|
||||
opacity: 0.9
|
||||
radius: 2
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2017 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.12
|
||||
import QtQuick.Controls 2.12
|
||||
import QtQuick.Controls.impl 2.12
|
||||
import QtQuick.Templates 2.12 as T
|
||||
import QtQuick.Controls.Material 2.12
|
||||
|
||||
T.Tumbler {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding) || 60 // ### remove 60 in Qt 6
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding) || 200 // ### remove 200 in Qt 6
|
||||
|
||||
delegate: Text {
|
||||
text: modelData
|
||||
color: control.Material.foreground
|
||||
font: control.font
|
||||
opacity: (1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)) * (control.enabled ? 1 : 0.6)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
contentItem: TumblerView {
|
||||
implicitWidth: 60
|
||||
implicitHeight: 200
|
||||
model: control.model
|
||||
delegate: control.delegate
|
||||
path: Path {
|
||||
startX: control.contentItem.width / 2
|
||||
startY: -control.contentItem.delegateHeight / 2
|
||||
PathLine {
|
||||
x: control.contentItem.width / 2
|
||||
y: (control.visibleItemCount + 1) * control.contentItem.delegateHeight - control.contentItem.delegateHeight / 2
|
||||
}
|
||||
}
|
||||
|
||||
property real delegateHeight: control.availableHeight / control.visibleItemCount
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2020 The Qt Company Ltd.
|
||||
** Contact: http://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL3$
|
||||
** 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 http://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at http://www.qt.io/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 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPLv3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or later 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 2.0 requirements will be
|
||||
** met: http://www.gnu.org/licenses/gpl-2.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Templates 2.15 as T
|
||||
import QtQuick.Controls.Material 2.15
|
||||
import QtQuick.Controls.Material.impl 2.15
|
||||
|
||||
T.VerticalHeaderView {
|
||||
id: control
|
||||
|
||||
implicitWidth: contentWidth
|
||||
implicitHeight: syncView ? syncView.height : 0
|
||||
|
||||
delegate: Rectangle {
|
||||
// Qt6: add cellPadding (and font etc) as public API in headerview
|
||||
readonly property real cellPadding: 8
|
||||
|
||||
implicitWidth: Math.max(control.width, text.implicitWidth + (cellPadding * 2))
|
||||
implicitHeight: text.implicitHeight + (cellPadding * 2)
|
||||
color: control.Material.backgroundColor
|
||||
|
||||
Text {
|
||||
id: text
|
||||
text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole]
|
||||
: model[control.textRole])
|
||||
: modelData
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: enabled ? control.Material.foreground : control.Material.hintTextColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,459 @@
|
||||
import QtQuick.tooling 1.2
|
||||
|
||||
// This file describes the plugin-supplied types contained in the library.
|
||||
// It is used for QML tooling purposes only.
|
||||
//
|
||||
// This file was auto-generated by:
|
||||
// 'qmlplugindump -nonrelocatable -dependencies dependencies.json QtQuick.Controls.Material 2.15'
|
||||
|
||||
Module {
|
||||
dependencies: ["QtQuick.Controls 2.0"]
|
||||
Component { name: "QQuickAttachedObject"; prototype: "QObject" }
|
||||
Component {
|
||||
name: "QQuickItem"
|
||||
defaultProperty: "data"
|
||||
prototype: "QObject"
|
||||
Enum {
|
||||
name: "Flags"
|
||||
values: {
|
||||
"ItemClipsChildrenToShape": 1,
|
||||
"ItemAcceptsInputMethod": 2,
|
||||
"ItemIsFocusScope": 4,
|
||||
"ItemHasContents": 8,
|
||||
"ItemAcceptsDrops": 16
|
||||
}
|
||||
}
|
||||
Enum {
|
||||
name: "TransformOrigin"
|
||||
values: {
|
||||
"TopLeft": 0,
|
||||
"Top": 1,
|
||||
"TopRight": 2,
|
||||
"Left": 3,
|
||||
"Center": 4,
|
||||
"Right": 5,
|
||||
"BottomLeft": 6,
|
||||
"Bottom": 7,
|
||||
"BottomRight": 8
|
||||
}
|
||||
}
|
||||
Property { name: "parent"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
|
||||
Property { name: "resources"; type: "QObject"; isList: true; isReadonly: true }
|
||||
Property { name: "children"; type: "QQuickItem"; isList: true; isReadonly: true }
|
||||
Property { name: "x"; type: "double" }
|
||||
Property { name: "y"; type: "double" }
|
||||
Property { name: "z"; type: "double" }
|
||||
Property { name: "width"; type: "double" }
|
||||
Property { name: "height"; type: "double" }
|
||||
Property { name: "opacity"; type: "double" }
|
||||
Property { name: "enabled"; type: "bool" }
|
||||
Property { name: "visible"; type: "bool" }
|
||||
Property { name: "visibleChildren"; type: "QQuickItem"; isList: true; isReadonly: true }
|
||||
Property { name: "states"; type: "QQuickState"; isList: true; isReadonly: true }
|
||||
Property { name: "transitions"; type: "QQuickTransition"; isList: true; isReadonly: true }
|
||||
Property { name: "state"; type: "string" }
|
||||
Property { name: "childrenRect"; type: "QRectF"; isReadonly: true }
|
||||
Property { name: "anchors"; type: "QQuickAnchors"; isReadonly: true; isPointer: true }
|
||||
Property { name: "left"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "right"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "horizontalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "top"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "bottom"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "verticalCenter"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "baseline"; type: "QQuickAnchorLine"; isReadonly: true }
|
||||
Property { name: "baselineOffset"; type: "double" }
|
||||
Property { name: "clip"; type: "bool" }
|
||||
Property { name: "focus"; type: "bool" }
|
||||
Property { name: "activeFocus"; type: "bool"; isReadonly: true }
|
||||
Property { name: "activeFocusOnTab"; revision: 1; type: "bool" }
|
||||
Property { name: "rotation"; type: "double" }
|
||||
Property { name: "scale"; type: "double" }
|
||||
Property { name: "transformOrigin"; type: "TransformOrigin" }
|
||||
Property { name: "transformOriginPoint"; type: "QPointF"; isReadonly: true }
|
||||
Property { name: "transform"; type: "QQuickTransform"; isList: true; isReadonly: true }
|
||||
Property { name: "smooth"; type: "bool" }
|
||||
Property { name: "antialiasing"; type: "bool" }
|
||||
Property { name: "implicitWidth"; type: "double" }
|
||||
Property { name: "implicitHeight"; type: "double" }
|
||||
Property { name: "containmentMask"; revision: 11; type: "QObject"; isPointer: true }
|
||||
Property { name: "layer"; type: "QQuickItemLayer"; isReadonly: true; isPointer: true }
|
||||
Signal {
|
||||
name: "childrenRectChanged"
|
||||
Parameter { type: "QRectF" }
|
||||
}
|
||||
Signal {
|
||||
name: "baselineOffsetChanged"
|
||||
Parameter { type: "double" }
|
||||
}
|
||||
Signal {
|
||||
name: "stateChanged"
|
||||
Parameter { type: "string" }
|
||||
}
|
||||
Signal {
|
||||
name: "focusChanged"
|
||||
Parameter { type: "bool" }
|
||||
}
|
||||
Signal {
|
||||
name: "activeFocusChanged"
|
||||
Parameter { type: "bool" }
|
||||
}
|
||||
Signal {
|
||||
name: "activeFocusOnTabChanged"
|
||||
revision: 1
|
||||
Parameter { type: "bool" }
|
||||
}
|
||||
Signal {
|
||||
name: "parentChanged"
|
||||
Parameter { type: "QQuickItem"; isPointer: true }
|
||||
}
|
||||
Signal {
|
||||
name: "transformOriginChanged"
|
||||
Parameter { type: "TransformOrigin" }
|
||||
}
|
||||
Signal {
|
||||
name: "smoothChanged"
|
||||
Parameter { type: "bool" }
|
||||
}
|
||||
Signal {
|
||||
name: "antialiasingChanged"
|
||||
Parameter { type: "bool" }
|
||||
}
|
||||
Signal {
|
||||
name: "clipChanged"
|
||||
Parameter { type: "bool" }
|
||||
}
|
||||
Signal {
|
||||
name: "windowChanged"
|
||||
revision: 1
|
||||
Parameter { name: "window"; type: "QQuickWindow"; isPointer: true }
|
||||
}
|
||||
Signal { name: "containmentMaskChanged"; revision: 11 }
|
||||
Method { name: "update" }
|
||||
Method {
|
||||
name: "grabToImage"
|
||||
revision: 4
|
||||
type: "bool"
|
||||
Parameter { name: "callback"; type: "QJSValue" }
|
||||
Parameter { name: "targetSize"; type: "QSize" }
|
||||
}
|
||||
Method {
|
||||
name: "grabToImage"
|
||||
revision: 4
|
||||
type: "bool"
|
||||
Parameter { name: "callback"; type: "QJSValue" }
|
||||
}
|
||||
Method {
|
||||
name: "contains"
|
||||
type: "bool"
|
||||
Parameter { name: "point"; type: "QPointF" }
|
||||
}
|
||||
Method {
|
||||
name: "mapFromItem"
|
||||
Parameter { type: "QQmlV4Function"; isPointer: true }
|
||||
}
|
||||
Method {
|
||||
name: "mapToItem"
|
||||
Parameter { type: "QQmlV4Function"; isPointer: true }
|
||||
}
|
||||
Method {
|
||||
name: "mapFromGlobal"
|
||||
revision: 7
|
||||
Parameter { type: "QQmlV4Function"; isPointer: true }
|
||||
}
|
||||
Method {
|
||||
name: "mapToGlobal"
|
||||
revision: 7
|
||||
Parameter { type: "QQmlV4Function"; isPointer: true }
|
||||
}
|
||||
Method { name: "forceActiveFocus" }
|
||||
Method {
|
||||
name: "forceActiveFocus"
|
||||
Parameter { name: "reason"; type: "Qt::FocusReason" }
|
||||
}
|
||||
Method {
|
||||
name: "nextItemInFocusChain"
|
||||
revision: 1
|
||||
type: "QQuickItem*"
|
||||
Parameter { name: "forward"; type: "bool" }
|
||||
}
|
||||
Method { name: "nextItemInFocusChain"; revision: 1; type: "QQuickItem*" }
|
||||
Method {
|
||||
name: "childAt"
|
||||
type: "QQuickItem*"
|
||||
Parameter { name: "x"; type: "double" }
|
||||
Parameter { name: "y"; type: "double" }
|
||||
}
|
||||
}
|
||||
Component {
|
||||
name: "QQuickMaterialBusyIndicator"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickItem"
|
||||
exports: ["QtQuick.Controls.Material.impl/BusyIndicatorImpl 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
Property { name: "color"; type: "QColor" }
|
||||
Property { name: "running"; type: "bool" }
|
||||
}
|
||||
Component {
|
||||
name: "QQuickMaterialProgressBar"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickItem"
|
||||
exports: ["QtQuick.Controls.Material.impl/ProgressBarImpl 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
Property { name: "color"; type: "QColor" }
|
||||
Property { name: "progress"; type: "double" }
|
||||
Property { name: "indeterminate"; type: "bool" }
|
||||
}
|
||||
Component {
|
||||
name: "QQuickMaterialRipple"
|
||||
defaultProperty: "data"
|
||||
prototype: "QQuickItem"
|
||||
exports: ["QtQuick.Controls.Material.impl/Ripple 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
Enum {
|
||||
name: "Trigger"
|
||||
values: {
|
||||
"Press": 0,
|
||||
"Release": 1
|
||||
}
|
||||
}
|
||||
Property { name: "color"; type: "QColor" }
|
||||
Property { name: "clipRadius"; type: "double" }
|
||||
Property { name: "pressed"; type: "bool" }
|
||||
Property { name: "active"; type: "bool" }
|
||||
Property { name: "anchor"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "trigger"; type: "Trigger" }
|
||||
}
|
||||
Component {
|
||||
name: "QQuickMaterialStyle"
|
||||
prototype: "QQuickAttachedObject"
|
||||
exports: ["QtQuick.Controls.Material/Material 2.0"]
|
||||
isCreatable: false
|
||||
exportMetaObjectRevisions: [0]
|
||||
Enum {
|
||||
name: "Theme"
|
||||
values: {
|
||||
"Light": 0,
|
||||
"Dark": 1,
|
||||
"System": 2
|
||||
}
|
||||
}
|
||||
Enum {
|
||||
name: "Variant"
|
||||
values: {
|
||||
"Normal": 0,
|
||||
"Dense": 1
|
||||
}
|
||||
}
|
||||
Enum {
|
||||
name: "Color"
|
||||
values: {
|
||||
"Red": 0,
|
||||
"Pink": 1,
|
||||
"Purple": 2,
|
||||
"DeepPurple": 3,
|
||||
"Indigo": 4,
|
||||
"Blue": 5,
|
||||
"LightBlue": 6,
|
||||
"Cyan": 7,
|
||||
"Teal": 8,
|
||||
"Green": 9,
|
||||
"LightGreen": 10,
|
||||
"Lime": 11,
|
||||
"Yellow": 12,
|
||||
"Amber": 13,
|
||||
"Orange": 14,
|
||||
"DeepOrange": 15,
|
||||
"Brown": 16,
|
||||
"Grey": 17,
|
||||
"BlueGrey": 18
|
||||
}
|
||||
}
|
||||
Enum {
|
||||
name: "Shade"
|
||||
values: {
|
||||
"Shade50": 0,
|
||||
"Shade100": 1,
|
||||
"Shade200": 2,
|
||||
"Shade300": 3,
|
||||
"Shade400": 4,
|
||||
"Shade500": 5,
|
||||
"Shade600": 6,
|
||||
"Shade700": 7,
|
||||
"Shade800": 8,
|
||||
"Shade900": 9,
|
||||
"ShadeA100": 10,
|
||||
"ShadeA200": 11,
|
||||
"ShadeA400": 12,
|
||||
"ShadeA700": 13
|
||||
}
|
||||
}
|
||||
Property { name: "theme"; type: "Theme" }
|
||||
Property { name: "primary"; type: "QVariant" }
|
||||
Property { name: "accent"; type: "QVariant" }
|
||||
Property { name: "foreground"; type: "QVariant" }
|
||||
Property { name: "background"; type: "QVariant" }
|
||||
Property { name: "elevation"; type: "int" }
|
||||
Property { name: "primaryColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "accentColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "backgroundColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "primaryTextColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "primaryHighlightedTextColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "secondaryTextColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "hintTextColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "textSelectionColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "dropShadowColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "dividerColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "iconColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "iconDisabledColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "buttonColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "buttonDisabledColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "highlightedButtonColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "frameColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "rippleColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "highlightedRippleColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "switchUncheckedTrackColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "switchCheckedTrackColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "switchUncheckedHandleColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "switchCheckedHandleColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "switchDisabledTrackColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "switchDisabledHandleColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "scrollBarColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "scrollBarHoveredColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "scrollBarPressedColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "dialogColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "backgroundDimColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "listHighlightColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "tooltipColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "toolBarColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "toolTextColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "spinBoxDisabledIconColor"; type: "QColor"; isReadonly: true }
|
||||
Property { name: "sliderDisabledColor"; revision: 15; type: "QColor"; isReadonly: true }
|
||||
Property { name: "touchTarget"; type: "int"; isReadonly: true }
|
||||
Property { name: "buttonHeight"; type: "int"; isReadonly: true }
|
||||
Property { name: "delegateHeight"; type: "int"; isReadonly: true }
|
||||
Property { name: "dialogButtonBoxHeight"; type: "int"; isReadonly: true }
|
||||
Property { name: "frameVerticalPadding"; type: "int"; isReadonly: true }
|
||||
Property { name: "menuItemHeight"; type: "int"; isReadonly: true }
|
||||
Property { name: "menuItemVerticalPadding"; type: "int"; isReadonly: true }
|
||||
Property { name: "switchDelegateVerticalPadding"; type: "int"; isReadonly: true }
|
||||
Property { name: "tooltipHeight"; type: "int"; isReadonly: true }
|
||||
Signal { name: "paletteChanged" }
|
||||
Method {
|
||||
name: "color"
|
||||
type: "QColor"
|
||||
Parameter { name: "color"; type: "Color" }
|
||||
Parameter { name: "shade"; type: "Shade" }
|
||||
}
|
||||
Method {
|
||||
name: "color"
|
||||
type: "QColor"
|
||||
Parameter { name: "color"; type: "Color" }
|
||||
}
|
||||
Method {
|
||||
name: "shade"
|
||||
type: "QColor"
|
||||
Parameter { name: "color"; type: "QColor" }
|
||||
Parameter { name: "shade"; type: "Shade" }
|
||||
}
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
name: "QtQuick.Controls.Material.impl/BoxShadow 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/BoxShadow 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "offsetX"; type: "int" }
|
||||
Property { name: "offsetY"; type: "int" }
|
||||
Property { name: "blurRadius"; type: "int" }
|
||||
Property { name: "spreadRadius"; type: "int" }
|
||||
Property { name: "source"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "fullWidth"; type: "bool" }
|
||||
Property { name: "fullHeight"; type: "bool" }
|
||||
Property { name: "glowRadius"; type: "double" }
|
||||
Property { name: "spread"; type: "double" }
|
||||
Property { name: "color"; type: "QColor" }
|
||||
Property { name: "cornerRadius"; type: "double" }
|
||||
Property { name: "cached"; type: "bool" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickRectangle"
|
||||
name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "control"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "checkState"; type: "int" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickRectangle"
|
||||
name: "QtQuick.Controls.Material.impl/CursorDelegate 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/CursorDelegate 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
name: "QtQuick.Controls.Material.impl/ElevationEffect 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/ElevationEffect 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "source"; type: "QVariant" }
|
||||
Property { name: "elevation"; type: "int" }
|
||||
Property { name: "fullWidth"; type: "bool" }
|
||||
Property { name: "fullHeight"; type: "bool" }
|
||||
Property { name: "sourceItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
|
||||
Property { name: "_shadows"; type: "QVariant"; isReadonly: true }
|
||||
Property { name: "_shadow"; type: "QVariant"; isReadonly: true }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickRectangle"
|
||||
name: "QtQuick.Controls.Material.impl/RadioIndicator 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/RadioIndicator 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "control"; type: "QQuickItem"; isPointer: true }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
name: "QtQuick.Controls.Material.impl/RectangularGlow 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/RectangularGlow 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "glowRadius"; type: "double" }
|
||||
Property { name: "spread"; type: "double" }
|
||||
Property { name: "color"; type: "QColor" }
|
||||
Property { name: "cornerRadius"; type: "double" }
|
||||
Property { name: "cached"; type: "bool" }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
name: "QtQuick.Controls.Material.impl/SliderHandle 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/SliderHandle 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "value"; type: "double" }
|
||||
Property { name: "handleHasFocus"; type: "bool" }
|
||||
Property { name: "handlePressed"; type: "bool" }
|
||||
Property { name: "handleHovered"; type: "bool" }
|
||||
Property { name: "initialSize"; type: "int"; isReadonly: true }
|
||||
Property { name: "control"; type: "QVariant"; isReadonly: true }
|
||||
}
|
||||
Component {
|
||||
prototype: "QQuickItem"
|
||||
name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0"
|
||||
exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"]
|
||||
exportMetaObjectRevisions: [0]
|
||||
isComposite: true
|
||||
defaultProperty: "data"
|
||||
Property { name: "control"; type: "QQuickItem"; isPointer: true }
|
||||
Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
module QtQuick.Controls.Material
|
||||
plugin qtquickcontrols2materialstyleplugin
|
||||
classname QtQuickControls2MaterialStylePlugin
|
||||
depends QtQuick.Controls 2.5
|
||||
Binary file not shown.
Reference in New Issue
Block a user