Initial commit

This commit is contained in:
2026-04-29 07:19:21 +03:00
commit 9a8cdfa08a
5964 changed files with 1194660 additions and 0 deletions
@@ -0,0 +1,53 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
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
readonly property bool __ignoreNotCustomizable: true
}
spacing: 6
icon.width: 24
icon.height: 24
contentItem: IconLabel {
spacing: control.spacing
mirrored: control.mirrored
display: control.display
icon: control.icon
defaultIconColor: control.palette.buttonText
text: control.text
font: control.font
color: defaultIconColor
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,64 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
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
readonly property bool __ignoreNotCustomizable: true
}
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
}
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,105 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
pragma ComponentBehavior: Bound
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
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
readonly property bool __ignoreNotCustomizable: true
}
background: NativeStyle.ComboBox {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
readonly property bool __ignoreNotCustomizable: true
}
delegate: ItemDelegate {
required property var model
required property int index
width: ListView.view.width
text: model[control.textRole]
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
}
}
}
@@ -0,0 +1,29 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
80 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
80 /* minimum */ )
background: NativeStyle.Dial {
control: control
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,76 @@
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.DoubleSpinBox {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + spacing + up.implicitIndicatorWidth
+ leftInset + rightInset,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight
+ (spacing * 3)) + topInset + bottomInset
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: DoubleValidator {
locale: control.locale.name
bottom: Math.min(control.from, control.to)
top: Math.max(control.from, control.to)
decimals: control.decimals
}
contentItem: TextInput {
text: control.displayText
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.DoubleSpinBox {
control: control
subControl: NativeStyle.DoubleSpinBox.Up
x: parent.width - width - spacing
y: (parent.height / 2) - height
useNinePatchImage: false
}
down.indicator: NativeStyle.DoubleSpinBox {
control: control
subControl: NativeStyle.DoubleSpinBox.Down
x: up.indicator.x
y: up.indicator.y + up.indicator.height
useNinePatchImage: false
}
background: NativeStyle.DoubleSpinBox {
control: control
subControl: NativeStyle.DoubleSpinBox.Frame
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
}
}
@@ -0,0 +1,33 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
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
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,58 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding,
implicitLabelWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding)
label: Rectangle {
color: control.palette.window
property point labelPos : control.__nativeBackground
? background.labelPos
: Qt.point(0,0)
readonly property bool __ignoreNotCustomizable: true
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
leftInset: __nativeBackground ? background.groupBoxPadding.left : 0
topInset: __nativeBackground ? background.groupBoxPadding.top : 0
background: NativeStyle.GroupBox {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,33 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.impl
import QtQuick.NativeStyle as NativeStyle
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: 6
spacing: 6
icon.width: 16
icon.height: 16
contentItem: NativeStyle.DefaultItemDelegateIconLabel {}
background: Rectangle {
implicitWidth: 100
implicitHeight: 20
color: Qt.darker(control.highlighted
? control.palette.highlight : control.palette.button, control.down ? 1.05 : 1)
}
}
@@ -0,0 +1,22 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick.Controls.impl
import QtQuick.Templates as T
IconLabel {
text: control.text
font: control.font
icon: control.icon
color: control.palette.windowText
spacing: control.spacing
mirrored: control.mirrored
display: control.display
alignment: control.display === IconLabel.IconOnly || control.display === IconLabel.TextUnderIcon
? Qt.AlignCenter : Qt.AlignLeft
leftPadding: control.indicator && control.mirrored ? control.indicator.width + control.spacing : 0
rightPadding: control.indicator && !control.mirrored ? control.indicator.width + control.spacing : 0
readonly property T.ItemDelegate control: parent as T.ItemDelegate
}
@@ -0,0 +1,28 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
90)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding)
background: NativeStyle.ProgressBar {
control: control
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,62 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
spacing: nativeIndicator ? 0 : 6
padding: nativeIndicator ? 0 : 6
indicator: NativeStyle.RadioButton {
control: control
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
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
}
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,55 @@
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.Controls.impl
import QtQuick.NativeStyle as NativeStyle
T.RadioDelegate {
id: control
readonly property bool __nativeIndicator: indicator instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
readonly property Item __focusFrameTarget: indicator
readonly property Item __focusFrameStyleItem: indicator
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding)
spacing: 6
padding: 6
icon.width: 16
icon.height: 16
contentItem: NativeStyle.DefaultItemDelegateIconLabel {
readonly property bool __ignoreNotCustomizable: true
}
indicator: NativeStyle.RadioDelegate {
x: control.text
? (control.mirrored ? control.leftPadding : control.width - width - control.rightPadding)
: control.leftPadding + (control.availableWidth - width) / 2
y: control.topPadding + Math.round((control.availableHeight - height) / 2)
contentWidth: control.implicitContentWidth
contentHeight: control.implicitContentHeight
useNinePatchImage: false
control: control
readonly property bool __ignoreNotCustomizable: true
}
background: Rectangle {
implicitWidth: 100
implicitHeight: 20
color: Qt.darker(control.highlighted
? control.palette.highlight : control.palette.button, control.down ? 1.05 : 1)
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,33 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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)
visible: policy === T.ScrollBar.AlwaysOn || (policy === T.ScrollBar.AsNeeded && size < 1.0)
minimumSize: !__nativeContentItem ? 0.1 : 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
}
}
@@ -0,0 +1,121 @@
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Window
import QtQuick.Controls
import QtQuick.Controls.impl
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.SearchField {
id: control
readonly property bool __nativeBackground: background instanceof NativeStyle.StyleItem
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding,
searchIndicator.implicitIndicatorHeight + topPadding + bottomPadding,
clearIndicator.implicitIndicatorHeight + topPadding + bottomPadding)
leftPadding: (__nativeBackground ? background.contentPadding.left : 5)
rightPadding: (__nativeBackground ? background.contentPadding.right : 5)
topPadding: (__nativeBackground ? background.contentPadding.top : 2)
bottomPadding: (__nativeBackground ? background.contentPadding.bottom : 2)
delegate: ItemDelegate {
width: ListView.view.width
text: model[control.textRole]
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
required property var model
required property int index
}
contentItem: T.TextField {
topPadding: 6 - control.padding
bottomPadding: 6 - control.padding
text: control.text
font: control.font
color: control.palette.text
selectionColor: control.palette.highlight
selectedTextColor: control.palette.highlightedText
verticalAlignment: Text.AlignVCenter
readonly property bool __ignoreNotCustomizable: true
}
searchIndicator.indicator: NativeStyle.SearchField {
control: control
subControl: NativeStyle.SearchField.Search
y: control.topPadding + (control.availableHeight - height) / 2
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
clearIndicator.indicator: NativeStyle.SearchField {
control: control
subControl: NativeStyle.SearchField.Clear
x: control.width - width - 5
y: control.topPadding + (control.availableHeight - height) / 2
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
background: NativeStyle.SearchField {
control: control
subControl: NativeStyle.SearchField.Frame
contentWidth: contentItem.implicitWidth
contentHeight: contentItem.implicitHeight
useNinePatchImage: false
readonly property bool __ignoreNotCustomizable: true
}
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
}
}
}
@@ -0,0 +1,44 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Controls
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
T.Slider {
id: control
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 */ )
readonly property bool __notCustomizable: true
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
readonly property bool __ignoreNotCustomizable: true
}
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
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,75 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: Math.max(implicitBackgroundWidth + spacing + up.implicitIndicatorWidth
+ leftInset + rightInset,
90 /* minimum */ )
implicitHeight: Math.max(implicitBackgroundHeight, up.implicitIndicatorHeight + down.implicitIndicatorHeight
+ (spacing * 3)) + topInset + bottomInset
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
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
}
}
@@ -0,0 +1,54 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
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
visible: !control.length && !control.preeditText && (!control.activeFocus || control.horizontalAlignment !== Qt.AlignHCenter)
elide: Text.ElideRight
renderType: control.renderType
}
background: Rectangle {
color: control.palette.light
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,57 @@
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
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
readonly property bool __notCustomizable: true
implicitWidth: implicitBackgroundWidth + leftInset + rightInset
|| Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding,
placeholder.implicitHeight + topPadding + bottomPadding)
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
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
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
readonly property bool __ignoreNotCustomizable: true
}
}
@@ -0,0 +1,105 @@
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default
import QtQuick
import QtQuick.Templates as T
import QtQuick.NativeStyle as NativeStyle
import QtQuick.Controls
T.TreeViewDelegate {
id: control
implicitWidth: leftMargin + __contentIndent + implicitContentWidth + rightPadding + rightMargin
implicitHeight: Math.max(indicator ? indicator.height : 0, implicitContentHeight) * 1.25
indentation: indicator ? indicator.width : 12
leftMargin: 4
rightMargin: 4
spacing: 4
topPadding: contentItem ? (height - contentItem.implicitHeight) / 2 : 0
leftPadding: !mirrored ? leftMargin + __contentIndent : width - leftMargin - __contentIndent - implicitContentWidth
highlighted: control.selected || control.current
|| ((control.treeView.selectionBehavior === TableView.SelectRows
|| control.treeView.selectionBehavior === TableView.SelectionDisabled)
&& control.row === control.treeView.currentRow)
required property int row
required property var model
readonly property real __contentIndent: !isTreeNode ? 0 : (depth * indentation) + (indicator ? indicator.width + spacing : 0)
readonly property bool __notCustomizable: true
indicator: Item {
// Create an area that is big enough for the user to
// click on, since the image is a bit small.
readonly property real __indicatorIndent: control.leftMargin + (control.depth * control.indentation)
x: !control.mirrored ? __indicatorIndent : control.width - __indicatorIndent - width
y: (control.height - height) / 2
width: 16
height: 16
NativeStyle.TreeIndicator {
x: (parent.width - width) / 2
y: (parent.height - height) / 2
control: control
useNinePatchImage: false
}
readonly property bool __ignoreNotCustomizable: true
}
background: Rectangle {
color: control.highlighted ? control.palette.highlight
: (control.treeView.alternatingRows && control.row % 2 !== 0
? control.palette.alternateBase : control.palette.base)
readonly property bool __ignoreNotCustomizable: true
}
contentItem: Label {
clip: false
text: control.model.display
elide: Text.ElideRight
color: control.highlighted ? control.palette.highlightedText : control.palette.buttonText
visible: !control.editing
readonly property bool __ignoreNotCustomizable: true
}
// The edit delegate is a separate component, and doesn't need
// to follow the same strict rules that are applied to a control.
// qmllint disable attached-property-reuse
// qmllint disable controls-attached-property-reuse
// qmllint disable controls-sanity
TableView.editDelegate: FocusScope {
width: parent.width
height: parent.height
readonly property int __role: {
let model = control.treeView.model
let index = control.treeView.index(row, column)
let editText = model.data(index, Qt.EditRole)
return editText !== undefined ? Qt.EditRole : Qt.DisplayRole
}
TextField {
id: textField
x: control.contentItem.x
y: (parent.height - height) / 2
width: control.contentItem.width
text: control.treeView.model.data(control.treeView.index(row, column), __role)
focus: true
}
TableView.onCommit: {
let index = TableView.view.index(row, column)
TableView.view.model.setData(index, textField.text, __role)
}
Component.onCompleted: textField.selectAll()
}
// qmllint enable attached-property-reuse
// qmllint enable controls-attached-property-reuse
// qmllint enable controls-sanity
}
@@ -0,0 +1 @@
prefer :/qt-project.org/imports/QtQuick/NativeStyle/