Fix tray visibility and message reception issues
- Disable sound initialization to prevent hanging
- Add missing import re in utils.py
- Fix settings loading for QSettings
- Update file paths to use PROJECT_ROOT
- Revert to working API paths and listener from commit efdc63e
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.AbstractButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.Action { }
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.ActionGroup { }
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ApplicationWindow {
|
||||
id: window
|
||||
|
||||
color: window.palette.window
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Copyright (C) 2017 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.Basic.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: 48
|
||||
implicitHeight: 48
|
||||
|
||||
pen: control.palette.dark
|
||||
fill: control.palette.dark
|
||||
|
||||
running: control.running
|
||||
opacity: control.running ? 1 : 0
|
||||
Behavior on opacity { OpacityAnimator { duration: 250 } }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Button {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
horizontalPadding: padding + 2
|
||||
spacing: 6
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: !control.flat || control.down || control.checked || control.highlighted
|
||||
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
|
||||
control.palette.mid, control.down ? 0.5 : 0.0)
|
||||
border.color: control.visualFocus ? control.palette.highlight : control.palette.windowText
|
||||
border.width: control.visualFocus ? 2 :
|
||||
Qt.styleHints.accessibility.contrastPreference == Qt.HighContrast ? 1 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.ButtonGroup { }
|
||||
@@ -0,0 +1,9 @@
|
||||
// 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
|
||||
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Calendar {}
|
||||
@@ -0,0 +1,7 @@
|
||||
// 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.Templates as T
|
||||
|
||||
T.CalendarModel {}
|
||||
@@ -0,0 +1,68 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
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)
|
||||
|
||||
padding: 6
|
||||
spacing: 6
|
||||
|
||||
// keep in sync with CheckDelegate.qml (shared CheckIndicator.qml was removed for performance reasons)
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
|
||||
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
|
||||
|
||||
color: control.down ? control.palette.light : control.palette.base
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.palette.mid
|
||||
else
|
||||
return Color.blend(control.palette.dark, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
|
||||
ColorImage {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
defaultColor: "#353637"
|
||||
color: control.palette.text
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png"
|
||||
visible: control.checkState === Qt.Checked
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 16
|
||||
height: 3
|
||||
color: control.palette.text
|
||||
visible: control.checkState === Qt.PartiallyChecked
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: CheckLabel {
|
||||
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.palette.windowText
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
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: 12
|
||||
spacing: 12
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.text
|
||||
|
||||
contentItem: IconLabel {
|
||||
leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
|
||||
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.palette.text
|
||||
}
|
||||
|
||||
// keep in sync with CheckBox.qml (shared CheckIndicator.qml was removed for performance reasons)
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
|
||||
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
color: control.down ? control.palette.light : control.palette.base
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.palette.mid
|
||||
else
|
||||
return Color.blend(control.palette.dark, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
|
||||
ColorImage {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
defaultColor: "#353637"
|
||||
color: control.palette.text
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png"
|
||||
visible: control.checkState === Qt.Checked
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 16
|
||||
height: 3
|
||||
color: control.palette.text
|
||||
visible: control.checkState === Qt.PartiallyChecked
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: control.down || control.highlighted
|
||||
color: control.down ? control.palette.midlight : control.palette.light
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
// Copyright (C) 2017 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.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
|
||||
rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
indicator: ColorImage {
|
||||
x: control.mirrored ? control.padding : control.width - width - control.padding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
color: control.palette.dark
|
||||
defaultColor: "#353637"
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/double-arrow.png"
|
||||
opacity: enabled ? 1 : 0.3
|
||||
}
|
||||
|
||||
contentItem: T.TextField {
|
||||
leftPadding: !control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1
|
||||
rightPadding: control.mirrored ? 12 : control.editable && activeFocus ? 3 : 1
|
||||
topPadding: 6 - control.padding
|
||||
bottomPadding: 6 - control.padding
|
||||
|
||||
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
|
||||
|
||||
color: control.editable ? control.palette.text : control.palette.buttonText
|
||||
selectionColor: control.palette.highlight
|
||||
selectedTextColor: control.palette.highlightedText
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
background: Rectangle {
|
||||
visible: control.enabled && control.editable && !control.flat
|
||||
border.width: parent && parent.activeFocus ? 2 : 1
|
||||
border.color: parent && parent.activeFocus ? control.palette.highlight :
|
||||
Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ?
|
||||
control.palette.buttonText : control.palette.button
|
||||
color: control.palette.base
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 140
|
||||
implicitHeight: 40
|
||||
|
||||
color: control.down ? control.palette.mid : control.palette.button
|
||||
border.color: !control.editable && control.visualFocus ? control.palette.highlight : control.palette.buttonText
|
||||
border.width: (!control.editable && control.visualFocus) ? 2 :
|
||||
Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
visible: !control.flat || control.down
|
||||
}
|
||||
|
||||
popup: T.Popup {
|
||||
y: control.height
|
||||
width: control.width
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - topMargin - bottomMargin)
|
||||
topMargin: 6
|
||||
bottomMargin: 6
|
||||
palette: control.palette
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
// Show a contour around the highlighted item in high contrast mode
|
||||
Rectangle {
|
||||
property Item highlightedItem: parent ? parent.itemAtIndex(control.highlightedIndex) : null
|
||||
visible: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast && highlightedItem
|
||||
z: 11
|
||||
x: highlightedItem ? highlightedItem.x : 0
|
||||
y: highlightedItem ? highlightedItem.y : 0
|
||||
width: highlightedItem ? highlightedItem.width : 0
|
||||
height: highlightedItem ? highlightedItem.height : 0
|
||||
color: "transparent"
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
T.ScrollIndicator.vertical: ScrollIndicator { }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.Container {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.Control {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2022 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
|
||||
|
||||
T.AbstractDayOfWeekRow {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(background ? background.implicitWidth : 0,
|
||||
contentItem.implicitWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(background ? background.implicitHeight : 0,
|
||||
contentItem.implicitHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 6
|
||||
topPadding: 6
|
||||
bottomPadding: 6
|
||||
font.bold: true
|
||||
|
||||
//! [delegate]
|
||||
delegate: Text {
|
||||
text: shortName
|
||||
font: control.font
|
||||
color: control.palette.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
required property string shortName
|
||||
}
|
||||
//! [delegate]
|
||||
|
||||
//! [contentItem]
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
Repeater {
|
||||
model: control.source
|
||||
delegate: control.delegate
|
||||
}
|
||||
}
|
||||
//! [contentItem]
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.DelayButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 6
|
||||
horizontalPadding: padding + 2
|
||||
|
||||
transition: Transition {
|
||||
NumberAnimation {
|
||||
duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress)
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ItemGroup {
|
||||
ClippedText {
|
||||
clip: control.progress > 0
|
||||
clipX: -control.leftPadding + control.progress * control.width
|
||||
clipWidth: (1.0 - control.progress) * control.width
|
||||
visible: control.progress < 1
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
opacity: enabled ? 1 : 0.3
|
||||
color: control.palette.buttonText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
ClippedText {
|
||||
clip: control.progress > 0
|
||||
clipX: -control.leftPadding
|
||||
clipWidth: control.progress * control.width
|
||||
visible: control.progress > 0
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
opacity: enabled ? 1 : 0.3
|
||||
color: control.palette.brightText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
color: Color.blend(control.palette.button, control.palette.mid, control.down ? 0.5 : 0.0)
|
||||
border.color: control.visualFocus ? control.palette.highlight : control.palette.windowText
|
||||
border.width: control.visualFocus ? 2 :
|
||||
Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
|
||||
PaddedRectangle {
|
||||
padding: control.visualFocus ? 2 : 0
|
||||
width: control.progress * parent.width
|
||||
height: parent.height
|
||||
color: Color.blend(control.palette.dark, control.palette.mid, control.down ? 0.5 : 0.0)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Controls.Basic.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Dial {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
background: DialImpl {
|
||||
implicitWidth: 184
|
||||
implicitHeight: 184
|
||||
color: control.visualFocus ? control.palette.highlight : control.palette.dark
|
||||
progress: control.position
|
||||
opacity: control.enabled ? 1 : 0.3
|
||||
startAngle: control.startAngle
|
||||
endAngle: control.endAngle
|
||||
}
|
||||
|
||||
handle: ColorImage {
|
||||
x: control.background.x + control.background.width / 2 - width / 2
|
||||
y: control.background.y + control.background.height / 2 - height / 2
|
||||
width: 14
|
||||
height: 10
|
||||
defaultColor: "#353637"
|
||||
color: control.visualFocus ? control.palette.highlight : control.palette.dark
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/dial-indicator.png"
|
||||
antialiasing: true
|
||||
opacity: control.enabled ? 1 : 0.3
|
||||
transform: [
|
||||
Translate {
|
||||
y: -Math.min(control.background.width, control.background.height) * 0.4
|
||||
+ (control.handle ? control.handle.height / 2 : 0)
|
||||
},
|
||||
Rotation {
|
||||
angle: control.angle
|
||||
origin.x: control.handle ? control.handle.width / 2 : 0
|
||||
origin.y: control.handle ? control.handle.height / 2 : 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.Dialog {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
padding: 12
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
visible: parent?.parent === Overlay.overlay && control.title
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
padding: 12
|
||||
background: Rectangle {
|
||||
x: 1; y: 1
|
||||
width: parent.width - 2
|
||||
height: parent.height - 1
|
||||
color: control.palette.window
|
||||
}
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
visible: count > 0
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// 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
|
||||
|
||||
T.DialogButtonBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
(control.count === 1 ? implicitContentWidth * 2 : implicitContentWidth) + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
contentWidth: (contentItem as ListView)?.contentWidth
|
||||
|
||||
spacing: 1
|
||||
padding: 12
|
||||
alignment: count === 1 ? Qt.AlignRight : undefined
|
||||
|
||||
delegate: Button {
|
||||
width: control.count === 1 ? control.availableWidth / 2 : undefined
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
implicitWidth: contentWidth
|
||||
model: control.contentModel
|
||||
spacing: control.spacing
|
||||
orientation: ListView.Horizontal
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
snapMode: ListView.SnapToItem
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 40
|
||||
x: 1; y: 1
|
||||
width: parent.width - 2
|
||||
height: parent.height - 2
|
||||
color: control.palette.window
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Drawer {
|
||||
id: control
|
||||
|
||||
parent: T.Overlay.overlay
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: SafeArea.margins.top + (control.edge === Qt.BottomEdge)
|
||||
leftPadding: SafeArea.margins.left + (control.edge === Qt.RightEdge)
|
||||
rightPadding: SafeArea.margins.right + (control.edge === Qt.LeftEdge)
|
||||
bottomPadding: SafeArea.margins.bottom + (control.edge === Qt.TopEdge)
|
||||
|
||||
enter: Transition { SmoothedAnimation { velocity: 5 } }
|
||||
exit: Transition { SmoothedAnimation { velocity: 5 } }
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
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.palette.dark
|
||||
x: control.edge === Qt.LeftEdge ? parent.width - 1 : 0
|
||||
y: control.edge === Qt.TopEdge ? parent.height - 1 : 0
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Frame {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast ?
|
||||
control.palette.mid : Color.blend(control.palette.dark, control.palette.base,
|
||||
enabled ? 0.0 : 0.5)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.GroupBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitLabelWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 6
|
||||
padding: 12
|
||||
topPadding: padding + (implicitLabelWidth > 0 ? implicitLabelHeight + spacing : 0)
|
||||
|
||||
label: Text {
|
||||
x: control.leftPadding
|
||||
width: control.availableWidth
|
||||
|
||||
text: control.title
|
||||
font: control.font
|
||||
color: control.palette.windowText
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
y: control.topPadding - control.bottomPadding
|
||||
width: parent.width
|
||||
height: parent.height - control.topPadding + control.bottomPadding
|
||||
|
||||
color: "transparent"
|
||||
border.color: Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast ?
|
||||
control.palette.mid : Color.blend(control.palette.dark, control.palette.base,
|
||||
enabled ? 0.0 : 0.5)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// 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.Templates as T
|
||||
|
||||
T.HorizontalHeaderView {
|
||||
id: control
|
||||
|
||||
implicitWidth: syncView ? syncView.width : 0
|
||||
// The contentHeight of TableView will be zero at start-up, until the delegate
|
||||
// items have been loaded. This means that even if the implicit height of
|
||||
// HorizontalHeaderView should be the same as the content height in the end, we
|
||||
// need to ensure that it has at least a height of 1 at start-up, otherwise
|
||||
// TableView won't bother loading any delegates at all.
|
||||
implicitHeight: Math.max(1, contentHeight)
|
||||
|
||||
delegate: HorizontalHeaderViewDelegate { }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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.Templates as T
|
||||
|
||||
T.HeaderViewDelegate {
|
||||
id: control
|
||||
|
||||
// same as AbstractButton.qml
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 8
|
||||
|
||||
highlighted: selected
|
||||
|
||||
background: Rectangle {
|
||||
border.color: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ?
|
||||
control.palette.windowText : control.palette.midlight
|
||||
color: control.palette.light
|
||||
}
|
||||
|
||||
contentItem: Label {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: control.palette.windowText
|
||||
text: control.model[control.headerView.textRole]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: 12
|
||||
spacing: 8
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.text
|
||||
|
||||
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.highlighted ? control.palette.highlightedText : control.palette.text
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: control.down || control.highlighted || control.visualFocus
|
||||
color: Color.blend(control.down ? control.palette.midlight : control.palette.light,
|
||||
control.palette.highlight, control.visualFocus ? 0.15 : 0.0)
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: control.highlighted ? control.palette.highlight : control.palette.text
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Label {
|
||||
id: control
|
||||
|
||||
color: control.palette.windowText
|
||||
linkColor: control.palette.link
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Menu {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
margins: 0
|
||||
overlap: 1
|
||||
|
||||
delegate: MenuItem { }
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight
|
||||
model: control.contentModel
|
||||
interactive: Window.window
|
||||
? contentHeight + control.topPadding + control.bottomPadding > control.height
|
||||
: false
|
||||
clip: true
|
||||
currentIndex: control.currentIndex
|
||||
|
||||
ScrollIndicator.vertical: ScrollIndicator {}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 40
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.MenuBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: SafeArea.margins.top
|
||||
leftPadding: SafeArea.margins.left
|
||||
rightPadding: SafeArea.margins.right
|
||||
bottomPadding: SafeArea.margins.bottom
|
||||
|
||||
delegate: MenuBarItem { }
|
||||
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
Repeater {
|
||||
model: control.contentModel
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 40
|
||||
color: control.palette.button
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
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)
|
||||
|
||||
spacing: 6
|
||||
padding: 6
|
||||
leftPadding: 12
|
||||
rightPadding: 16
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.buttonText
|
||||
|
||||
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.palette.buttonText
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
color: control.down || control.highlighted ? control.palette.mid : "transparent"
|
||||
border.color: control.palette.dark
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast &&
|
||||
control.highlighted ? 1 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: 6
|
||||
spacing: 6
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.windowText
|
||||
|
||||
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.palette.windowText
|
||||
}
|
||||
|
||||
indicator: ColorImage {
|
||||
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
visible: control.checked
|
||||
source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/check.png" : ""
|
||||
color: control.palette.windowText
|
||||
defaultColor: "#353637"
|
||||
}
|
||||
|
||||
arrow: ColorImage {
|
||||
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
visible: control.subMenu
|
||||
mirror: control.mirrored
|
||||
source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/arrow-indicator.png" : ""
|
||||
color: control.palette.windowText
|
||||
defaultColor: "#353637"
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 40
|
||||
x: 1
|
||||
y: 1
|
||||
width: control.width - 2
|
||||
height: control.height - 2
|
||||
color: control.down ? control.palette.midlight : control.highlighted ? control.palette.light : "transparent"
|
||||
border.color: control.palette.dark
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast && control.highlighted ? 1 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.MenuSeparator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 2
|
||||
verticalPadding: padding + 4
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 188
|
||||
implicitHeight: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 2 : 1
|
||||
color: control.palette.mid
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
// Copyright (C) 2022 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
|
||||
|
||||
T.AbstractMonthGrid {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(background ? background.implicitWidth : 0,
|
||||
contentItem.implicitWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(background ? background.implicitHeight : 0,
|
||||
contentItem.implicitHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 6
|
||||
|
||||
//! [delegate]
|
||||
delegate: Text {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
opacity: model.month === control.month ? 1 : 0
|
||||
text: model.day
|
||||
font: control.font
|
||||
color: control.palette.text
|
||||
|
||||
required property var model
|
||||
}
|
||||
//! [delegate]
|
||||
|
||||
//! [contentItem]
|
||||
contentItem: Grid {
|
||||
rows: 6
|
||||
columns: 7
|
||||
rowSpacing: control.spacing
|
||||
columnSpacing: control.spacing
|
||||
|
||||
Repeater {
|
||||
model: control.source
|
||||
delegate: control.delegate
|
||||
}
|
||||
}
|
||||
//! [contentItem]
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Page {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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.palette.dark
|
||||
|
||||
opacity: index === control.currentIndex ? 0.95 : pressed ? 0.7 : 0.45
|
||||
|
||||
required property int index
|
||||
|
||||
Behavior on opacity { OpacityAnimator { duration: 100 } }
|
||||
}
|
||||
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
|
||||
Repeater {
|
||||
model: control.count
|
||||
delegate: control.delegate
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Pane {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Popup {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 12
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
border.color: control.palette.dark
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.5)
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.12)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2017 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.Basic.impl
|
||||
|
||||
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: 6
|
||||
implicitWidth: 116
|
||||
scale: control.mirrored ? -1 : 1
|
||||
progress: control.position
|
||||
indeterminate: control.visible && control.indeterminate
|
||||
color: control.palette.dark
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 6
|
||||
y: (control.height - height) / 2
|
||||
height: 6
|
||||
|
||||
color: control.palette.midlight
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
padding: 6
|
||||
spacing: 6
|
||||
|
||||
// keep in sync with RadioDelegate.qml (shared RadioIndicator.qml was removed for performance reasons)
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
|
||||
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
|
||||
|
||||
radius: width / 2
|
||||
color: control.down ? control.palette.light : control.palette.base
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.palette.mid
|
||||
else
|
||||
return Color.blend(control.palette.dark, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 20
|
||||
height: 20
|
||||
radius: width / 2
|
||||
color: control.palette.text
|
||||
visible: control.checked
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: CheckLabel {
|
||||
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.palette.windowText
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: 12
|
||||
spacing: 12
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.text
|
||||
|
||||
contentItem: IconLabel {
|
||||
leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
|
||||
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.palette.text
|
||||
}
|
||||
|
||||
// keep in sync with RadioButton.qml (shared RadioIndicator.qml was removed for performance reasons)
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
|
||||
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
radius: width / 2
|
||||
color: control.down ? control.palette.light : control.palette.base
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.palette.mid
|
||||
else
|
||||
return Color.blend(control.palette.dark, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 20
|
||||
height: 20
|
||||
radius: width / 2
|
||||
color: control.palette.text
|
||||
visible: control.checked
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: control.down || control.highlighted
|
||||
color: control.down ? control.palette.midlight : control.palette.light
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.RangeSlider {
|
||||
id: control
|
||||
|
||||
readonly property color handleBorderColor: {
|
||||
if (activeFocus)
|
||||
return palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return enabled ? palette.mid : palette.midlight
|
||||
else
|
||||
return enabled ? palette.windowText : palette.mid
|
||||
}
|
||||
|
||||
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: Rectangle {
|
||||
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))
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
radius: width / 2
|
||||
border.width: activeFocus ? 2 : 1
|
||||
border.color: control.handleBorderColor
|
||||
color: control.first.pressed ? control.palette.light : control.palette.window
|
||||
}
|
||||
|
||||
second.handle: Rectangle {
|
||||
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))
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
radius: width / 2
|
||||
border.width: activeFocus ? 2 : 1
|
||||
border.color: control.handleBorderColor
|
||||
color: control.second.pressed ? control.palette.light : control.palette.window
|
||||
}
|
||||
|
||||
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 : 6
|
||||
implicitHeight: control.horizontal ? 6 : 200
|
||||
width: control.horizontal ? control.availableWidth : implicitWidth
|
||||
height: control.horizontal ? implicitHeight : control.availableHeight
|
||||
radius: 3
|
||||
color: control.palette.midlight
|
||||
scale: control.horizontal && control.mirrored ? -1 : 1
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: enabled ? control.palette.dark : control.palette.mid
|
||||
|
||||
Rectangle {
|
||||
x: control.horizontal ? control.first.position * parent.width + 3 : 0
|
||||
y: control.horizontal ? 0 : control.second.visualPosition * parent.height + 3
|
||||
width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6
|
||||
height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6
|
||||
|
||||
color: control.palette.dark
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.RoundButton {
|
||||
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: 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
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
radius: control.radius
|
||||
opacity: enabled ? 1 : 0.3
|
||||
visible: !control.flat || control.down || control.checked || control.highlighted
|
||||
color: Color.blend(control.checked || control.highlighted ? control.palette.dark : control.palette.button,
|
||||
control.palette.mid, control.down ? 0.5 : 0.0)
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast)
|
||||
return Color.blend(control.palette.text, control.palette.dark,
|
||||
control.enabled ? 0.0 : 0.3)
|
||||
else
|
||||
return control.palette.windowText
|
||||
}
|
||||
border.width: control.visualFocus ? 2 :
|
||||
(Qt.styleHints.accessibility.contrastPreference == Qt.HighContrast) ? 1 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ScrollBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 2
|
||||
visible: control.policy !== T.ScrollBar.AlwaysOff
|
||||
minimumSize: orientation === Qt.Horizontal ? height / width : width / height
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: control.interactive ? 6 : 2
|
||||
implicitHeight: control.interactive ? 6 : 2
|
||||
|
||||
radius: width / 2
|
||||
color: {
|
||||
if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return pressed ? control.palette.dark : control.palette.mid
|
||||
else
|
||||
return Color.blend(control.palette.text, control.palette.mid, pressed ? 0.0 : 0.3)
|
||||
}
|
||||
|
||||
opacity: 0.0
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
|
||||
PropertyChanges { control.contentItem.opacity: 0.75 }
|
||||
}
|
||||
|
||||
transitions: Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 450 }
|
||||
NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
visible: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
opacity: control.contentItem.opacity
|
||||
color: control.palette.mid
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: 2
|
||||
implicitHeight: 2
|
||||
|
||||
color: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ?
|
||||
control.palette.text : control.palette.mid
|
||||
visible: control.size < 1.0
|
||||
opacity: 0.0
|
||||
|
||||
states: State {
|
||||
name: "active"
|
||||
when: control.active
|
||||
PropertyChanges { control.contentItem.opacity: 0.75 }
|
||||
}
|
||||
|
||||
transitions: [
|
||||
Transition {
|
||||
from: "active"
|
||||
SequentialAnimation {
|
||||
PauseAnimation { duration: 450 }
|
||||
NumberAnimation { target: control.contentItem; duration: 200; property: "opacity"; to: 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
visible: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
opacity: control.contentItem.opacity
|
||||
color: control.palette.mid
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ScrollView {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
ScrollBar.vertical: ScrollBar {
|
||||
parent: control
|
||||
x: control.mirrored ? 0 : control.width - width
|
||||
y: control.topPadding
|
||||
height: control.availableHeight
|
||||
active: control.ScrollBar.horizontal.active
|
||||
}
|
||||
|
||||
ScrollBar.horizontal: ScrollBar {
|
||||
parent: control
|
||||
x: control.leftPadding
|
||||
y: control.height - height
|
||||
width: control.availableWidth
|
||||
active: control.ScrollBar.vertical.active
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
// 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.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.SearchField {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
searchIndicator.implicitIndicatorHeight + topPadding + bottomPadding,
|
||||
clearIndicator.implicitIndicatorHeight + topPadding + bottomPadding)
|
||||
|
||||
leftPadding: padding + (control.mirrored || !searchIndicator.indicator || !searchIndicator.indicator.visible ? 0 : searchIndicator.indicator.width + spacing)
|
||||
rightPadding: padding + (control.mirrored || !clearIndicator.indicator || !clearIndicator.indicator.visible ? 0 : clearIndicator.indicator.width + spacing)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
searchIndicator.indicator: Rectangle {
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
|
||||
x: !control.mirrored ? 3 : control.width - width - 3
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
color: control.palette.button
|
||||
|
||||
ColorImage {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
color: control.palette.dark
|
||||
defaultColor: "#353637"
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/search-magnifier.png"
|
||||
opacity: enabled ? 1 : 0.3
|
||||
}
|
||||
}
|
||||
|
||||
clearIndicator.indicator: Rectangle {
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
|
||||
x: control.mirrored ? 3 : control.width - width - 3
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
visible: control.text.length > 0
|
||||
color: control.palette.button
|
||||
|
||||
ColorImage {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
color: control.palette.dark
|
||||
defaultColor: "#353637"
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/close_circle.png"
|
||||
opacity: enabled ? 1 : 0.3
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: T.TextField {
|
||||
leftPadding: control.searchIndicator.indicator && !control.mirrored ? 6 : 0
|
||||
rightPadding: control.clearIndicator.indicator && !control.mirrored ? 6 : 0
|
||||
topPadding: 6 - control.padding
|
||||
bottomPadding: 6 - control.padding
|
||||
|
||||
text: control.text
|
||||
|
||||
color: control.palette.text
|
||||
selectionColor: control.palette.highlight
|
||||
selectedTextColor: control.palette.highlightedText
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 40
|
||||
|
||||
color: control.palette.button
|
||||
border.width: (control.activeFocus || control.contentItem.activeFocus) ? 2 : 1
|
||||
border.color: (control.activeFocus || control.contentItem.activeFocus) ? control.palette.highlight : control.palette.mid
|
||||
}
|
||||
|
||||
popup: T.Popup {
|
||||
y: control.height
|
||||
width: control.width
|
||||
height: Math.min(contentItem.implicitHeight, control.Window.height - control.y - control.height - control.padding)
|
||||
topMargin: 6
|
||||
bottomMargin: 6
|
||||
palette: control.palette
|
||||
|
||||
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) 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.Controls.impl
|
||||
import QtQuick.Shapes
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.SelectionRectangle {
|
||||
id: control
|
||||
|
||||
topLeftHandle: Handle {}
|
||||
bottomRightHandle: Handle {}
|
||||
|
||||
component Handle : Rectangle {
|
||||
id: handle
|
||||
width: 28
|
||||
height: width
|
||||
radius: width / 2
|
||||
color: SelectionRectangle.dragging ? control.palette.light : control.palette.window
|
||||
border.width: 1
|
||||
border.color: control.enabled ? control.palette.mid : control.palette.midlight
|
||||
visible: SelectionRectangle.control.active
|
||||
|
||||
property Item control: SelectionRectangle.control
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: Rectangle {
|
||||
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))
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
radius: width / 2
|
||||
color: control.pressed ? control.palette.light : control.palette.window
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (activeFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.enabled ? control.palette.mid : control.palette.midlight
|
||||
else
|
||||
return control.enabled ? control.palette.windowText : control.palette.mid
|
||||
}
|
||||
}
|
||||
|
||||
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 : 6
|
||||
implicitHeight: control.horizontal ? 6 : 200
|
||||
width: control.horizontal ? control.availableWidth : implicitWidth
|
||||
height: control.horizontal ? implicitHeight : control.availableHeight
|
||||
radius: 3
|
||||
color: control.palette.midlight
|
||||
scale: control.horizontal && control.mirrored ? -1 : 1
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: enabled ? control.palette.dark : control.palette.mid
|
||||
|
||||
Rectangle {
|
||||
y: control.horizontal ? 0 : control.visualPosition * parent.height
|
||||
width: control.horizontal ? control.position * parent.width : 6
|
||||
height: control.horizontal ? 6 : control.position * parent.height
|
||||
|
||||
radius: 3
|
||||
color: control.palette.dark
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.SpinBox {
|
||||
id: control
|
||||
|
||||
// Note: the width of the indicators are calculated into the padding
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentItem.implicitWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding,
|
||||
up.implicitIndicatorHeight, down.implicitIndicatorHeight)
|
||||
|
||||
leftPadding: padding + (control.mirrored ? (up.indicator ? up.indicator.width : 0) : (down.indicator ? down.indicator.width : 0))
|
||||
rightPadding: padding + (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 {
|
||||
z: 2
|
||||
text: control.displayText
|
||||
clip: width < implicitWidth
|
||||
padding: 6
|
||||
|
||||
font: control.font
|
||||
color: control.palette.text
|
||||
selectionColor: control.palette.highlight
|
||||
selectedTextColor: control.palette.highlightedText
|
||||
horizontalAlignment: Qt.AlignHCenter
|
||||
verticalAlignment: Qt.AlignVCenter
|
||||
|
||||
readOnly: !control.editable
|
||||
validator: control.validator
|
||||
inputMethodHints: control.inputMethodHints
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
visible: control.activeFocus
|
||||
color: "transparent"
|
||||
border.color: control.palette.highlight
|
||||
border.width: 2
|
||||
}
|
||||
}
|
||||
|
||||
up.indicator: Rectangle {
|
||||
x: control.mirrored ? 0 : control.width - width
|
||||
height: control.height
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
color: control.up.pressed ? control.palette.mid : control.palette.button
|
||||
border.color: enabled ? control.palette.text : control.palette.mid
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: parent.width / 3
|
||||
height: 2
|
||||
color: enabled ? control.palette.buttonText : control.palette.mid
|
||||
}
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 2
|
||||
height: parent.width / 3
|
||||
color: enabled ? control.palette.buttonText : control.palette.mid
|
||||
}
|
||||
}
|
||||
|
||||
down.indicator: Rectangle {
|
||||
x: control.mirrored ? parent.width - width : 0
|
||||
height: control.height
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
color: control.down.pressed ? control.palette.mid : control.palette.button
|
||||
border.color: enabled ? control.palette.text : control.palette.mid
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: parent.width / 3
|
||||
height: 2
|
||||
color: enabled ? control.palette.buttonText : control.palette.mid
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 140
|
||||
color: enabled ? control.palette.base : control.palette.button
|
||||
border.color: {
|
||||
if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.palette.button
|
||||
return enabled ? control.palette.text : control.palette.mid
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright (C) 2018 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
|
||||
|
||||
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.palette.mid
|
||||
: (T.SplitHandle.hovered ? control.palette.midlight : control.palette.button)
|
||||
border.color: control.palette.dark
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.StackView {
|
||||
id: control
|
||||
|
||||
popEnter: Transition {
|
||||
XAnimator { from: (control.mirrored ? -1 : 1) * -control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
popExit: Transition {
|
||||
XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * control.width; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
pushEnter: Transition {
|
||||
XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
pushExit: Transition {
|
||||
XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
replaceEnter: Transition {
|
||||
XAnimator { from: (control.mirrored ? -1 : 1) * control.width; to: 0; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
|
||||
replaceExit: Transition {
|
||||
XAnimator { from: 0; to: (control.mirrored ? -1 : 1) * -control.width; duration: 400; easing.type: Easing.OutCubic }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: 12
|
||||
spacing: 12
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.text
|
||||
|
||||
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.palette.text
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
color: Color.blend(control.down ? control.palette.midlight : control.palette.light,
|
||||
control.palette.highlight, control.visualFocus ? 0.15 : 0.0)
|
||||
// The condition of (control.down || control.highlighted || control.visualFocus)
|
||||
// came from the ItemDelegate.qml
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast &&
|
||||
(control.down || control.highlighted || control.visualFocus) ? 1 : 0
|
||||
border.color: control.down || control.highlighted || control.visualFocus ?
|
||||
control.palette.highlightedText : control.palette.text
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.SwipeView {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + 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,69 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
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: 6
|
||||
spacing: 6
|
||||
|
||||
indicator: PaddedRectangle {
|
||||
implicitWidth: 56
|
||||
implicitHeight: 28
|
||||
|
||||
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
|
||||
|
||||
radius: 8
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
padding: (height - 16) / 2
|
||||
color: control.checked ? control.palette.dark : control.palette.midlight
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: Color.blend(control.palette.dark, control.palette.base, enabled ? 0.0 : 0.5)
|
||||
|
||||
Rectangle {
|
||||
x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2)))
|
||||
y: (parent.height - height) / 2
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 16
|
||||
color: control.down ? control.palette.light : control.palette.window
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight;
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.enabled ? control.palette.mid : control.palette.midlight
|
||||
else
|
||||
return Color.blend(control.palette.dark, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
|
||||
Behavior on x {
|
||||
enabled: !control.down
|
||||
SmoothedAnimation { velocity: 200 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: CheckLabel {
|
||||
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.palette.windowText
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
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: 12
|
||||
spacing: 12
|
||||
|
||||
icon.width: 24
|
||||
icon.height: 24
|
||||
icon.color: control.palette.text
|
||||
|
||||
indicator: PaddedRectangle {
|
||||
implicitWidth: 56
|
||||
implicitHeight: 28
|
||||
|
||||
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
|
||||
|
||||
radius: 8
|
||||
leftPadding: 0
|
||||
rightPadding: 0
|
||||
padding: (height - 16) / 2
|
||||
color: control.checked ? control.palette.dark : control.palette.midlight
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: Color.blend(control.palette.dark, control.palette.base, enabled ? 0.0 : 0.5)
|
||||
|
||||
Rectangle {
|
||||
x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2)))
|
||||
y: (parent.height - height) / 2
|
||||
width: 28
|
||||
height: 28
|
||||
radius: 16
|
||||
color: control.down ? control.palette.light : control.palette.window
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight;
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.enabled ? control.palette.mid : control.palette.midlight
|
||||
else
|
||||
return Color.blend(control.palette.dark, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
|
||||
Behavior on x {
|
||||
enabled: !control.down
|
||||
SmoothedAnimation { velocity: 200 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: IconLabel {
|
||||
leftPadding: control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: !control.mirrored ? control.indicator.width + control.spacing : 0
|
||||
|
||||
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.palette.text
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 100
|
||||
implicitHeight: 40
|
||||
visible: control.down || control.highlighted
|
||||
color: control.down ? control.palette.midlight : control.palette.light
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
// Copyright (C) 2017 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
|
||||
|
||||
T.TabBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + 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: 0
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
preferredHighlightBegin: 40
|
||||
preferredHighlightEnd: width - 40
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.palette.window
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.TabButton {
|
||||
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: checked ? control.palette.windowText : control.palette.brightText
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.checked ? control.palette.windowText : control.palette.brightText
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 40
|
||||
color: Color.blend(control.checked ? control.palette.window : control.palette.dark,
|
||||
control.palette.mid, control.down ? 0.5 : 0.0)
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: control.palette.windowText
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import Qt.labs.qmlmodels as QtLabsQmlModels
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.TableViewDelegate {
|
||||
id: control
|
||||
|
||||
// same as AbstractButton.qml
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
highlighted: control.selected
|
||||
|
||||
required property int column
|
||||
required property int row
|
||||
required property var model
|
||||
|
||||
background: Rectangle {
|
||||
border.width: control.current ? 2 : Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
border.color: control.current ? control.palette.highlight : control.palette.windowText
|
||||
color: control.highlighted
|
||||
? control.palette.highlight
|
||||
: (control.tableView.alternatingRows && control.row % 2 !== 0
|
||||
? control.palette.alternateBase : control.palette.base)
|
||||
}
|
||||
|
||||
contentItem: Label {
|
||||
clip: false
|
||||
text: control.model.display ?? ""
|
||||
elide: Text.ElideRight
|
||||
color: control.highlighted ? control.palette.highlightedText : control.palette.buttonText
|
||||
visible: !control.editing
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
TableView.onCommit: {
|
||||
let model = control.tableView.model
|
||||
if (!model)
|
||||
return
|
||||
// The setData() APIs are different in QAbstractItemModel and QQmlTableModel.
|
||||
// This is an issue and will be fixed later, probably by deprecating the wrong
|
||||
// API in QQmlTableModel. There is a ticket reported this issue and a workaround
|
||||
// is provided in the description: https://bugreports.qt.io/browse/QTBUG-104733
|
||||
// But temporarily we need to manage this by checking the model's type.
|
||||
let succeed = false
|
||||
const index = model.index(control.row, control.column)
|
||||
if (model instanceof QtLabsQmlModels.TableModel)
|
||||
succeed = model.setData(index, "edit", textField.text)
|
||||
else
|
||||
succeed = model.setData(index, textField.text, Qt.EditRole)
|
||||
if (!succeed)
|
||||
console.warn("The model does not allow setting the EditRole data.")
|
||||
}
|
||||
|
||||
Component.onCompleted: textField.selectAll()
|
||||
|
||||
TextField {
|
||||
id: textField
|
||||
anchors.fill: parent
|
||||
text: control.model.edit ?? control.model.display ?? ""
|
||||
focus: true
|
||||
}
|
||||
}
|
||||
// qmllint enable attached-property-reuse
|
||||
// qmllint enable controls-attached-property-reuse
|
||||
// qmllint enable controls-sanity
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
padding: 6
|
||||
leftPadding: padding + 4
|
||||
|
||||
color: control.palette.text
|
||||
placeholderTextColor: control.palette.placeholderText
|
||||
selectionColor: control.palette.highlight
|
||||
selectedTextColor: control.palette.highlightedText
|
||||
|
||||
background: Rectangle {
|
||||
visible: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
color: "transparent"
|
||||
border.width: control.activeFocus ? 2 : 1
|
||||
border.color: control.activeFocus ? control.palette.highlight :
|
||||
control.enabled ? control.palette.mid : control.palette.midlight
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
padding: 6
|
||||
leftPadding: padding + 4
|
||||
|
||||
color: control.palette.text
|
||||
selectionColor: control.palette.highlight
|
||||
selectedTextColor: control.palette.highlightedText
|
||||
placeholderTextColor: control.palette.placeholderText
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
|
||||
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 {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 40
|
||||
border.width: control.activeFocus ? 2 : 1
|
||||
color: control.palette.base
|
||||
border.color: {
|
||||
if (control.activeFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast)
|
||||
return control.palette.mid
|
||||
else
|
||||
return Color.blend(control.palette.text, control.palette.base,
|
||||
control.enabled ? 0.0 : 0.5)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ToolBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: SafeArea.margins.top
|
||||
leftPadding: SafeArea.margins.left
|
||||
rightPadding: SafeArea.margins.right
|
||||
bottomPadding: SafeArea.margins.bottom
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 40
|
||||
color: control.palette.button
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: visualFocus ? control.palette.highlight : 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.visualFocus ? control.palette.highlight : control.palette.buttonText
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 40
|
||||
implicitHeight: 40
|
||||
|
||||
opacity: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast || control.down ? 1.0 : 0.5
|
||||
color: control.down || control.checked || control.highlighted ? control.palette.mid : control.palette.button
|
||||
|
||||
border.color: {
|
||||
if (control.visualFocus)
|
||||
return control.palette.highlight
|
||||
else if (Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast)
|
||||
return Color.blend(control.palette.buttonText, control.palette.button,
|
||||
control.enabled ? 0.0 : 0.8)
|
||||
else
|
||||
return control.palette.windowText
|
||||
}
|
||||
border.width: control.visualFocus ? 2 :
|
||||
Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 1 : 0
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ToolSeparator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: vertical ? 6 : 2
|
||||
verticalPadding: vertical ? 2 : 6
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: control.vertical ? (Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 2 : 1) : 30
|
||||
implicitHeight: control.vertical ? 30 : (Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 2 : 1)
|
||||
color: control.palette.mid
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ToolTip {
|
||||
id: control
|
||||
|
||||
x: parent ? (parent.width - implicitWidth) / 2 : 0
|
||||
y: -implicitHeight - 3
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
margins: 6
|
||||
padding: 6
|
||||
|
||||
closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent
|
||||
|
||||
contentItem: Text {
|
||||
text: control.text
|
||||
font: control.font
|
||||
wrapMode: Text.Wrap
|
||||
color: control.palette.toolTipText
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
border.color: control.palette.dark
|
||||
color: control.palette.toolTipBase
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
// 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.Controls.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
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
|
||||
implicitWidth: 20
|
||||
implicitHeight: 40 // same as Button.qml
|
||||
ColorImage {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
rotation: control.expanded ? 90 : (control.mirrored ? 180 : 0)
|
||||
source: "qrc:/qt-project.org/imports/QtQuick/Controls/Basic/images/arrow-indicator.png"
|
||||
color: control.palette.windowText
|
||||
defaultColor: "#353637"
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitHeight: 40 // same as Button.qml
|
||||
border.color: control.current ? control.palette.highlight : control.palette.windowText
|
||||
border.width: Qt.styleHints.accessibility.contrastPreference !== Qt.HighContrast ? 0 :
|
||||
control.current ? 2 : 1
|
||||
color: control.highlighted
|
||||
? control.palette.highlight
|
||||
: (control.treeView.alternatingRows && control.row % 2 !== 0
|
||||
? control.palette.alternateBase : control.palette.base)
|
||||
}
|
||||
|
||||
contentItem: Label {
|
||||
clip: false
|
||||
text: control.model.display
|
||||
elide: Text.ElideRight
|
||||
color: control.highlighted ? control.palette.highlightedText : control.palette.buttonText
|
||||
visible: !control.editing
|
||||
}
|
||||
|
||||
// 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,55 @@
|
||||
// Copyright (C) 2017 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Tumbler {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
readonly property real __delegateHeight: availableHeight / visibleItemCount
|
||||
|
||||
delegate: Text {
|
||||
text: modelData
|
||||
color: control.visualFocus ? control.palette.highlight : control.palette.text
|
||||
font: control.font
|
||||
opacity: 1.0 - Math.abs(Tumbler.displacement) / (control.visibleItemCount / 2)
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
// We use required property here to satisfy qmllint, but that means
|
||||
// we also need to declare the index for the attached properties
|
||||
// (see QQuickTumblerAttachedPrivate::init).
|
||||
required property var modelData
|
||||
required property int index
|
||||
}
|
||||
|
||||
contentItem: TumblerView {
|
||||
implicitWidth: 60
|
||||
implicitHeight: 200
|
||||
model: control.model
|
||||
delegate: control.delegate
|
||||
path: Path {
|
||||
startX: control.contentItem.width / 2
|
||||
startY: -control.__delegateHeight / 2
|
||||
|
||||
PathLine {
|
||||
x: control.contentItem.width / 2
|
||||
y: (control.visibleItemCount + 1) * control.__delegateHeight - control.__delegateHeight / 2
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
visible: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
border.color: control.visualFocus ? control.palette.highlight : control.palette.windowText
|
||||
border.width: control.visualFocus ? 2 : 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// 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.Templates as T
|
||||
|
||||
T.VerticalHeaderView {
|
||||
id: control
|
||||
|
||||
// The contentWidth of TableView will be zero at start-up, until the delegate
|
||||
// items have been loaded. This means that even if the implicit width of
|
||||
// VerticalHeaderView should be the same as the content width in the end, we
|
||||
// need to ensure that it has at least a width of 1 at start-up, otherwise
|
||||
// TableView won't bother loading any delegates at all.
|
||||
implicitWidth: Math.max(1, contentWidth)
|
||||
implicitHeight: syncView ? syncView.height : 0
|
||||
|
||||
delegate: VerticalHeaderViewDelegate { }
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
// 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.Templates as T
|
||||
|
||||
T.HeaderViewDelegate {
|
||||
id: control
|
||||
|
||||
// same as AbstractButton.qml
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
padding: 8
|
||||
|
||||
highlighted: selected
|
||||
|
||||
background: Rectangle {
|
||||
border.color: Qt.styleHints.accessibility.contrastPreference === Qt.HighContrast ?
|
||||
control.palette.windowText : control.palette.midlight
|
||||
color: control.palette.light
|
||||
}
|
||||
|
||||
contentItem: Label {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: control.palette.windowText
|
||||
text: control.model[control.headerView.textRole]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2022 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
|
||||
|
||||
T.AbstractWeekNumberColumn {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(background ? background.implicitWidth : 0,
|
||||
contentItem.implicitWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(background ? background.implicitHeight : 0,
|
||||
contentItem.implicitHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 6
|
||||
leftPadding: 6
|
||||
rightPadding: 6
|
||||
font.bold: true
|
||||
|
||||
//! [delegate]
|
||||
delegate: Text {
|
||||
text: weekNumber
|
||||
font: control.font
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
required property int weekNumber
|
||||
}
|
||||
//! [delegate]
|
||||
|
||||
//! [contentItem]
|
||||
contentItem: Column {
|
||||
spacing: control.spacing
|
||||
Repeater {
|
||||
model: control.source
|
||||
delegate: control.delegate
|
||||
}
|
||||
}
|
||||
//! [contentItem]
|
||||
}
|
||||
Binary file not shown.
@@ -0,0 +1,156 @@
|
||||
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 qmltyperegistrar.
|
||||
|
||||
Module {
|
||||
Component {
|
||||
file: "private/qquickbasicbusyindicator_p.h"
|
||||
lineNumber: 25
|
||||
name: "QQuickBasicBusyIndicator"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
parentProperty: "parent"
|
||||
prototype: "QQuickItem"
|
||||
exports: [
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 2.0",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 2.1",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 2.4",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 2.7",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 2.11",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 6.0",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 6.3",
|
||||
"QtQuick.Controls.Basic.impl/BusyIndicatorImpl 6.7"
|
||||
]
|
||||
exportMetaObjectRevisions: [512, 513, 516, 519, 523, 1536, 1539, 1543]
|
||||
Property {
|
||||
name: "pen"
|
||||
type: "QColor"
|
||||
read: "pen"
|
||||
write: "setPen"
|
||||
index: 0
|
||||
lineNumber: 28
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "fill"
|
||||
type: "QColor"
|
||||
read: "fill"
|
||||
write: "setFill"
|
||||
index: 1
|
||||
lineNumber: 29
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "running"
|
||||
type: "bool"
|
||||
read: "isRunning"
|
||||
write: "setRunning"
|
||||
index: 2
|
||||
lineNumber: 30
|
||||
}
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickbasicdial_p.h"
|
||||
lineNumber: 25
|
||||
name: "QQuickBasicDial"
|
||||
accessSemantics: "reference"
|
||||
prototype: "QQuickPaintedItem"
|
||||
exports: [
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 2.0",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 2.1",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 2.4",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 2.7",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 2.11",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 6.0",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 6.3",
|
||||
"QtQuick.Controls.Basic.impl/DialImpl 6.7"
|
||||
]
|
||||
exportMetaObjectRevisions: [512, 513, 516, 519, 523, 1536, 1539, 1543]
|
||||
Property {
|
||||
name: "progress"
|
||||
type: "double"
|
||||
read: "progress"
|
||||
write: "setProgress"
|
||||
index: 0
|
||||
lineNumber: 28
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "startAngle"
|
||||
type: "double"
|
||||
read: "startAngle"
|
||||
write: "setStartAngle"
|
||||
index: 1
|
||||
lineNumber: 29
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "endAngle"
|
||||
type: "double"
|
||||
read: "endAngle"
|
||||
write: "setEndAngle"
|
||||
index: 2
|
||||
lineNumber: 30
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "color"
|
||||
type: "QColor"
|
||||
read: "color"
|
||||
write: "setColor"
|
||||
index: 3
|
||||
lineNumber: 31
|
||||
isFinal: true
|
||||
}
|
||||
}
|
||||
Component {
|
||||
file: "private/qquickbasicprogressbar_p.h"
|
||||
lineNumber: 25
|
||||
name: "QQuickBasicProgressBar"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
parentProperty: "parent"
|
||||
prototype: "QQuickItem"
|
||||
exports: [
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 2.0",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 2.1",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 2.4",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 2.7",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 2.11",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 6.0",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 6.3",
|
||||
"QtQuick.Controls.Basic.impl/ProgressBarImpl 6.7"
|
||||
]
|
||||
exportMetaObjectRevisions: [512, 513, 516, 519, 523, 1536, 1539, 1543]
|
||||
Property {
|
||||
name: "indeterminate"
|
||||
type: "bool"
|
||||
read: "isIndeterminate"
|
||||
write: "setIndeterminate"
|
||||
index: 0
|
||||
lineNumber: 28
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "progress"
|
||||
type: "double"
|
||||
read: "progress"
|
||||
write: "setProgress"
|
||||
index: 1
|
||||
lineNumber: 29
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "color"
|
||||
type: "QColor"
|
||||
read: "color"
|
||||
write: "setColor"
|
||||
index: 2
|
||||
lineNumber: 30
|
||||
isFinal: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
module QtQuick.Controls.Basic.impl
|
||||
linktarget Qt6::qtquickcontrols2basicstyleimplplugin
|
||||
optional plugin qtquickcontrols2basicstyleimplplugin
|
||||
classname QtQuickControls2BasicStyleImplPlugin
|
||||
typeinfo plugins.qmltypes
|
||||
depends QtQuick auto
|
||||
prefer :/qt-project.org/imports/QtQuick/Controls/Basic/impl/
|
||||
depends QtQuick
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,121 @@
|
||||
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 qmltyperegistrar.
|
||||
|
||||
Module {
|
||||
Component {
|
||||
file: "private/qtquickcontrols2basicforeign_p.h"
|
||||
lineNumber: 51
|
||||
name: "QQuickContextMenu"
|
||||
accessSemantics: "reference"
|
||||
prototype: "QObject"
|
||||
interfaces: ["QQmlParserStatus"]
|
||||
exports: ["QtQuick.Controls.Basic/ContextMenu 6.9"]
|
||||
isCreatable: false
|
||||
exportMetaObjectRevisions: [1545]
|
||||
attachedType: "QQuickContextMenu"
|
||||
Property {
|
||||
name: "menu"
|
||||
type: "QQuickMenu"
|
||||
isPointer: true
|
||||
read: "menu"
|
||||
write: "setMenu"
|
||||
notify: "menuChanged"
|
||||
index: 0
|
||||
lineNumber: 32
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "menuChanged"; lineNumber: 48 }
|
||||
Signal {
|
||||
name: "requested"
|
||||
lineNumber: 49
|
||||
Parameter { name: "position"; type: "QPointF" }
|
||||
}
|
||||
}
|
||||
Component {
|
||||
file: "private/qtquickcontrols2basicforeign_p.h"
|
||||
lineNumber: 31
|
||||
name: "QQuickOverlay"
|
||||
accessSemantics: "reference"
|
||||
defaultProperty: "data"
|
||||
parentProperty: "parent"
|
||||
prototype: "QQuickItem"
|
||||
exports: [
|
||||
"QtQuick.Controls.Basic/Overlay 2.3",
|
||||
"QtQuick.Controls.Basic/Overlay 2.4",
|
||||
"QtQuick.Controls.Basic/Overlay 2.7",
|
||||
"QtQuick.Controls.Basic/Overlay 2.11",
|
||||
"QtQuick.Controls.Basic/Overlay 6.0",
|
||||
"QtQuick.Controls.Basic/Overlay 6.3",
|
||||
"QtQuick.Controls.Basic/Overlay 6.7"
|
||||
]
|
||||
isCreatable: false
|
||||
exportMetaObjectRevisions: [515, 516, 519, 523, 1536, 1539, 1543]
|
||||
attachedType: "QQuickOverlayAttached"
|
||||
Property {
|
||||
name: "modal"
|
||||
type: "QQmlComponent"
|
||||
isPointer: true
|
||||
read: "modal"
|
||||
write: "setModal"
|
||||
notify: "modalChanged"
|
||||
index: 0
|
||||
lineNumber: 32
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "modeless"
|
||||
type: "QQmlComponent"
|
||||
isPointer: true
|
||||
read: "modeless"
|
||||
write: "setModeless"
|
||||
notify: "modelessChanged"
|
||||
index: 1
|
||||
lineNumber: 33
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "modalChanged"; lineNumber: 54 }
|
||||
Signal { name: "modelessChanged"; lineNumber: 55 }
|
||||
Signal { name: "pressed"; lineNumber: 56 }
|
||||
Signal { name: "released"; lineNumber: 57 }
|
||||
}
|
||||
Component {
|
||||
file: "private/qtquickcontrols2basicforeign_p.h"
|
||||
lineNumber: 41
|
||||
name: "QQuickSplitHandleAttached"
|
||||
accessSemantics: "reference"
|
||||
prototype: "QObject"
|
||||
exports: [
|
||||
"QtQuick.Controls.Basic/SplitHandle 2.13",
|
||||
"QtQuick.Controls.Basic/SplitHandle 6.0"
|
||||
]
|
||||
isCreatable: false
|
||||
exportMetaObjectRevisions: [525, 1536]
|
||||
attachedType: "QQuickSplitHandleAttached"
|
||||
Property {
|
||||
name: "hovered"
|
||||
type: "bool"
|
||||
read: "isHovered"
|
||||
notify: "hoveredChanged"
|
||||
index: 0
|
||||
lineNumber: 166
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "pressed"
|
||||
type: "bool"
|
||||
read: "isPressed"
|
||||
notify: "pressedChanged"
|
||||
index: 1
|
||||
lineNumber: 167
|
||||
isReadonly: true
|
||||
isFinal: true
|
||||
}
|
||||
Signal { name: "hoveredChanged"; lineNumber: 182 }
|
||||
Signal { name: "pressedChanged"; lineNumber: 183 }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
module QtQuick.Controls.Basic
|
||||
linktarget Qt6::qtquickcontrols2basicstyleplugin
|
||||
plugin qtquickcontrols2basicstyleplugin
|
||||
classname QtQuickControls2BasicStylePlugin
|
||||
typeinfo plugins.qmltypes
|
||||
depends QtQuick auto
|
||||
depends QtQuick.Templates auto
|
||||
prefer :/qt-project.org/imports/QtQuick/Controls/Basic/
|
||||
AbstractButton 6.0 AbstractButton.qml
|
||||
AbstractButton 2.0 AbstractButton.qml
|
||||
Action 2.3 Action.qml
|
||||
Action 6.0 Action.qml
|
||||
ActionGroup 2.3 ActionGroup.qml
|
||||
ActionGroup 6.0 ActionGroup.qml
|
||||
ApplicationWindow 6.0 ApplicationWindow.qml
|
||||
ApplicationWindow 2.0 ApplicationWindow.qml
|
||||
BusyIndicator 6.0 BusyIndicator.qml
|
||||
BusyIndicator 2.0 BusyIndicator.qml
|
||||
Button 6.0 Button.qml
|
||||
Button 2.0 Button.qml
|
||||
ButtonGroup 6.0 ButtonGroup.qml
|
||||
ButtonGroup 2.0 ButtonGroup.qml
|
||||
CheckBox 6.0 CheckBox.qml
|
||||
CheckBox 2.0 CheckBox.qml
|
||||
CheckDelegate 6.0 CheckDelegate.qml
|
||||
CheckDelegate 2.0 CheckDelegate.qml
|
||||
ComboBox 6.0 ComboBox.qml
|
||||
ComboBox 2.0 ComboBox.qml
|
||||
Container 6.0 Container.qml
|
||||
Container 2.0 Container.qml
|
||||
Control 6.0 Control.qml
|
||||
Control 2.0 Control.qml
|
||||
DelayButton 2.2 DelayButton.qml
|
||||
DelayButton 6.0 DelayButton.qml
|
||||
Dial 6.0 Dial.qml
|
||||
Dial 2.0 Dial.qml
|
||||
Dialog 2.1 Dialog.qml
|
||||
Dialog 6.0 Dialog.qml
|
||||
DialogButtonBox 2.1 DialogButtonBox.qml
|
||||
DialogButtonBox 6.0 DialogButtonBox.qml
|
||||
Drawer 6.0 Drawer.qml
|
||||
Drawer 2.0 Drawer.qml
|
||||
Frame 6.0 Frame.qml
|
||||
Frame 2.0 Frame.qml
|
||||
GroupBox 6.0 GroupBox.qml
|
||||
GroupBox 2.0 GroupBox.qml
|
||||
HorizontalHeaderView 2.15 HorizontalHeaderView.qml
|
||||
HorizontalHeaderView 6.0 HorizontalHeaderView.qml
|
||||
HorizontalHeaderViewDelegate 6.10 HorizontalHeaderViewDelegate.qml
|
||||
ItemDelegate 6.0 ItemDelegate.qml
|
||||
ItemDelegate 2.0 ItemDelegate.qml
|
||||
Label 6.0 Label.qml
|
||||
Label 2.0 Label.qml
|
||||
Menu 6.0 Menu.qml
|
||||
Menu 2.0 Menu.qml
|
||||
MenuBar 2.3 MenuBar.qml
|
||||
MenuBar 6.0 MenuBar.qml
|
||||
MenuBarItem 2.3 MenuBarItem.qml
|
||||
MenuBarItem 6.0 MenuBarItem.qml
|
||||
MenuItem 6.0 MenuItem.qml
|
||||
MenuItem 2.0 MenuItem.qml
|
||||
MenuSeparator 2.1 MenuSeparator.qml
|
||||
MenuSeparator 6.0 MenuSeparator.qml
|
||||
Page 6.0 Page.qml
|
||||
Page 2.0 Page.qml
|
||||
PageIndicator 6.0 PageIndicator.qml
|
||||
PageIndicator 2.0 PageIndicator.qml
|
||||
Pane 6.0 Pane.qml
|
||||
Pane 2.0 Pane.qml
|
||||
Popup 6.0 Popup.qml
|
||||
Popup 2.0 Popup.qml
|
||||
ProgressBar 6.0 ProgressBar.qml
|
||||
ProgressBar 2.0 ProgressBar.qml
|
||||
RadioButton 6.0 RadioButton.qml
|
||||
RadioButton 2.0 RadioButton.qml
|
||||
RadioDelegate 6.0 RadioDelegate.qml
|
||||
RadioDelegate 2.0 RadioDelegate.qml
|
||||
RangeSlider 6.0 RangeSlider.qml
|
||||
RangeSlider 2.0 RangeSlider.qml
|
||||
RoundButton 2.1 RoundButton.qml
|
||||
RoundButton 6.0 RoundButton.qml
|
||||
ScrollBar 6.0 ScrollBar.qml
|
||||
ScrollBar 2.0 ScrollBar.qml
|
||||
ScrollIndicator 6.0 ScrollIndicator.qml
|
||||
ScrollIndicator 2.0 ScrollIndicator.qml
|
||||
ScrollView 2.2 ScrollView.qml
|
||||
ScrollView 6.0 ScrollView.qml
|
||||
SearchField 6.10 SearchField.qml
|
||||
SelectionRectangle 6.2 SelectionRectangle.qml
|
||||
Slider 6.0 Slider.qml
|
||||
Slider 2.0 Slider.qml
|
||||
SpinBox 6.0 SpinBox.qml
|
||||
SpinBox 2.0 SpinBox.qml
|
||||
SplitView 2.13 SplitView.qml
|
||||
SplitView 6.0 SplitView.qml
|
||||
StackView 6.0 StackView.qml
|
||||
StackView 2.0 StackView.qml
|
||||
SwipeDelegate 6.0 SwipeDelegate.qml
|
||||
SwipeDelegate 2.0 SwipeDelegate.qml
|
||||
Switch 6.0 Switch.qml
|
||||
Switch 2.0 Switch.qml
|
||||
SwitchDelegate 6.0 SwitchDelegate.qml
|
||||
SwitchDelegate 2.0 SwitchDelegate.qml
|
||||
SwipeView 6.0 SwipeView.qml
|
||||
SwipeView 2.0 SwipeView.qml
|
||||
TabBar 6.0 TabBar.qml
|
||||
TabBar 2.0 TabBar.qml
|
||||
TabButton 6.0 TabButton.qml
|
||||
TabButton 2.0 TabButton.qml
|
||||
TextArea 6.0 TextArea.qml
|
||||
TextArea 2.0 TextArea.qml
|
||||
TextField 6.0 TextField.qml
|
||||
TextField 2.0 TextField.qml
|
||||
ToolBar 6.0 ToolBar.qml
|
||||
ToolBar 2.0 ToolBar.qml
|
||||
ToolButton 6.0 ToolButton.qml
|
||||
ToolButton 2.0 ToolButton.qml
|
||||
ToolSeparator 2.1 ToolSeparator.qml
|
||||
ToolSeparator 6.0 ToolSeparator.qml
|
||||
ToolTip 6.0 ToolTip.qml
|
||||
ToolTip 2.0 ToolTip.qml
|
||||
Tumbler 6.0 Tumbler.qml
|
||||
Tumbler 2.0 Tumbler.qml
|
||||
VerticalHeaderView 2.15 VerticalHeaderView.qml
|
||||
VerticalHeaderView 6.0 VerticalHeaderView.qml
|
||||
VerticalHeaderViewDelegate 6.10 VerticalHeaderViewDelegate.qml
|
||||
singleton Calendar 6.3 Calendar.qml
|
||||
CalendarModel 6.3 CalendarModel.qml
|
||||
DayOfWeekRow 6.3 DayOfWeekRow.qml
|
||||
MonthGrid 6.3 MonthGrid.qml
|
||||
WeekNumberColumn 6.3 WeekNumberColumn.qml
|
||||
TableViewDelegate 6.9 TableViewDelegate.qml
|
||||
TreeViewDelegate 6.0 TreeViewDelegate.qml
|
||||
TreeViewDelegate 2.0 TreeViewDelegate.qml
|
||||
depends QtQuick
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.ApplicationWindow {
|
||||
id: window
|
||||
|
||||
color: window.palette.window
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// Copyright (C) 2024 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.Shapes
|
||||
|
||||
T.BusyIndicator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: 32
|
||||
implicitHeight: 32
|
||||
x: (control.availableWidth - width) / 2
|
||||
y: (control.availableHeight - height) / 2
|
||||
|
||||
property Shape ring: Shape {
|
||||
parent: control.contentItem
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
implicitWidth: parent.implicitWidth
|
||||
implicitHeight: parent.implicitHeight
|
||||
width: Math.min(control.contentItem.width, control.contentItem.height)
|
||||
height: width
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
antialiasing: true
|
||||
|
||||
ShapePath {
|
||||
fillColor: "transparent"
|
||||
strokeColor: control.palette.accent
|
||||
strokeWidth: control.contentItem.ring.width >= 64 ? 6 : control.contentItem.ring.width <= 16 ? 1 : 3
|
||||
|
||||
capStyle: ShapePath.RoundCap
|
||||
|
||||
PathAngleArc {
|
||||
centerX: control.contentItem.ring.width / 2
|
||||
centerY: control.contentItem.ring.height / 2
|
||||
radiusX: control.contentItem.ring.width / 2 - 2
|
||||
radiusY: radiusX
|
||||
startAngle: -90
|
||||
sweepAngle: 120
|
||||
|
||||
SequentialAnimation on startAngle {
|
||||
loops: Animation.Infinite
|
||||
running: control.visible && control.running
|
||||
NumberAnimation { from: 0; to: 450; duration: 1000 }
|
||||
NumberAnimation { from: 450; to: 1080; duration: 1000 }
|
||||
}
|
||||
|
||||
SequentialAnimation on sweepAngle {
|
||||
loops: Animation.Infinite
|
||||
running: control.visible && control.running
|
||||
NumberAnimation { from: 0; to: 180; duration: 1000 }
|
||||
NumberAnimation { from: 180; to: 0; duration: 1000 }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Button {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
icon.width: __config.icon.width
|
||||
icon.height: __config.icon.height
|
||||
icon.color: __buttonText
|
||||
|
||||
readonly property color __buttonText: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
return (control.enabled && ((control.flat && (control.down || control.hovered))
|
||||
|| ((control.highlighted || control.checked) && !control.down)))
|
||||
? control.palette.button
|
||||
: control.enabled && (control.hovered || control.down)
|
||||
? control.palette.highlight
|
||||
: control.palette.buttonText
|
||||
}
|
||||
if (control.down) {
|
||||
return (control.checked || control.highlighted)
|
||||
? Application.styleHints.colorScheme == Qt.Light
|
||||
? Color.transparent("white", 0.7) : Color.transparent("black", 0.5)
|
||||
: (Application.styleHints.colorScheme === Qt.Light
|
||||
? Color.transparent(control.palette.buttonText, 0.62)
|
||||
: Color.transparent(control.palette.buttonText, 0.7725))
|
||||
} else if (control.checked || control.highlighted) {
|
||||
return (Application.styleHints.colorScheme === Qt.Dark && !control.enabled)
|
||||
? Color.transparent("white", 0.5302)
|
||||
: (Application.styleHints.colorScheme === Qt.Dark ? "black" : "white")
|
||||
} else {
|
||||
return control.palette.buttonText
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string __currentState: [
|
||||
(control.checked || control.highlighted) && "checked",
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: (control.flat && Config.controls.flatbutton
|
||||
? Config.controls.flatbutton[__currentState]
|
||||
: Config.controls.button[__currentState]) || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: control.__config.label.textVAlignment | control.__config.label.textHAlignment
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.icon.color
|
||||
}
|
||||
|
||||
background: ButtonBackground {
|
||||
control: control
|
||||
implicitHeight: control.__config.background.height
|
||||
implicitWidth: control.__config.background.width
|
||||
radius: control.__config.background.topOffset
|
||||
subtle: control.flat
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: [
|
||||
control.checkState === Qt.Checked && "checked",
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.checkState === Qt.PartiallyChecked && "partiallyChecked",
|
||||
control.down && "pressed",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.checkbox[__currentState] || {}
|
||||
|
||||
readonly property bool __mirroredIndicator: control.mirrored !== (__config.mirrored || false)
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
indicator: Impl.CheckIndicator {
|
||||
x: control.text ? (control.__mirroredIndicator ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
filePath: Qt.resolvedUrl(control.__config.indicator.filePath)
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
leftPadding: control.indicator && !control.__mirroredIndicator ? control.indicator.width + control.spacing : 0
|
||||
rightPadding: control.indicator && control.__mirroredIndicator ? control.indicator.width + control.spacing : 0
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.palette.text
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Impl.StyleImage {
|
||||
imageConfig: control.__config.background
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
// Copyright (C) 2024 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.Controls.FluentWinUI3.impl as Impl
|
||||
|
||||
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)
|
||||
|
||||
spacing: 10
|
||||
|
||||
topPadding: __config.topPadding || 0 + verticalOffset
|
||||
leftPadding: __config.leftPadding || 0 + __horizontalOffset
|
||||
rightPadding: __config.rightPadding || 0 + __horizontalOffset
|
||||
bottomPadding: __config.bottomPadding || 0 + __verticalOffset
|
||||
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: control.down ? __pressedText : control.palette.buttonText
|
||||
|
||||
readonly property int __horizontalOffset: 4
|
||||
readonly property int __verticalOffset: 2
|
||||
|
||||
readonly property color __pressedText: Application.styleHints.colorScheme == Qt.Light
|
||||
? Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.62)
|
||||
: Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.7725)
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.highlighted && "highlighted",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.itemdelegate[__currentState] || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
indicator: Impl.CheckIndicator {
|
||||
readonly property string currentState: [
|
||||
control.checkState === Qt.Checked && "checked",
|
||||
!control.enabled && control.checkState !== Qt.Unchecked && "disabled",
|
||||
control.enabled && control.checkState !== Qt.Unchecked && !control.down && control.hovered && "hovered",
|
||||
control.checkState === Qt.PartiallyChecked && "partiallyChecked",
|
||||
control.checkState !== Qt.Unchecked && control.down && "pressed",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var config: Config.controls.checkbox[currentState] || {}
|
||||
|
||||
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
|
||||
filePath: Qt.resolvedUrl(config.indicator.filePath)
|
||||
}
|
||||
|
||||
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.icon.color
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: 160
|
||||
implicitHeight: 40
|
||||
|
||||
property Item backgroundImage: Impl.StyleImage {
|
||||
parent: control.background
|
||||
imageConfig: control.__config.background
|
||||
implicitWidth: parent.width - control.__horizontalOffset * 2
|
||||
implicitHeight: parent.height - control.__verticalOffset * 2
|
||||
x: control.__horizontalOffset
|
||||
y: control.__verticalOffset
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
// Copyright (C) 2024 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.Templates as T
|
||||
import QtQuick.Controls.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
|
||||
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)
|
||||
|
||||
spacing: __config.contentItem.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: (__config.leftPadding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)) || 0
|
||||
rightPadding: (__config.rightPadding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing)) || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.pressed && control.hovered && "hovered",
|
||||
control.down && control.popup.visible && "open",
|
||||
control.pressed && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: (control.editable && control.down && control.popup.visible // editable combobox differs from normal one only in opened state
|
||||
? Config.controls.editablecombobox[__currentState]
|
||||
: Config.controls.combobox[__currentState]) || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control.editable ? null : control
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
delegate: ItemDelegate {
|
||||
required property var model
|
||||
required property int index
|
||||
|
||||
width: ListView.view.width
|
||||
text: model[control.textRole]
|
||||
palette.highlightedText: control.palette.highlightedText
|
||||
highlighted: control.highlightedIndex === index
|
||||
hoverEnabled: control.hoverEnabled
|
||||
}
|
||||
|
||||
indicator: Image {
|
||||
x: control.mirrored ? control.__config.leftPadding : control.width - width - control.__config.rightPadding
|
||||
y: (control.topPadding + (control.availableHeight - height) / 2) + (control.pressed ? 1 : 0)
|
||||
source: Qt.resolvedUrl(control.__config.indicator.filePath)
|
||||
|
||||
Behavior on y {
|
||||
NumberAnimation{ easing.type: Easing.OutCubic; duration: 167 }
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: T.TextField {
|
||||
text: control.editable ? control.editText : control.displayText
|
||||
|
||||
topPadding: control.__config.label_contentItem.topPadding || 0
|
||||
leftPadding: control.__config.label_contentItem.leftPadding || 0
|
||||
rightPadding: control.__config.label_contentItem.rightPadding || 0
|
||||
bottomPadding: control.__config.label_contentItem.bottomPadding || 0
|
||||
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
|
||||
enabled: control.editable
|
||||
autoScroll: control.editable
|
||||
readOnly: control.down
|
||||
inputMethodHints: control.inputMethodHints
|
||||
validator: control.validator
|
||||
selectByMouse: control.selectTextByMouse
|
||||
|
||||
readonly property color __pressedText: Application.styleHints.colorScheme == Qt.Light
|
||||
? Qt.rgba(control.palette.text.r, control.palette.text.g, control.palette.text.b, 0.62)
|
||||
: Qt.rgba(control.palette.text.r, control.palette.text.g, control.palette.text.b, 0.7725)
|
||||
|
||||
color: control.down ? __pressedText : control.palette.text
|
||||
selectionColor: control.palette.highlight
|
||||
selectedTextColor: control.palette.highlightedText
|
||||
horizontalAlignment: control.__config.label_text.textHAlignment
|
||||
verticalAlignment: control.__config.label_text.textVAlignment
|
||||
|
||||
readonly property Item __focusFrameControl: control
|
||||
}
|
||||
|
||||
background: ItemGroup {
|
||||
Impl.StyleImage {
|
||||
visible: !control.__isHighContrast
|
||||
imageConfig: control.__config.background
|
||||
Item {
|
||||
visible: control.editable && ((control.down && control.popup.visible) || control.activeFocus)
|
||||
width: parent.width
|
||||
height: 2
|
||||
y: parent.height - height
|
||||
Impl.FocusStroke {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
radius: control.down && control.popup.visible ? 0 : control.__config.background.bottomOffset
|
||||
color: control.palette.accent
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
visible: control.__isHighContrast
|
||||
implicitWidth: control.__config.background.width
|
||||
implicitHeight: control.__config.background.height
|
||||
color: control.palette.window
|
||||
border.color: control.hovered ? control.palette.accent : control.palette.text
|
||||
radius: 4
|
||||
}
|
||||
}
|
||||
|
||||
popup: T.Popup {
|
||||
topPadding: control.__config.popup_contentItem.topPadding || 0
|
||||
leftPadding: control.__config.popup_contentItem.leftPadding || 0
|
||||
rightPadding: control.__config.popup_contentItem.rightPadding || 0
|
||||
bottomPadding: control.__config.popup_contentItem.bottomPadding || 0
|
||||
|
||||
contentItem: ListView {
|
||||
clip: true
|
||||
implicitHeight: contentHeight
|
||||
highlightMoveDuration: 0
|
||||
|
||||
model: control.delegateModel
|
||||
currentIndex: control.highlightedIndex
|
||||
}
|
||||
|
||||
y: control.editable ? control.height
|
||||
: -0.25 * Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
readonly property real __targetHeight: Math.min(contentItem.implicitHeight + topPadding + bottomPadding, control.Window.height - topMargin - bottomMargin)
|
||||
property real __heightScale: 1
|
||||
height: __heightScale * __targetHeight
|
||||
width: control.width
|
||||
topMargin: 8
|
||||
bottomMargin: 8
|
||||
palette: control.palette
|
||||
|
||||
enter: Transition {
|
||||
NumberAnimation { property: "__heightScale"; from: 0.33; to: 1; easing.type: Easing.OutCubic; duration: 250 }
|
||||
}
|
||||
|
||||
background: ItemGroup {
|
||||
Impl.StyleImage {
|
||||
visible: !control.__isHighContrast
|
||||
imageConfig: control.__config.popup_background.filePath ? control.__config.popup_background : Config.controls.popup["normal"].background // fallback to regular popup
|
||||
}
|
||||
Rectangle {
|
||||
visible: control.__isHighContrast
|
||||
implicitWidth: Config.controls.popup["normal"].background.width
|
||||
implicitHeight: Config.controls.popup["normal"].background.height
|
||||
color: control.palette.window
|
||||
border.color: control.palette.text
|
||||
radius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,115 @@
|
||||
// Copyright (C) 2024 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.Controls.FluentWinUI3.impl
|
||||
|
||||
T.DelayButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
icon.width: __config.icon.width
|
||||
icon.height: __config.icon.height
|
||||
icon.color: __buttonText
|
||||
|
||||
readonly property color __buttonText: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
return (control.enabled && ((control.flat && (control.down || control.hovered))
|
||||
|| ((control.highlighted || control.checked) && !control.down)))
|
||||
? control.palette.button
|
||||
: control.enabled && (control.hovered || control.down)
|
||||
? control.palette.highlight
|
||||
: control.palette.buttonText
|
||||
}
|
||||
if (control.down) {
|
||||
return (control.checked)
|
||||
? Application.styleHints.colorScheme == Qt.Light
|
||||
? Color.transparent("white", 0.7) : Color.transparent("black", 0.5)
|
||||
: (Application.styleHints.colorScheme === Qt.Light
|
||||
? Color.transparent(control.palette.buttonText, 0.62)
|
||||
: Color.transparent(control.palette.buttonText, 0.7725))
|
||||
} else if (control.checked) {
|
||||
return (Application.styleHints.colorScheme === Qt.Dark && !control.enabled)
|
||||
? Color.transparent("white", 0.5302)
|
||||
: (Application.styleHints.colorScheme === Qt.Dark ? "black" : "white")
|
||||
} else {
|
||||
return control.palette.buttonText
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string __currentState: [
|
||||
control.checked && "checked",
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.button[__currentState] || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
transition: Transition {
|
||||
NumberAnimation {
|
||||
duration: control.delay * (control.pressed ? 1.0 - control.progress : 0.3 * control.progress)
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ItemGroup {
|
||||
ClippedText {
|
||||
clip: control.progress > 0
|
||||
clipX: -control.leftPadding + control.progress * control.width
|
||||
clipWidth: (1.0 - control.progress) * control.width
|
||||
visible: control.progress < 1
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.icon.color
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
ClippedText {
|
||||
clip: control.progress > 0
|
||||
clipX: -control.leftPadding
|
||||
clipWidth: control.progress * control.width
|
||||
visible: control.progress > 0
|
||||
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.icon.color
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
|
||||
background: ButtonBackground {
|
||||
control: control
|
||||
implicitHeight: control.__config.background.height
|
||||
implicitWidth: control.__config.background.width
|
||||
radius: control.__config.background.topOffset
|
||||
subtle: false
|
||||
|
||||
Rectangle {
|
||||
width: control.progress * parent.width
|
||||
height: parent.height
|
||||
radius: parent.radius
|
||||
color: control.down ? control.palette.accent : "transparent"
|
||||
visible: !control.checked && control.enabled
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
// Copyright (C) 2024 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.Effects
|
||||
|
||||
T.Dialog {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitHeaderWidth,
|
||||
implicitFooterWidth)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding
|
||||
+ (implicitHeaderHeight > 0 ? implicitHeaderHeight + spacing : 0)
|
||||
+ (implicitFooterHeight > 0 ? implicitFooterHeight + spacing : 0))
|
||||
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
leftInset: __isHighContrast ? 0 : -32
|
||||
topInset: __isHighContrast ? 0 : -32
|
||||
rightInset: __isHighContrast ? 0 : -32
|
||||
bottomInset: __isHighContrast ? 0 : -32
|
||||
|
||||
padding: 24
|
||||
topPadding: 12
|
||||
bottomPadding: 23
|
||||
|
||||
enter: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.Linear; duration: 83 }
|
||||
NumberAnimation { property: "scale"; from: control.modal ? 1.05 : 1; to: 1; easing.type: Easing.OutCubic; duration: 167 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.Linear; duration: 83 }
|
||||
NumberAnimation { property: "scale"; from: 1; to: control.modal ? 1.05 : 1; easing.type: Easing.OutCubic; duration: 167 }
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: control.__isHighContrast ? control.palette.window : "transparent"
|
||||
border.color: control.__isHighContrast ? control.palette.text : "transparent"
|
||||
border.width: 2
|
||||
radius: 8
|
||||
MultiEffect {
|
||||
visible: !control.__isHighContrast
|
||||
x: -control.leftInset
|
||||
y: -control.topInset
|
||||
width: source.width
|
||||
height: source.height
|
||||
source: Rectangle {
|
||||
width: control.background.width + control.leftInset + control.rightInset
|
||||
height: control.background.height + control.topInset + control.bottomInset
|
||||
color: Application.styleHints.colorScheme === Qt.Light ? "white" : Qt.tint(control.palette.window, Color.transparent("white", 0.05))
|
||||
border.color: "#66757575"
|
||||
radius: 8
|
||||
}
|
||||
shadowScale: 1
|
||||
shadowOpacity: 0.19
|
||||
shadowColor: control.palette.shadow
|
||||
shadowEnabled: true
|
||||
shadowHorizontalOffset: 0
|
||||
shadowVerticalOffset: 32
|
||||
blurMax: 64
|
||||
}
|
||||
}
|
||||
|
||||
header: Label {
|
||||
text: control.title
|
||||
topPadding: control.padding
|
||||
leftPadding: control.padding
|
||||
rightPadding: control.padding
|
||||
visible: control.title && parent?.parent === Overlay.overlay
|
||||
elide: Label.ElideRight
|
||||
font.bold: true
|
||||
font.pixelSize: 20
|
||||
font.weight: Font.DemiBold
|
||||
}
|
||||
|
||||
footer: DialogButtonBox {
|
||||
visible: count > 0
|
||||
leftInset: control.__isHighContrast ? 1 : 0
|
||||
topInset: control.__isHighContrast ? 1 : 0
|
||||
rightInset: control.__isHighContrast ? 1 : 0
|
||||
bottomInset: control.__isHighContrast ? 1 : 0
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.3)
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.DialogButtonBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: 8
|
||||
padding: 24
|
||||
|
||||
alignment: count === 1 ? Qt.AlignRight : undefined
|
||||
|
||||
delegate: Button {
|
||||
highlighted: DialogButtonBox.buttonRole === DialogButtonBox.AcceptRole || DialogButtonBox.buttonRole === DialogButtonBox.YesRole
|
||||
}
|
||||
|
||||
contentItem: ListView {
|
||||
implicitWidth: contentWidth
|
||||
model: control.contentModel
|
||||
spacing: control.spacing
|
||||
orientation: ListView.Horizontal
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
snapMode: ListView.SnapToItem
|
||||
}
|
||||
|
||||
background: Item {
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
implicitHeight: 81
|
||||
Rectangle {
|
||||
implicitHeight: parent.__isHighContrast ? 2 : 1
|
||||
width: parent.width
|
||||
color: parent.__isHighContrast ? control.palette.text : Application.styleHints.colorScheme === Qt.Light ? "#0F000000" : "#15FFFFFF"
|
||||
}
|
||||
Rectangle {
|
||||
implicitHeight: parent.__isHighContrast ? 79 : 80
|
||||
x: 1; y: parent.__isHighContrast ? 2 : 1
|
||||
width: parent.width - 2
|
||||
height: parent.height - (parent.__isHighContrast ? 3 : 2)
|
||||
color: control.palette.window
|
||||
topLeftRadius: 0
|
||||
bottomLeftRadius: 7
|
||||
bottomRightRadius: 7
|
||||
topRightRadius: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
// Copyright (C) 2024 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.Layouts
|
||||
|
||||
@Deprecated {
|
||||
reason: "FocusFrame component has been moved to private FluentWinUI3.impl module \
|
||||
and is no longer part of the public QML API."
|
||||
}
|
||||
Rectangle {
|
||||
Component.onCompleted: {
|
||||
print("FocusFrame has been moved to private FluentWinUI3.impl module "
|
||||
+ "and is no longer part of the public QML API.")
|
||||
}
|
||||
function moveToItem(item) {
|
||||
if (!item) {
|
||||
targetItem = null;
|
||||
parent = null;
|
||||
return;
|
||||
}
|
||||
parent = item.parent
|
||||
targetItem = item
|
||||
}
|
||||
|
||||
property Item targetItem
|
||||
property real innerFrameSize: 1
|
||||
property real outerFrameSize: 3
|
||||
property real frameRadius: 4.0
|
||||
|
||||
x: targetItem ? targetItem.x - outerFrameSize : 0
|
||||
y: targetItem ? targetItem.y - outerFrameSize : 0
|
||||
// Stack on top of all siblings of the targetItem
|
||||
z: 100
|
||||
width: targetItem ? targetItem.width + outerFrameSize * 2 : 0
|
||||
height: targetItem ? targetItem.height + outerFrameSize * 2 : 0
|
||||
radius: frameRadius + outerFrameSize
|
||||
visible: targetItem && targetItem.visible
|
||||
color: "transparent"
|
||||
border.color: Application.styleHints.colorScheme === Qt.Light ? "black" : "white"
|
||||
border.width: outerFrameSize - (Application.styleHints.colorScheme === Qt.Light ? innerFrameSize : 0)
|
||||
|
||||
Rectangle {
|
||||
id: innerFocusFrame
|
||||
z: 10
|
||||
x: outerFrameSize - innerFrameSize
|
||||
y: outerFrameSize - innerFrameSize
|
||||
width: targetItem ? targetItem.width + innerFrameSize * 2 : 0
|
||||
height: targetItem ? targetItem.height + innerFrameSize * 2 : 0
|
||||
radius: frameRadius + innerFrameSize
|
||||
visible: targetItem && targetItem.visible
|
||||
color: "transparent"
|
||||
border.color: Application.styleHints.colorScheme === Qt.Light ? "white" : "black"
|
||||
border.width: innerFrameSize
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Frame {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max((background.minimumWidth || implicitBackgroundWidth)
|
||||
+ leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max((background.minimumHeight || implicitBackgroundHeight)
|
||||
+ topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: !control.enabled ? "disabled" : "normal";
|
||||
readonly property var __config: Config.controls.frame[__currentState] || {}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: control.__config.background.width
|
||||
implicitHeight: control.__config.background.height
|
||||
color: "transparent"
|
||||
border.color: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast ? control.palette.text : "transparent"
|
||||
radius: 4
|
||||
Impl.StyleImage {
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
imageConfig: control.__config.background
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.GroupBox {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding,
|
||||
implicitLabelWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
readonly property real __deltaY: (__config.background.y - __config.label.y) || 0
|
||||
readonly property real __deltaX: (__config.background.x - __config.label.x) || 0
|
||||
spacing: (__deltaY - __config.label.height) || 0
|
||||
|
||||
topPadding: (__config.topPadding || 0) + (spacing >= 0 ? (label.height + spacing) : __deltaY)
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: (__config.leftPadding || 0) + (__deltaX >= 0 ? __deltaX : 0)
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: __deltaY > 0 ? __deltaY : 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: __deltaX > 0 ? __deltaX : 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && control.hovered && "hovered",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.groupbox[__currentState] || {}
|
||||
|
||||
label: T.Label {
|
||||
x: control.__deltaX > 0 ? 0 : -__deltaX
|
||||
y: control.__deltaY > 0 ? 0 : -__deltaY
|
||||
|
||||
topPadding: control.__config.label_contentItem.topPadding || 0
|
||||
leftPadding: control.__config.label_contentItem.leftPadding || 0
|
||||
rightPadding: control.__config.label_contentItem.rightPadding || 0
|
||||
bottomPadding: control.__config.label_contentItem.bottomPadding || 0
|
||||
|
||||
height: Math.max(implicitHeight, __config.label.height)
|
||||
|
||||
text: control.title
|
||||
font: control.font
|
||||
color: control.palette.windowText
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: control.__config.label_text.textHAlignment
|
||||
verticalAlignment: control.__config.label_text.textVAlignment
|
||||
|
||||
background: Impl.StyleImage {
|
||||
imageConfig: control.__config.label_background
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: "transparent"
|
||||
border.color: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast ? control.palette.text : "transparent"
|
||||
radius: 4
|
||||
Impl.StyleImage {
|
||||
imageConfig: control.__config.background.filePath ? control.__config.background : Config.controls.frame["normal"].background // fallback to regular frame background
|
||||
width: parent.width
|
||||
height: parent.height
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0 + verticalOffset
|
||||
leftPadding: __config.leftPadding || 0 + __horizontalOffset
|
||||
rightPadding: __config.rightPadding || 0 + __horizontalOffset
|
||||
bottomPadding: __config.bottomPadding || 0 + __verticalOffset
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: control.down ? __pressedText : __isHighContrast && control.hovered ? control.palette.button : control.palette.buttonText
|
||||
|
||||
readonly property int __horizontalOffset: 4
|
||||
readonly property int __verticalOffset: 2
|
||||
|
||||
readonly property color __pressedText: Application.styleHints.colorScheme == Qt.Light
|
||||
? Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.62)
|
||||
: Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.7725)
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.highlighted && "highlighted",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.itemdelegate[__currentState] || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
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.icon.color
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: 160
|
||||
implicitHeight: 40
|
||||
|
||||
property Item backgroundImage: Impl.StyleImage {
|
||||
visible: !control.__isHighContrast
|
||||
parent: control.background
|
||||
imageConfig: control.__config.background
|
||||
implicitWidth: parent.width - control.__horizontalOffset * 2
|
||||
implicitHeight: parent.height - control.__verticalOffset * 2
|
||||
x: control.__horizontalOffset
|
||||
y: control.__verticalOffset
|
||||
}
|
||||
|
||||
property Rectangle selector: Rectangle {
|
||||
parent: control.background.backgroundImage
|
||||
y: (parent.height - height) / 2
|
||||
width: 3
|
||||
height: (control.highlighted || control.activeFocus)
|
||||
? control.down ? 10 : 16
|
||||
: 0
|
||||
radius: width * 0.5
|
||||
color: control.palette.accent
|
||||
visible: (control.highlighted || control.activeFocus) && !control.__isHighContrast
|
||||
Behavior on height {
|
||||
NumberAnimation {
|
||||
duration: 187
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: control.__isHighContrast
|
||||
implicitWidth: parent.width - control.__horizontalOffset * 2
|
||||
implicitHeight: parent.height - control.__verticalOffset * 2
|
||||
x: control.__horizontalOffset
|
||||
y: control.__verticalOffset
|
||||
color: control.hovered ? control.palette.accent : control.palette.window
|
||||
radius: 4
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
// Copyright (C) 2024 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.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Effects
|
||||
|
||||
T.Menu {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
leftPadding: 5
|
||||
topPadding: 5
|
||||
rightPadding: 5
|
||||
bottomPadding: 5
|
||||
margins: 0
|
||||
overlap: 4
|
||||
|
||||
readonly property var __config: Config.controls.popup["normal"]
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
leftInset: -__config.background.leftShadow
|
||||
topInset: -__config.background.topShadow
|
||||
rightInset: -__config.background.rightShadow
|
||||
bottomInset: -__config.background.bottomShadow
|
||||
|
||||
delegate: MenuItem { }
|
||||
|
||||
contentItem: ListView {
|
||||
implicitHeight: contentHeight
|
||||
model: control.contentModel
|
||||
interactive: Window.window
|
||||
? contentHeight + control.topPadding + control.bottomPadding > control.height
|
||||
: false
|
||||
currentIndex: control.currentIndex
|
||||
spacing: 4
|
||||
clip: true
|
||||
|
||||
ScrollIndicator.vertical: ScrollIndicator {}
|
||||
}
|
||||
|
||||
property real __heightScale: 1
|
||||
height: __heightScale * implicitHeight
|
||||
enter: Transition {
|
||||
NumberAnimation { property: "__heightScale"; from: 0.33; to: 1; easing.type: Easing.OutCubic; duration: 250 }
|
||||
}
|
||||
|
||||
background: Impl.StyleImage {
|
||||
implicitWidth: 200 + imageConfig.leftShadow + imageConfig.rightShadow
|
||||
implicitHeight: 30 + imageConfig.topShadow + imageConfig.bottomShadow
|
||||
imageConfig: control.__config.background
|
||||
drawShadowWithinBounds: true
|
||||
Rectangle {
|
||||
x: -control.leftInset
|
||||
y: -control.topInset
|
||||
implicitWidth: parent.width + control.leftInset + control.rightInset
|
||||
implicitHeight: parent.height + control.topInset + control.bottomInset
|
||||
visible: control.__isHighContrast
|
||||
radius: 8
|
||||
color: control.palette.window
|
||||
border.color: control.palette.text
|
||||
border.width: 2
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
// Copyright (C) 2024 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.Controls.FluentWinUI3.impl as Impl
|
||||
|
||||
T.MenuBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: SafeArea.margins.top + (__config.topPadding || 0)
|
||||
bottomPadding: SafeArea.margins.bottom + (__config.bottomPadding || 0)
|
||||
leftPadding: SafeArea.margins.left + (__config.leftPadding || 0)
|
||||
rightPadding: SafeArea.margins.right + (__config.rightPadding || 0)
|
||||
|
||||
readonly property var __config: Config.controls.toolbar["normal"] || {}
|
||||
|
||||
delegate: MenuBarItem { }
|
||||
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
Repeater {
|
||||
model: control.contentModel
|
||||
}
|
||||
}
|
||||
|
||||
background: Impl.StyleImage {
|
||||
imageConfig: control.__config.background
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
// Copyright (C) 2024 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.Controls.FluentWinUI3.impl
|
||||
|
||||
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)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
icon.width: __config.icon.width
|
||||
icon.height: __config.icon.height
|
||||
icon.color: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
? control.hovered || control.highlighted ? control.palette.highlight : control.palette.buttonText
|
||||
: !control.down
|
||||
? control.palette.buttonText : Application.styleHints.colorScheme === Qt.Light
|
||||
? Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.62)
|
||||
: Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.7725)
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.down && (control.hovered || control.highlighted) && "hovered",
|
||||
down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.toolbutton[__currentState] || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
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.icon.color
|
||||
}
|
||||
|
||||
background: ButtonBackground {
|
||||
control: control
|
||||
implicitHeight: 30
|
||||
implicitWidth: 30
|
||||
radius: control.__config.background.topOffset
|
||||
subtle: (!control.checked || control.flat) && Application.styleHints.accessibility.contrastPreference !== Qt.HighContrast
|
||||
accented: control.checked
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
// Copyright (C) 2024 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
|
||||
|
||||
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)
|
||||
|
||||
leftPadding: 12
|
||||
rightPadding: 12
|
||||
topPadding: 3
|
||||
bottomPadding: 3
|
||||
spacing: 6
|
||||
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: control.palette.text
|
||||
|
||||
implicitTextPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
|
||||
|
||||
contentItem: IconLabel {
|
||||
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
|
||||
leftPadding: !control.mirrored ? control.textPadding : arrowPadding
|
||||
rightPadding: control.mirrored ? control.textPadding : arrowPadding
|
||||
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
alignment: Qt.AlignLeft
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.icon.color
|
||||
}
|
||||
|
||||
arrow: ColorImage {
|
||||
x: control.mirrored ? control.padding : control.width - width - control.padding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
width: 20
|
||||
|
||||
visible: control.subMenu
|
||||
rotation: control.mirrored ? -180 : 0
|
||||
color: control.palette.text
|
||||
source: Qt.resolvedUrl("icons/menuarrow.png")
|
||||
fillMode: Image.Pad
|
||||
}
|
||||
|
||||
indicator: Item {
|
||||
implicitWidth: 14
|
||||
implicitHeight: 10
|
||||
|
||||
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
visible: control.checkable
|
||||
|
||||
ColorImage {
|
||||
y: (parent.height - height) / 2
|
||||
color: control.palette.text
|
||||
source: Qt.resolvedUrl("icons/checkmark.png")
|
||||
visible: control.checkState === Qt.Checked
|
||||
|| (control.checked && control.checkState === undefined)
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: 200
|
||||
implicitHeight: 30
|
||||
radius: 4
|
||||
|
||||
readonly property real alpha: control.down
|
||||
? Application.styleHints.colorScheme === Qt.Light ? 0.0241 : 0.0419
|
||||
: control.hovered ? Application.styleHints.colorScheme === Qt.Light ? 0.0373 : 0.0605 : 0
|
||||
|
||||
color: Application.styleHints.colorScheme === Qt.Light ? Qt.rgba(0, 0, 0, alpha) : Qt.rgba(1, 1, 1, alpha)
|
||||
visible: control.down || control.highlighted
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright (C) 2024 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
|
||||
|
||||
T.MenuSeparator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
horizontalPadding: 0
|
||||
verticalPadding: 2
|
||||
|
||||
contentItem: Rectangle {
|
||||
implicitWidth: 188
|
||||
implicitHeight: 1
|
||||
color: Application.styleHints.colorScheme === Qt.Light ? "#0F000000" : "#15FFFFFF"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.PageIndicator {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && control.hovered && "hovered",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.pageindicator[__currentState] || {}
|
||||
|
||||
delegate: Impl.StyleImage {
|
||||
required property int index
|
||||
|
||||
property alias hovered: hoverHandler.hovered
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && (index === control.currentIndex || pressed) && "delegate",
|
||||
control.enabled && index === control.currentIndex && "current",
|
||||
control.enabled && hovered && !pressed && "hovered",
|
||||
control.enabled && control.interactive && pressed && "pressed",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var config: Config.controls.pageindicatordelegate[__currentState].indicator || {}
|
||||
|
||||
imageConfig: config
|
||||
|
||||
HoverHandler {
|
||||
id: hoverHandler
|
||||
enabled: control.interactive
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: Row {
|
||||
spacing: control.spacing
|
||||
|
||||
Repeater {
|
||||
model: control.count
|
||||
delegate: control.delegate
|
||||
}
|
||||
}
|
||||
|
||||
background: Impl.StyleImage {
|
||||
imageConfig: control.__config.background
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.Popup {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: "normal"
|
||||
readonly property var __config: Config.controls.popup[__currentState] || {}
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
enter: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.Linear; duration: 83 }
|
||||
NumberAnimation { property: "scale"; from: control.modal ? 1.05 : 1; to: 1; easing.type: Easing.OutCubic; duration: 167 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.Linear; duration: 83 }
|
||||
NumberAnimation { property: "scale"; from: 1; to: control.modal ? 1.05 : 1; easing.type: Easing.OutCubic; duration: 167 }
|
||||
}
|
||||
|
||||
background: Impl.StyleImage {
|
||||
implicitWidth: 320
|
||||
implicitHeight: 72
|
||||
imageConfig: control.__config.background
|
||||
drawShadowWithinBounds: control.__isHighContrast
|
||||
Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
visible: control.__isHighContrast
|
||||
radius: 4
|
||||
color: control.palette.window
|
||||
border.color: control.palette.text
|
||||
border.width: 2
|
||||
}
|
||||
}
|
||||
|
||||
T.Overlay.modal: Rectangle {
|
||||
color: Color.transparent(control.palette.shadow, 0.3)
|
||||
}
|
||||
|
||||
T.Overlay.modeless: Rectangle {
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
import QtQuick.Effects
|
||||
|
||||
T.ProgressBar {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: (__isHighContrast ? -1 : 0) - (__config.topInset || 0)
|
||||
bottomInset: (__isHighContrast ? -1 : 0) - (__config.bottomInset || 0)
|
||||
leftInset: (__isHighContrast ? -1 : 0) - (__config.leftInset || 0)
|
||||
rightInset: (__isHighContrast ? -1 : 0) - (__config.rightInset || 0)
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.indeterminate && "indeterminate"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.progressbar[__currentState] || {}
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
contentItem: Item {
|
||||
implicitWidth: control.indeterminate ? parent.availableWidth : progress.implicitWidth
|
||||
implicitHeight: control.indeterminate ? control.__config.track.height : progress.implicitHeight
|
||||
scale: control.mirrored ? -1 : 1
|
||||
clip: control.indeterminate
|
||||
|
||||
readonly property Rectangle progress: Rectangle {
|
||||
x: control.background.groove?.x - (control.__isHighContrast ? 0 : 1)
|
||||
y: control.background.groove?.y - (control.__isHighContrast ? 0 : 1)
|
||||
parent: control.contentItem
|
||||
visible: !control.indeterminate && control.value
|
||||
implicitWidth: control.__config.track.width
|
||||
implicitHeight: control.__config.track.height
|
||||
width: control.position * parent.width
|
||||
height: control.__config.track.height
|
||||
radius: control.__config.track.height * 0.5
|
||||
color: control.palette.accent
|
||||
}
|
||||
|
||||
readonly property Rectangle animatedProgress: Rectangle {
|
||||
parent: control.contentItem
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: control.__config.track.height
|
||||
radius: control.__config.track.height * 0.5
|
||||
clip: true
|
||||
visible: false
|
||||
color: "transparent"
|
||||
Rectangle {
|
||||
width: 0.5 * parent.width
|
||||
height: control.__config.track.height
|
||||
radius: control.__config.track.height * 0.5
|
||||
color: control.palette.accent
|
||||
SequentialAnimation on x {
|
||||
loops: Animation.Infinite
|
||||
running: control.indeterminate && control.visible
|
||||
NumberAnimation {
|
||||
from: -control.contentItem.animatedProgress.width
|
||||
to: control.contentItem.width
|
||||
easing.type: Easing.InOutCubic
|
||||
duration: control.width * 8
|
||||
}
|
||||
NumberAnimation {
|
||||
from: -control.contentItem.animatedProgress.width * 0.5
|
||||
to: control.contentItem.width
|
||||
easing.type: Easing.InOutCubic
|
||||
duration: control.width * 5
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
readonly property Rectangle mask: Rectangle {
|
||||
parent: control.contentItem
|
||||
width: control.availableWidth
|
||||
height: control.contentItem.animatedProgress.height
|
||||
radius: control.contentItem.animatedProgress.radius
|
||||
visible: false
|
||||
color: control.palette.accent
|
||||
layer.enabled: true
|
||||
antialiasing: false
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
visible: control.indeterminate
|
||||
source: control.contentItem.animatedProgress
|
||||
width: control.contentItem.animatedProgress.width
|
||||
height: control.contentItem.animatedProgress.height
|
||||
maskEnabled: true
|
||||
maskSource: control.contentItem.mask
|
||||
}
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
implicitWidth: groove.width
|
||||
radius: height * 0.5
|
||||
color: control.__isHighContrast ? control.palette.window : "transparent"
|
||||
border.color: control.__isHighContrast ? control.palette.text : "transparent"
|
||||
property Item groove: Impl.StyleImage {
|
||||
imageConfig: control.__config.groove
|
||||
visible: !control.indeterminate && !control.__isHighContrast
|
||||
parent: control.background
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
topInset: -__config.topInset || 0
|
||||
bottomInset: -__config.bottomInset || 0
|
||||
leftInset: -__config.leftInset || 0
|
||||
rightInset: -__config.rightInset || 0
|
||||
|
||||
readonly property string __currentState: [
|
||||
control.checked && "checked",
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.radiobutton[__currentState] || {}
|
||||
readonly property bool __mirroredIndicator: control.mirrored !== (__config.mirrored || false)
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
indicator: Impl.RadioIndicator {
|
||||
x: control.text ? (control.__mirroredIndicator ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
control: control
|
||||
filePath: Qt.resolvedUrl(control.__config.indicator.filePath)
|
||||
}
|
||||
|
||||
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.palette.text
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
background: Impl.StyleImage {
|
||||
imageConfig: control.__config.background
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
// Copyright (C) 2024 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.Controls.FluentWinUI3.impl as Impl
|
||||
|
||||
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)
|
||||
|
||||
spacing: 10
|
||||
|
||||
topPadding: __config.topPadding || 0 + verticalOffset
|
||||
leftPadding: __config.leftPadding || 0 + __horizontalOffset
|
||||
rightPadding: __config.rightPadding || 0 + __horizontalOffset
|
||||
bottomPadding: __config.bottomPadding || 0 + __verticalOffset
|
||||
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
icon.color: control.down ? __pressedText : control.palette.buttonText
|
||||
|
||||
readonly property int __horizontalOffset: 4
|
||||
readonly property int __verticalOffset: 2
|
||||
|
||||
readonly property color __pressedText: Application.styleHints.colorScheme == Qt.Light
|
||||
? Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.62)
|
||||
: Qt.rgba(control.palette.buttonText.r, control.palette.buttonText.g, control.palette.buttonText.b, 0.7725)
|
||||
|
||||
readonly property string __currentState: [
|
||||
!control.enabled && "disabled",
|
||||
control.highlighted && "highlighted",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.itemdelegate[__currentState] || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
indicator: Impl.RadioIndicator {
|
||||
readonly property string currentState: [
|
||||
control.checked && "checked",
|
||||
!control.enabled && control.checked && "disabled",
|
||||
control.enabled && control.checked && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var config: Config.controls.radiobutton[currentState] || {}
|
||||
|
||||
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
|
||||
filePath: Qt.resolvedUrl(config.indicator.filePath)
|
||||
}
|
||||
|
||||
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.icon.color
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: 160
|
||||
implicitHeight: 40
|
||||
|
||||
property Item backgroundImage: Impl.StyleImage {
|
||||
parent: control.background
|
||||
imageConfig: control.__config.background
|
||||
implicitWidth: parent.width - control.__horizontalOffset * 2
|
||||
implicitHeight: parent.height - control.__verticalOffset * 2
|
||||
x: control.__horizontalOffset
|
||||
y: control.__verticalOffset
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,270 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl as Impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
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)
|
||||
|
||||
topPadding: horizontal ? __config.topPadding : __config.leftPadding || 0
|
||||
leftPadding: horizontal ? __config.leftPadding : __config.bottomPadding || 0
|
||||
rightPadding: horizontal ? __config.rightPadding : __config.topPadding || 0
|
||||
bottomPadding: horizontal ? __config.bottomPadding : __config.rightPadding || 0
|
||||
|
||||
readonly property string __controlState: [
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && control.hovered && !(first.pressed || second.pressed) && "hovered",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: Config.controls.rangeslider[__controlState] || {}
|
||||
|
||||
readonly property real __steps: Math.abs(to - from) / stepSize
|
||||
readonly property bool __isDiscrete: stepSize >= Number.EPSILON
|
||||
&& Math.abs(Math.round(__steps) - __steps) < Number.EPSILON
|
||||
|
||||
readonly property bool __isHighContrast: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
property string __firstHandleState: [
|
||||
!control.enabled && "disabled",
|
||||
first.hovered && !first.pressed && "hovered",
|
||||
first.pressed && "handle_pressed",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __firstHandleConfig: Config.controls.rangeslider[__firstHandleState] || {}
|
||||
|
||||
property string __secondHandleState: [
|
||||
!control.enabled && "disabled",
|
||||
second.hovered && !second.pressed && "hovered",
|
||||
second.pressed && "handle_pressed",
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __secondHandleConfig: Config.controls.rangeslider[__secondHandleState] || {}
|
||||
|
||||
readonly property Item __focusFrameControl: control
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
first.handle: ItemGroup {
|
||||
x: Math.round(control.leftPadding + (control.horizontal
|
||||
? control.first.visualPosition * (control.availableWidth - width)
|
||||
: (control.availableWidth - width) / 2))
|
||||
y: Math.round(control.topPadding + (control.horizontal
|
||||
? (control.availableHeight - height) / 2
|
||||
: control.first.visualPosition * (control.availableHeight - height)))
|
||||
|
||||
Impl.StyleImage {
|
||||
visible: !control.__isHighContrast
|
||||
imageConfig: control.__firstHandleConfig.first_handle
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: control.__isHighContrast
|
||||
implicitWidth: control.__secondHandleConfig.first_handle.width
|
||||
implicitHeight: control.__secondHandleConfig.first_handle.height
|
||||
color: control.palette.buttonText
|
||||
radius: width / 2
|
||||
}
|
||||
|
||||
property Rectangle indicator: Rectangle {
|
||||
property real diameter: !control.enabled ? 10
|
||||
: control.first.pressed ? 8
|
||||
: control.__isHighContrast && !control.hovered ? 0
|
||||
: control.first.hovered ? 14 : 10
|
||||
parent: control.first.handle
|
||||
width: diameter
|
||||
height: diameter
|
||||
radius: diameter * 0.5
|
||||
x: (control.__secondHandleConfig.first_handle.width - width) / 2
|
||||
y: (control.__secondHandleConfig.first_handle.height - height) / 2
|
||||
color: control.enabled ? (control.first.hovered ? Qt.rgba(control.palette.accent.r, control.palette.accent.g, control.palette.accent.b, 0.9020)
|
||||
: control.first.pressed ? Qt.rgba(control.palette.accent.r, control.palette.accent.g, control.palette.accent.b, 0.8)
|
||||
: control.palette.accent)
|
||||
: control.palette.accent
|
||||
Behavior on diameter {
|
||||
// From WindowsUI 3 Animation Values
|
||||
NumberAnimation {
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
second.handle: ItemGroup {
|
||||
x: Math.round(control.leftPadding + (control.horizontal
|
||||
? control.second.visualPosition * (control.availableWidth - width)
|
||||
: (control.availableWidth - width) / 2))
|
||||
y: Math.round(control.topPadding + (control.horizontal
|
||||
? (control.availableHeight - height) / 2
|
||||
: control.second.visualPosition * (control.availableHeight - height)))
|
||||
|
||||
Impl.StyleImage {
|
||||
visible: !control.__isHighContrast
|
||||
imageConfig: control.__secondHandleConfig.second_handle
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: control.__isHighContrast
|
||||
implicitWidth: control.__secondHandleConfig.second_handle.width
|
||||
implicitHeight: control.__secondHandleConfig.second_handle.height
|
||||
color: control.palette.buttonText
|
||||
radius: width / 2
|
||||
}
|
||||
|
||||
property Rectangle indicator: Rectangle {
|
||||
property real diameter: !control.enabled ? 10
|
||||
: control.second.pressed ? 8
|
||||
: control.__isHighContrast && !control.hovered ? 0
|
||||
: control.second.hovered ? 14 : 10
|
||||
parent: control.second.handle
|
||||
width: diameter
|
||||
height: diameter
|
||||
radius: diameter * 0.5
|
||||
x: (control.__secondHandleConfig.second_handle.width - width) / 2
|
||||
y: (control.__secondHandleConfig.second_handle.height - height) / 2
|
||||
color: control.enabled ? (control.second.hovered ? Qt.rgba(control.palette.accent.r, control.palette.accent.g, control.palette.accent.b, 0.9020)
|
||||
: control.second.pressed ? Qt.rgba(control.palette.accent.r, control.palette.accent.g, control.palette.accent.b, 0.8)
|
||||
: control.palette.accent)
|
||||
: control.palette.accent
|
||||
Behavior on diameter {
|
||||
// From WindowsUI 3 Animation Values
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
background: Item {
|
||||
implicitWidth: control.horizontal
|
||||
? (_background.implicitWidth || _background.groove.implicitWidth)
|
||||
: (_background.implicitHeight || _background.groove.implicitHeight)
|
||||
implicitHeight: control.horizontal
|
||||
? (_background.implicitHeight || _background.groove.implicitHeight)
|
||||
: (_background.implicitWidth || _background.groove.implicitWidth)
|
||||
|
||||
property Item _background: Impl.StyleImage {
|
||||
visible: !control.__isHighContrast
|
||||
parent: control.background
|
||||
width: parent.width
|
||||
height: parent.width
|
||||
imageConfig: control.__config.background
|
||||
|
||||
property Item groove: Impl.StyleImage {
|
||||
parent: control.background._background
|
||||
x: control.leftPadding - control.leftInset + (control.horizontal
|
||||
? control.__firstHandleConfig.first_handle.width / 2
|
||||
: (control.availableWidth - width) / 2)
|
||||
y: control.topPadding - control.rightInset + (control.horizontal
|
||||
? ((control.availableHeight - height) / 2)
|
||||
: control.__firstHandleConfig.first_handle.height / 2)
|
||||
|
||||
width: control.horizontal
|
||||
? control.availableWidth
|
||||
- (control.__firstHandleConfig.first_handle.width / 2) - (control.__secondHandleConfig.second_handle.width / 2)
|
||||
: implicitWidth
|
||||
height: control.horizontal
|
||||
? implicitHeight
|
||||
: control.availableHeight
|
||||
- (control.__firstHandleConfig.first_handle.width / 2) - (control.__secondHandleConfig.second_handle.width / 2)
|
||||
imageConfig: control.__config.groove
|
||||
horizontal: control.horizontal
|
||||
|
||||
property Rectangle track: Rectangle {
|
||||
parent: control.background._background.groove
|
||||
x: control.horizontal ? parent.width * control.first.position : 0
|
||||
y: control.horizontal ? 0 : parent.height - (parent.height * control.second.position)
|
||||
implicitWidth: control.horizontal ? control.__config.track.width : control.__config.track.height
|
||||
implicitHeight: control.horizontal ? control.__config.track.height : control.__config.track.width
|
||||
width: control.horizontal
|
||||
? parent.width * (control.second.position - control.first.position)
|
||||
: parent.width
|
||||
height: control.horizontal
|
||||
? parent.height
|
||||
: parent.height * (control.second.position - control.first.position)
|
||||
radius: control.__config.track.height * 0.5
|
||||
color: control.palette.accent
|
||||
}
|
||||
}
|
||||
|
||||
property Repeater ticksTop: Repeater {
|
||||
parent: control.__isHighContrast ? control.background._highContrastBackground : control.background._background.groove
|
||||
model: control.__isDiscrete ? Math.floor(control.__steps) + 1 : 0
|
||||
delegate: Rectangle {
|
||||
width: control.horizontal ? 1 : 4
|
||||
height: control.horizontal ? 4 : 1
|
||||
x: control.horizontal
|
||||
? 6 + index * (parent.width - 2 * 6 - width) / (control.background._background.ticksTop.model - 1)
|
||||
: -4 - width
|
||||
y: control.horizontal
|
||||
? -4 - height
|
||||
: 6 + index * (parent.height - 2 * 6 - height) / (control.background._background.ticksTop.model - 1)
|
||||
color: Application.styleHints.colorScheme === Qt.Light ? "#9C000000" : "#9AFFFFFF"
|
||||
|
||||
required property int index
|
||||
}
|
||||
}
|
||||
|
||||
property Repeater ticksBottom: Repeater {
|
||||
parent: control.__isHighContrast ? control.background._highContrastBackground : control.background._background.groove
|
||||
model: control.__isDiscrete ? Math.floor(control.__steps) + 1 : 0
|
||||
delegate: Rectangle {
|
||||
width: control.horizontal ? 1 : 4
|
||||
height: control.horizontal ? 4 : 1
|
||||
x: control.horizontal
|
||||
? 6 + index * (parent.width - 2 * 6 - width) / (control.background._background.ticksBottom.model - 1)
|
||||
: parent.width + 4
|
||||
y: control.horizontal
|
||||
? parent.height + 4
|
||||
: 6 + index * (parent.height - 2 * 6 - height) / (control.background._background.ticksBottom.model - 1)
|
||||
color: Application.styleHints.colorScheme === Qt.Light ? "#9C000000" : "#9AFFFFFF"
|
||||
|
||||
required property int index
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Item _highContrastBackground: Rectangle {
|
||||
parent: control.background
|
||||
visible: control.__isHighContrast
|
||||
implicitWidth: control.horizontal ? 200 : 4
|
||||
implicitHeight: control.horizontal ? 4 : 200
|
||||
x: control.leftPadding - control.leftInset + (control.horizontal
|
||||
? control.__firstHandleConfig.first_handle.width / 2
|
||||
: (control.availableWidth - width) / 2)
|
||||
y: control.topPadding - control.topInset + (control.horizontal
|
||||
? ((control.availableHeight - height) / 2)
|
||||
: control.__firstHandleConfig.first_handle.height / 2)
|
||||
width: control.horizontal
|
||||
? control.availableWidth - control.__firstHandleConfig.first_handle.width
|
||||
: implicitWidth
|
||||
height: control.horizontal
|
||||
? implicitHeight
|
||||
: control.availableHeight - control.__firstHandleConfig.first_handle.width
|
||||
radius: 2
|
||||
color: control.palette.buttonText
|
||||
scale: control.horizontal && control.mirrored ? -1 : 1
|
||||
|
||||
Rectangle {
|
||||
x: control.horizontal ? parent.width * control.first.position : 0
|
||||
y: control.horizontal ? 0 : parent.height - (parent.height * control.second.position)
|
||||
implicitWidth: control.horizontal ? parent.width * (control.second.position - control.first.position) : parent.width
|
||||
implicitHeight: control.horizontal ? parent.height : parent.height * (control.second.position - control.first.position)
|
||||
radius: 2
|
||||
color: control.palette.highlight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
// Copyright (C) 2024 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.impl
|
||||
import QtQuick.Controls.FluentWinUI3.impl
|
||||
import QtQuick.Templates as T
|
||||
|
||||
T.RoundButton {
|
||||
id: control
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
implicitContentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
implicitContentHeight + topPadding + bottomPadding)
|
||||
|
||||
spacing: __config.spacing || 0
|
||||
|
||||
topPadding: __config.topPadding || 0
|
||||
bottomPadding: __config.bottomPadding || 0
|
||||
leftPadding: __config.leftPadding || 0
|
||||
rightPadding: __config.rightPadding || 0
|
||||
|
||||
icon.width: __config.icon.width
|
||||
icon.height: __config.icon.height
|
||||
icon.color: __buttonText
|
||||
|
||||
readonly property color __buttonText: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
return (control.enabled && ((control.flat && (control.down || control.hovered))
|
||||
|| ((control.highlighted || control.checked) && !control.down)))
|
||||
? control.palette.button
|
||||
: control.enabled && (control.hovered || control.down)
|
||||
? control.palette.highlight
|
||||
: control.palette.buttonText
|
||||
}
|
||||
if (control.down) {
|
||||
return (control.checked || control.highlighted)
|
||||
? Application.styleHints.colorScheme == Qt.Light
|
||||
? Color.transparent("white", 0.7) : Color.transparent("black", 0.5)
|
||||
: (Application.styleHints.colorScheme === Qt.Light
|
||||
? Color.transparent(control.palette.buttonText, 0.62)
|
||||
: Color.transparent(control.palette.buttonText, 0.7725))
|
||||
} else if (control.checked || control.highlighted) {
|
||||
return (Application.styleHints.colorScheme === Qt.Dark && !control.enabled)
|
||||
? Color.transparent("white", 0.5302)
|
||||
: (Application.styleHints.colorScheme === Qt.Dark ? "black" : "white")
|
||||
} else {
|
||||
return control.palette.buttonText
|
||||
}
|
||||
}
|
||||
|
||||
readonly property string __currentState: [
|
||||
(control.checked || control.highlighted) && "checked",
|
||||
!control.enabled && "disabled",
|
||||
control.enabled && !control.down && control.hovered && "hovered",
|
||||
control.down && "pressed"
|
||||
].filter(Boolean).join("_") || "normal"
|
||||
readonly property var __config: (control.flat && Config.controls.flatbutton
|
||||
? Config.controls.flatbutton[__currentState]
|
||||
: Config.controls.button[__currentState]) || {}
|
||||
|
||||
readonly property Item __focusFrameTarget: control
|
||||
|
||||
contentItem: IconLabel {
|
||||
spacing: control.spacing
|
||||
mirrored: control.mirrored
|
||||
display: control.display
|
||||
|
||||
icon: control.icon
|
||||
text: control.text
|
||||
font: control.font
|
||||
color: control.icon.color
|
||||
}
|
||||
|
||||
background: ButtonBackground {
|
||||
control: control
|
||||
implicitHeight: control.__config.background.height
|
||||
implicitWidth: implicitWidth
|
||||
radius: control.radius
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user