diff options
Diffstat (limited to 'src/quicknativestyle/controls')
-rw-r--r-- | src/quicknativestyle/controls/DefaultButton.qml | 83 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultCheckBox.qml | 93 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultComboBox.qml | 129 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultDial.qml | 60 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultFrame.qml | 62 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultGroupBox.qml | 91 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultProgressBar.qml | 60 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultRadioButton.qml | 96 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultScrollBar.qml | 67 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultSlider.qml | 74 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultSpinBox.qml | 109 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultTextArea.qml | 83 | ||||
-rw-r--r-- | src/quicknativestyle/controls/DefaultTextField.qml | 89 | ||||
-rw-r--r-- | src/quicknativestyle/controls/controls.pri | 14 |
14 files changed, 0 insertions, 1110 deletions
diff --git a/src/quicknativestyle/controls/DefaultButton.qml b/src/quicknativestyle/controls/DefaultButton.qml deleted file mode 100644 index 7e55aaa2..00000000 --- a/src/quicknativestyle/controls/DefaultButton.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.Button { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - // Since QQuickControl will subtract the insets from the control size to - // figure out the background size, we need to reverse that here, otherwise - // the control ends up too big. - implicitWidth: implicitBackgroundWidth + leftInset + rightInset - implicitHeight: implicitBackgroundHeight + topInset + bottomInset - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - leftPadding: __nativeBackground ? background.contentPadding.left : 5 - rightPadding: __nativeBackground ? background.contentPadding.right : 5 - topPadding: __nativeBackground ? background.contentPadding.top : 5 - bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5 - - background: NativeStyle.Button { - control: control - contentWidth: contentItem.implicitWidth - contentHeight: contentItem.implicitHeight - } - - icon.width: 24 - icon.height: 24 - icon.color: control.checked || control.highlighted ? control.palette.brightText : - control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - - contentItem: IconLabel { - spacing: control.spacing - mirrored: control.mirrored - display: control.display - - icon: control.icon - text: control.text - font: control.font - color: control.checked || control.highlighted ? control.palette.brightText : - control.flat && !control.down ? (control.visualFocus ? control.palette.highlight : control.palette.windowText) : control.palette.buttonText - } -} diff --git a/src/quicknativestyle/controls/DefaultCheckBox.qml b/src/quicknativestyle/controls/DefaultCheckBox.qml deleted file mode 100644 index 09166820..00000000 --- a/src/quicknativestyle/controls/DefaultCheckBox.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Templates as T -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.NativeStyle as NativeStyle - -T.CheckBox { - id: control - - readonly property bool nativeIndicator: indicator instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - font.pixelSize: nativeIndicator ? indicator.styleFont(control).pixelSize : undefined - - spacing: nativeIndicator ? 0 : 6 - padding: nativeIndicator ? 0 : 6 - - indicator: NativeStyle.CheckBox { - control: control - y: control.topPadding + (control.availableHeight - height) >> 1 - contentWidth: contentItem.implicitWidth - contentHeight: contentItem.implicitHeight - useNinePatchImage: false - } - - contentItem: CheckLabel { - text: control.text - font: control.font - color: control.palette.windowText - - // For some reason, the other styles set padding here (in the delegate), instead of in - // the control above. And they also adjust the indicator position by setting x and y - // explicitly (instead of using insets). So we follow the same pattern to ensure that - // setting a custom contentItem delegate from the app will end up looking the same for - // all styles. But this should probably be fixed for all styles (to make them work the - // same way as e.g Buttons). - leftPadding: { - if (nativeIndicator) - indicator.contentPadding.left - else - indicator && !mirrored ? indicator.width + spacing : 0 - } - - topPadding: nativeIndicator ? indicator.contentPadding.top : 0 - rightPadding: { - if (nativeIndicator) - indicator.contentPadding.right - else - indicator && mirrored ? indicator.width + spacing : 0 - } - } -} diff --git a/src/quicknativestyle/controls/DefaultComboBox.qml b/src/quicknativestyle/controls/DefaultComboBox.qml deleted file mode 100644 index 7b286a1e..00000000 --- a/src/quicknativestyle/controls/DefaultComboBox.qml +++ /dev/null @@ -1,129 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Window -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.ComboBox { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding, - 90 /* minimum */ ) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - leftPadding: __nativeBackground ? background.contentPadding.left : 5 - rightPadding: __nativeBackground ? background.contentPadding.right : 5 - topPadding: __nativeBackground ? background.contentPadding.top : 5 - bottomPadding: __nativeBackground ? background.contentPadding.bottom : 5 - - contentItem: T.TextField { - implicitWidth: contentWidth - implicitHeight: contentHeight - 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.editable ? control.palette.text : control.palette.buttonText - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - verticalAlignment: Text.AlignVCenter - } - - background: NativeStyle.ComboBox { - control: control - contentWidth: contentItem.implicitWidth - contentHeight: contentItem.implicitHeight - } - - delegate: ItemDelegate { - width: ListView.view.width - text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData - palette.text: control.palette.text - palette.highlightedText: control.palette.highlightedText - font.weight: control.currentIndex === index ? Font.DemiBold : Font.Normal - highlighted: control.highlightedIndex === index - hoverEnabled: control.hoverEnabled - } - - popup: T.Popup { - readonly property var layoutMargins: control.__nativeBackground ? control.background.layoutMargins : null - x: layoutMargins ? layoutMargins.left : 0 - y: control.height - (layoutMargins ? layoutMargins.bottom : 0) - width: control.width - (layoutMargins ? layoutMargins.left + layoutMargins.right : 0) - height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin) - topMargin: 6 - bottomMargin: 6 - - contentItem: ListView { - clip: true - implicitHeight: contentHeight - model: control.delegateModel - currentIndex: control.highlightedIndex - highlightMoveDuration: 0 - - Rectangle { - z: 10 - width: parent.width - height: parent.height - color: "transparent" - border.color: control.palette.mid - } - - T.ScrollIndicator.vertical: ScrollIndicator { } - } - - background: Rectangle { - color: control.palette.window - } - } -} diff --git a/src/quicknativestyle/controls/DefaultDial.qml b/src/quicknativestyle/controls/DefaultDial.qml deleted file mode 100644 index b628ed09..00000000 --- a/src/quicknativestyle/controls/DefaultDial.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.Dial { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding, - 80 /* minimum */ ) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - 80 /* minimum */ ) - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - background: NativeStyle.Dial { - control: control - useNinePatchImage: false - } -} diff --git a/src/quicknativestyle/controls/DefaultFrame.qml b/src/quicknativestyle/controls/DefaultFrame.qml deleted file mode 100644 index 77ca6125..00000000 --- a/src/quicknativestyle/controls/DefaultFrame.qml +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.Frame { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - leftPadding: __nativeBackground ? background.contentPadding.left : 12 - rightPadding: __nativeBackground ? background.contentPadding.right : 12 - topPadding: __nativeBackground ? background.contentPadding.top : 12 - bottomPadding: __nativeBackground ? background.contentPadding.bottom : 12 - - background: NativeStyle.Frame { - control: control - contentWidth: control.contentWidth - contentHeight: control.contentHeight - } -} diff --git a/src/quicknativestyle/controls/DefaultGroupBox.qml b/src/quicknativestyle/controls/DefaultGroupBox.qml deleted file mode 100644 index a7f3f9d0..00000000 --- a/src/quicknativestyle/controls/DefaultGroupBox.qml +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.GroupBox { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - contentWidth + leftPadding + rightPadding, - implicitLabelWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding) - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - label: Rectangle { - color: control.palette.window - property point labelPos : control.__nativeBackground - ? background.labelPos - : Qt.point(0,0) - x: labelPos.x + background.x - y: labelPos.y + background.y - (__nativeBackground ? background.groupBoxPadding.top : 0) - width: children[0].implicitWidth - height: children[0].implicitHeight - Text { - width: parent.width - height: parent.height - text: control.title - font: control.font - color: control.palette.windowText - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - } - - leftPadding: __nativeBackground ? background.contentPadding.left : 0 - rightPadding: __nativeBackground ? background.contentPadding.right : 0 - topPadding: __nativeBackground ? background.contentPadding.top : 0 - bottomPadding: __nativeBackground ? background.contentPadding.bottom : 0 - - background: NativeStyle.GroupBox { - control: control - - x: groupBoxPadding.left - y: groupBoxPadding.top - width: contentItem.width + control.leftPadding + control.rightPadding - groupBoxPadding.left - groupBoxPadding.right - height: contentItem.height + control.topPadding + control.bottomPadding - groupBoxPadding.top - groupBoxPadding.bottom - - contentWidth: contentItem.implicitWidth - contentHeight: contentItem.implicitHeight - } -} diff --git a/src/quicknativestyle/controls/DefaultProgressBar.qml b/src/quicknativestyle/controls/DefaultProgressBar.qml deleted file mode 100644 index 037bdbae..00000000 --- a/src/quicknativestyle/controls/DefaultProgressBar.qml +++ /dev/null @@ -1,60 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Templates as T -import QtQuick.Controls -import QtQuick.NativeStyle as NativeStyle - -T.ProgressBar { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding, - control.horizontal ? 90 : 0 /* minimum */ ) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - control.vertical ? 90 : 0 /* minimum */ ) - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - background: NativeStyle.ProgressBar { - control: control - useNinePatchImage: false - } -} diff --git a/src/quicknativestyle/controls/DefaultRadioButton.qml b/src/quicknativestyle/controls/DefaultRadioButton.qml deleted file mode 100644 index 29746ba7..00000000 --- a/src/quicknativestyle/controls/DefaultRadioButton.qml +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Templates as T -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.NativeStyle as NativeStyle - -T.RadioButton { - id: control - - readonly property bool nativeIndicator: indicator instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding, - implicitIndicatorHeight + topPadding + bottomPadding) - - font.pixelSize: nativeIndicator ? indicator.styleFont(control).pixelSize : undefined - - spacing: nativeIndicator ? 0 : 6 - padding: nativeIndicator ? 0 : 6 - - indicator: NativeStyle.RadioButton { - control: control - contentWidth: contentItem.implicitWidth - contentHeight: contentItem.implicitHeight - useNinePatchImage: false -// Component.onCompleted: { -// var f = indicator.font(control) -// control.font.pixelSize = f.pixelSize -// print(f) -// } - } - - contentItem: CheckLabel { - text: control.text - font: control.font - color: control.palette.windowText - - // For some reason, the other styles set padding here (in the delegate), instead of in - // the control above. And they also adjust the indicator position by setting x and y - // explicitly (instead of using insets). So we follow the same pattern to ensure that - // setting a custom contentItem delegate from the app will end up looking the same for - // all styles. But this should probably be fixed for all styles (to make them work the - // same way as e.g Buttons). - leftPadding: { - if (nativeIndicator) - indicator.contentPadding.left - else - indicator && !mirrored ? indicator.width + spacing : 0 - } - - rightPadding: { - if (nativeIndicator) - indicator.contentPadding.right - else - indicator && mirrored ? indicator.width + spacing : 0 - } - } -} diff --git a/src/quicknativestyle/controls/DefaultScrollBar.qml b/src/quicknativestyle/controls/DefaultScrollBar.qml deleted file mode 100644 index b7b78732..00000000 --- a/src/quicknativestyle/controls/DefaultScrollBar.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.ScrollBar { - id: control - - readonly property bool __nativeContentItem: contentItem instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitContentWidth + leftPadding + rightPadding) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitContentHeight + topPadding + bottomPadding) - - font.pixelSize: __nativeContentItem ? contentItem.styleFont(control).pixelSize : undefined - - visible: policy === T.ScrollBar.AlwaysOn || (policy === T.ScrollBar.AsNeeded && size < 1.0) - minimumSize: !__nativeContentItem ? 10 : orientation === Qt.Vertical ? - contentItem.minimumSize.height / height : contentItem.minimumSize.width / width - - background: NativeStyle.ScrollBar { - control: control - subControl: NativeStyle.ScrollBar.Groove - } - - contentItem: NativeStyle.ScrollBar { - control: control - subControl: NativeStyle.ScrollBar.Handle - } -} diff --git a/src/quicknativestyle/controls/DefaultSlider.qml b/src/quicknativestyle/controls/DefaultSlider.qml deleted file mode 100644 index ebc1c265..00000000 --- a/src/quicknativestyle/controls/DefaultSlider.qml +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.Slider { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, - implicitHandleWidth + leftPadding + rightPadding, - control.horizontal ? 90 : 0 /* minimum */ ) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - implicitHandleHeight + topPadding + bottomPadding, - control.vertical ? 90 : 0 /* minimum */ ) - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - background: NativeStyle.Slider { - control: control - subControl: NativeStyle.Slider.Groove - // We normally cannot use a nine patch image for the - // groove if we draw tickmarks (since then the scaling - // would scale the tickmarks too). The groove might - // also use a different background color before, and - // after, the handle. - useNinePatchImage: false - } - - handle: NativeStyle.Slider { - control: control - subControl: NativeStyle.Slider.Handle - 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)) - useNinePatchImage: false - } -} diff --git a/src/quicknativestyle/controls/DefaultSpinBox.qml b/src/quicknativestyle/controls/DefaultSpinBox.qml deleted file mode 100644 index 869ff411..00000000 --- a/src/quicknativestyle/controls/DefaultSpinBox.qml +++ /dev/null @@ -1,109 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.SpinBox { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(implicitBackgroundWidth + spacing + up.implicitIndicatorWidth - + leftInset + rightInset, - 90 /* minimum */ ) - implicitHeight: Math.max(implicitBackgroundHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight - + (spacing * 3)) + topInset + bottomInset - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - spacing: 2 - - leftPadding: (__nativeBackground ? background.contentPadding.left: 0) - topPadding: (__nativeBackground ? background.contentPadding.top: 0) - rightPadding: (__nativeBackground ? background.contentPadding.right : 0) + up.implicitIndicatorWidth + spacing - bottomPadding: (__nativeBackground ? background.contentPadding.bottom: 0) + spacing - - 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: font.font - color: control.palette.text - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - horizontalAlignment: Qt.AlignLeft - verticalAlignment: Qt.AlignVCenter - - topPadding: 2 - bottomPadding: 2 - leftPadding: 10 - rightPadding: 10 - - readOnly: !control.editable - validator: control.validator - inputMethodHints: control.inputMethodHints - } - - up.indicator: NativeStyle.SpinBox { - control: control - subControl: NativeStyle.SpinBox.Up - x: parent.width - width - spacing - y: (parent.height / 2) - height - useNinePatchImage: false - } - - down.indicator: NativeStyle.SpinBox { - control: control - subControl: NativeStyle.SpinBox.Down - x: up.indicator.x - y: up.indicator.y + up.indicator.height - useNinePatchImage: false - } - - background: NativeStyle.SpinBox { - control: control - subControl: NativeStyle.SpinBox.Frame - contentWidth: contentItem.implicitWidth - contentHeight: contentItem.implicitHeight - } -} diff --git a/src/quicknativestyle/controls/DefaultTextArea.qml b/src/quicknativestyle/controls/DefaultTextArea.qml deleted file mode 100644 index c634da7e..00000000 --- a/src/quicknativestyle/controls/DefaultTextArea.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -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 + topPadding + bottomPadding) - - leftPadding: 7 - rightPadding: 7 - topPadding: 3 - bottomPadding: 3 - - color: control.palette.text - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - placeholderTextColor: control.palette.placeholderText - verticalAlignment: TextInput.AlignTop - - PlaceholderText { - id: placeholder - height: control.height - topPadding: control.topPadding - bottomPadding: control.bottomPadding - leftPadding: control.leftPadding - rightPadding: control.rightPadding - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - background: Rectangle { - color: control.palette.light - } -} diff --git a/src/quicknativestyle/controls/DefaultTextField.qml b/src/quicknativestyle/controls/DefaultTextField.qml deleted file mode 100644 index 8f8c8e4d..00000000 --- a/src/quicknativestyle/controls/DefaultTextField.qml +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** 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 -import QtQuick.Controls -import QtQuick.Controls.impl -import QtQuick.Templates as T -import QtQuick.NativeStyle as NativeStyle - -T.TextField { - id: control - - readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem - - implicitWidth: Math.max(Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding, - implicitBackgroundWidth + leftInset + rightInset, - 90 /* minimum */ ) - implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, - contentHeight + topPadding + bottomPadding, - placeholder.implicitHeight + topPadding + bottomPadding) - - font.pixelSize: __nativeBackground ? background.styleFont(control).pixelSize : undefined - - leftPadding: __nativeBackground ? background.contentPadding.left: 7 - rightPadding: __nativeBackground ? background.contentPadding.right: 7 - topPadding: __nativeBackground ? background.contentPadding.top: 3 - bottomPadding: __nativeBackground ? background.contentPadding.bottom: 3 - - color: control.palette.text - selectionColor: control.palette.highlight - selectedTextColor: control.palette.highlightedText - placeholderTextColor: control.palette.placeholderText - verticalAlignment: TextInput.AlignTop - - PlaceholderText { - id: placeholder - height: control.height - topPadding: control.topPadding - bottomPadding: control.bottomPadding - leftPadding: control.leftPadding - rightPadding: control.rightPadding - text: control.placeholderText - font: control.font - color: control.placeholderTextColor - verticalAlignment: control.verticalAlignment - visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter) - elide: Text.ElideRight - renderType: control.renderType - } - - background: NativeStyle.TextField { - control: control - contentWidth: Math.max(control.contentWidth, placeholder.implicitWidth) - contentHeight: control.contentHeight - } -} diff --git a/src/quicknativestyle/controls/controls.pri b/src/quicknativestyle/controls/controls.pri deleted file mode 100644 index 8675989e..00000000 --- a/src/quicknativestyle/controls/controls.pri +++ /dev/null @@ -1,14 +0,0 @@ -QML_FILES += \ - $$PWD/DefaultButton.qml \ - $$PWD/DefaultSlider.qml \ - $$PWD/DefaultGroupBox.qml \ - $$PWD/DefaultCheckBox.qml \ - $$PWD/DefaultRadioButton.qml \ - $$PWD/DefaultSpinBox.qml \ - $$PWD/DefaultTextField.qml \ - $$PWD/DefaultFrame.qml \ - $$PWD/DefaultTextArea.qml \ - $$PWD/DefaultComboBox.qml \ - $$PWD/DefaultScrollBar.qml \ - $$PWD/DefaultProgressBar.qml \ - $$PWD/DefaultDial.qml \ |