Initial commit
This commit is contained in:
+110
@@ -0,0 +1,110 @@
|
||||
// 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
|
||||
|
||||
Rectangle {
|
||||
id: buttonBackground
|
||||
|
||||
visible: (control.enabled && control.hovered) || control.down || accented || !subtle
|
||||
|
||||
required property T.AbstractButton control
|
||||
property bool subtle: false
|
||||
property bool accented: control.highlighted || control.checked
|
||||
|
||||
readonly property bool lightScheme: Application.styleHints.colorScheme === Qt.Light
|
||||
readonly property bool highContrastScheme: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
|
||||
readonly property bool hasGradientStroke: !hasSolidStroke && !subtle && control.enabled
|
||||
readonly property bool hasSolidStroke: highContrastScheme
|
||||
|| (!subtle && (control.down || (!control.enabled && !accented)
|
||||
|| (!lightScheme && !accented)))
|
||||
readonly property color defaultStrokeColor: highContrastScheme
|
||||
? (control.enabled && (control.hovered || buttonBackground.accented)) ? control.palette.highlight : control.palette.buttonText
|
||||
: accented ? Qt.tint(control.palette.accent, control.palette.light)
|
||||
: control.palette.midlight
|
||||
readonly property color secondaryStrokeColor: accented ? Qt.tint(control.palette.accent, control.palette.mid) : control.palette.dark
|
||||
|
||||
property var highContrastBackgroundColorFunc: function() {
|
||||
if (subtle)
|
||||
return control.palette.highlight
|
||||
if (accented) {
|
||||
if (control.enabled && control.hovered && !control.down)
|
||||
return control.palette.buttonText
|
||||
if (control.enabled && !control.down)
|
||||
return control.palette.highlight
|
||||
} else if (control.enabled && (control.hovered || control.down)) {
|
||||
return (control as T.MenuBarItem) ? control.palette.button : control.palette.highlightedText
|
||||
}
|
||||
return control.palette.button
|
||||
}
|
||||
|
||||
readonly property color backgroundColor: {
|
||||
if (highContrastScheme)
|
||||
return highContrastBackgroundColorFunc()
|
||||
if (accented) {
|
||||
if (control.enabled && control.down) {
|
||||
if (lightScheme)
|
||||
return Qt.tint(control.palette.accent, Color.transparent("white", 0.2))
|
||||
return Qt.tint(control.palette.accent, Color.transparent("black", 0.2))
|
||||
}
|
||||
if (control.enabled && control.hovered) {
|
||||
if (lightScheme)
|
||||
return Qt.tint(control.palette.accent, Color.transparent("white", 0.1))
|
||||
return Qt.tint(control.palette.accent, Color.transparent("black", 0.1))
|
||||
}
|
||||
return control.palette.accent
|
||||
}
|
||||
|
||||
if (subtle) {
|
||||
if (control.down)
|
||||
return lightScheme ? Color.transparent("black", 0.02) : Color.transparent("white", 0.04)
|
||||
if (control.hovered)
|
||||
return lightScheme ? Color.transparent("black", 0.04) : Color.transparent("white", 0.06)
|
||||
}
|
||||
|
||||
if (control.down) {
|
||||
if (lightScheme)
|
||||
return Qt.rgba(control.palette.button.r * 0.97, control.palette.button.g * 0.97, control.palette.button.b * 0.97, 0.3)
|
||||
return Color.transparent(control.palette.button, 0.03)
|
||||
} else if (control.enabled && control.hovered) {
|
||||
if (lightScheme)
|
||||
return Qt.rgba(control.palette.button.r * 0.97, control.palette.button.g * 0.97, control.palette.button.b * 0.97, 0.5)
|
||||
return Color.transparent(control.palette.button, 0.08)
|
||||
} else {
|
||||
return control.palette.button
|
||||
}
|
||||
}
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: hasGradientStroke ? defaultStrokeColor : "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.91
|
||||
color: hasGradientStroke ? defaultStrokeColor : "transparent"
|
||||
}
|
||||
GradientStop {
|
||||
position: 1.0
|
||||
color: hasGradientStroke ? secondaryStrokeColor : "transparent"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: !buttonBackground.hasGradientStroke ? 0 : border.width
|
||||
y: !buttonBackground.hasGradientStroke ? 0 : border.width
|
||||
width: !buttonBackground.hasGradientStroke ? parent.width : parent.width - border.width * 2
|
||||
height: !buttonBackground.hasGradientStroke ? parent.height : parent.height - border.width * 2
|
||||
radius: !buttonBackground.hasGradientStroke ? buttonBackground.radius : buttonBackground.radius - border.width
|
||||
border.width: 1
|
||||
border.color: buttonBackground.hasGradientStroke || buttonBackground.subtle
|
||||
|| (highContrastScheme && !buttonBackground.accented && control.down && !(control as T.MenuBarItem))
|
||||
|| (!highContrastScheme && buttonBackground.accented && (!control.enabled || control.down))
|
||||
? "transparent" : buttonBackground.defaultStrokeColor
|
||||
color: buttonBackground.backgroundColor
|
||||
}
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
// 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
|
||||
import QtQuick.Shapes
|
||||
|
||||
ColorImage {
|
||||
id: indicator
|
||||
|
||||
required property T.AbstractButton control
|
||||
required property url filePath
|
||||
|
||||
readonly property color __color: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast)
|
||||
return control.palette.button
|
||||
if (control.enabled && control.checkState !== Qt.Unchecked)
|
||||
return control.palette.accent
|
||||
return defaultColor
|
||||
}
|
||||
|
||||
readonly property color __indicatorColor: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
if (control.checkState === Qt.Checked)
|
||||
return control.down ? control.palette.buttonText : control.hovered ? control.palette.button : control.palette.highlightedText
|
||||
if (control.checkState === Qt.PartiallyChecked)
|
||||
return control.hovered && !control.down ? control.palette.highlight : control.palette.highlightedText
|
||||
return "transparent"
|
||||
} else if (control.down) {
|
||||
return Application.styleHints.colorScheme === Qt.Light ? Qt.rgba(1, 1, 1, 0.7) : Qt.rgba(0, 0, 0, 0.5)
|
||||
} else if (Application.styleHints.colorScheme === Qt.Dark && !control.enabled)
|
||||
return Qt.rgba(1, 1, 1, 0.5302)
|
||||
else if (Application.styleHints.colorScheme === Qt.Dark)
|
||||
return "black"
|
||||
else
|
||||
return "white"
|
||||
}
|
||||
|
||||
source: filePath
|
||||
color: __color
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 4
|
||||
color: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
if (control.checkState === Qt.Unchecked)
|
||||
return control.down ? control.palette.highlight : control.hovered ? control.palette.highlightedText : control.palette.button
|
||||
if (control.checkState === Qt.PartiallyChecked)
|
||||
return control.hovered && !control.down ? control.palette.highlightedText : control.palette.highlight
|
||||
return control.down ? control.palette.button : control.hovered ? control.palette.buttonText : control.palette.highlight
|
||||
}
|
||||
return "transparent"
|
||||
}
|
||||
border.color: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
if (control.checkState === Qt.Unchecked)
|
||||
return control.hovered ? control.palette.highlight : control.palette.buttonText
|
||||
if (control.checkState === Qt.PartiallyChecked)
|
||||
return control.palette.highlight
|
||||
}
|
||||
return "transparent"
|
||||
}
|
||||
|
||||
// TODO: Add animation for checkmark indicator
|
||||
Shape {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 12
|
||||
height: 12
|
||||
visible: control.checked
|
||||
|
||||
antialiasing: true
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 1
|
||||
strokeColor: indicator.__indicatorColor
|
||||
fillColor: "transparent"
|
||||
capStyle: ShapePath.RoundCap
|
||||
joinStyle: ShapePath.RoundJoin
|
||||
|
||||
startX: 1
|
||||
startY: 6
|
||||
PathLine { x: 5; y: 10 }
|
||||
PathLine { x: 11; y: 3 }
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
visible: control.checkState === Qt.PartiallyChecked
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: 8
|
||||
height: 1
|
||||
radius: height * 0.5
|
||||
color: indicator.__indicatorColor
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// 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.Controls.impl
|
||||
|
||||
CopyAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// 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.Controls.impl
|
||||
|
||||
CutAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// 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.Controls.impl
|
||||
|
||||
DeleteAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
// 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
|
||||
|
||||
Rectangle {
|
||||
|
||||
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,10 @@
|
||||
// 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.Controls.impl
|
||||
|
||||
PasteAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
+82
@@ -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 QtQuick.Templates as T
|
||||
|
||||
ColorImage {
|
||||
id: indicator
|
||||
|
||||
required property T.AbstractButton control
|
||||
required property url filePath
|
||||
|
||||
source: filePath
|
||||
color: control.enabled && control.checked ? control.palette.accent : defaultColor
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
visible: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
color: {
|
||||
if (control.hovered)
|
||||
return control.checked ? control.palette.button : control.palette.highlightedText
|
||||
return control.checked ? control.palette.highlightedText : control.palette.button
|
||||
}
|
||||
border.width: control.down ? 0 : 1
|
||||
border.color: {
|
||||
if (control.hovered)
|
||||
return control.checked ? control.palette.buttonText : control.palette.highlight
|
||||
return control.checked ? control.palette.highlight : control.palette.buttonText
|
||||
}
|
||||
radius: height * 0.5
|
||||
}
|
||||
|
||||
property Item indicatorBackground: Rectangle {
|
||||
parent: control.indicator
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 15 : 10
|
||||
height: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast ? 15 : 10
|
||||
radius: height * 0.5
|
||||
scale: !control.checked && !control.down ? 0 : control.down && control.checked ? 0.8 : control.hovered ? 1.2 : 1
|
||||
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: !control.checked ? "transparent" : Application.styleHints.colorScheme == Qt.Light ? "#0F000000" : "#12FFFFFF"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.5
|
||||
color: !control.checked ? "transparent" : Application.styleHints.colorScheme == Qt.Light ? "#0F000000" : "#12FFFFFF"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.95
|
||||
color: !control.checked ? "transparent" : Application.styleHints.colorScheme == Qt.Light ? "#29000000" : "#18FFFFFF"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: parent.width - 2
|
||||
height: parent.height - 2
|
||||
radius: height * 0.5
|
||||
color: {
|
||||
if (Application.styleHints.accessibility.contrastPreference === Qt.HighContrast) {
|
||||
if (control.checked && (control.down || control.hovered))
|
||||
return control.palette.buttonText
|
||||
return control.palette.highlight
|
||||
} else
|
||||
return Application.styleHints.colorScheme === Qt.Dark ? "black" : "white"
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on scale {
|
||||
NumberAnimation {
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// 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
|
||||
|
||||
import QtQuick.Controls.impl
|
||||
|
||||
RedoAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// 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.Controls.impl
|
||||
|
||||
SelectAllAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
// 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
|
||||
|
||||
// This item will resize the child image in such a way that any drop shadow
|
||||
// or blur (or other effects) will be drawn outside its own bounds.
|
||||
// The effect is that users of this item won't have to take e.g shadows
|
||||
// into account when positioning it, as such effects will only be visual, and
|
||||
// not be a part of the geometry, unless drawShadowWithinBounds is set to true.
|
||||
|
||||
Item {
|
||||
id: root
|
||||
implicitWidth: horizontal ? imageConfig.width : imageConfig.height
|
||||
implicitHeight: horizontal ? imageConfig.height : imageConfig.width
|
||||
|
||||
required property var imageConfig
|
||||
|
||||
// Set horizontal to false if you want the image to be rotated 90 degrees
|
||||
// Doing so will rotate the image, but also flip it, to make sure that
|
||||
// the shadow ends up on the correct side. The implicit geometry of the
|
||||
// item will also be adjusted to match the rotated image.
|
||||
property bool horizontal: true
|
||||
property bool drawShadowWithinBounds: false
|
||||
|
||||
// The minimum size of the image should be at least 1px tall and wide, even without any offsets
|
||||
property real minimumWidth: Math.max(1, imageConfig.leftOffset + imageConfig.rightOffset)
|
||||
property real minimumHeight: Math.max(1, imageConfig.topOffset + imageConfig.bottomOffset)
|
||||
|
||||
BorderImage {
|
||||
x: root.drawShadowWithinBounds ? 0 : -imageConfig.leftShadow
|
||||
y: root.drawShadowWithinBounds ? 0 : -imageConfig.topShadow
|
||||
width: Math.max(root.minimumWidth, (root.horizontal ? root.width : root.height))
|
||||
+ (root.drawShadowWithinBounds ? 0 : imageConfig.leftShadow + imageConfig.rightShadow)
|
||||
height: Math.max(root.minimumHeight, (root.horizontal ? root.height : root.width))
|
||||
+ (root.drawShadowWithinBounds ? 0 : imageConfig.topShadow + imageConfig.bottomShadow)
|
||||
source: imageConfig.filePath ? `qrc:/qt-project.org/imports/QtQuick/Controls/FluentWinUI3/${imageConfig.filePath}` : ""
|
||||
|
||||
border {
|
||||
top: Math.min(height / 2, imageConfig.topOffset + imageConfig.topShadow)
|
||||
left: Math.min(width / 2, imageConfig.leftOffset + imageConfig.leftShadow)
|
||||
bottom: Math.min(height / 2, imageConfig.bottomOffset + imageConfig.bottomShadow)
|
||||
right: Math.min(width / 2, imageConfig.rightOffset + imageConfig.rightShadow)
|
||||
}
|
||||
|
||||
transform: [
|
||||
Rotation {
|
||||
angle: root.horizontal ? 0 : 90
|
||||
},
|
||||
Scale {
|
||||
xScale: root.horizontal ? 1 : -1
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
// 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
|
||||
|
||||
Item {
|
||||
id: indicator
|
||||
|
||||
required property T.AbstractButton control
|
||||
|
||||
property Item handleBackground: Rectangle {
|
||||
parent: control.indicator
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
radius: height * 0.5
|
||||
border.width: control.checked && Application.styleHints.accessibility.contrastPreference === Qt.NoPreference ? 0 : 1
|
||||
border.color: control.enabled ? Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
? control.checked ? (control.hovered ? control.palette.text : "transparent") : (control.hovered ? control.palette.accent : control.palette.text)
|
||||
: Application.styleHints.colorScheme === Qt.Light ? "#9C000000" : "#9CFFFFFF"
|
||||
: Application.styleHints.colorScheme === Qt.Light ? "#37000000" : "#28FFFFFF"
|
||||
|
||||
color: control.checked ? checkedColor : !control.enabled ? "#00FFFFFF"
|
||||
: control.hovered ? Application.styleHints.colorScheme === Qt.Light ? "#0F000000" : "#0BFFFFFF"
|
||||
: control.pressed ? Application.styleHints.colorScheme === Qt.Light ? "#18000000" : "#12FFFFFF"
|
||||
: Application.styleHints.colorScheme === Qt.Light ? "#06000000" : "#19000000"
|
||||
|
||||
readonly property color checkedColor: control.enabled ? (control.hovered
|
||||
? Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
? control.palette.window
|
||||
: Qt.rgba(control.palette.accent.r, control.palette.accent.g, control.palette.accent.b, 0.9020)
|
||||
: control.pressed ? Qt.rgba(control.palette.accent.r, control.palette.accent.g, control.palette.accent.b, 0.8)
|
||||
: control.palette.accent)
|
||||
: control.palette.accent
|
||||
|
||||
property Item handle: Rectangle {
|
||||
parent: indicator.handleBackground
|
||||
x: Math.max(0, Math.min(parent.width - width, control.visualPosition * parent.width - (width / 2)))
|
||||
y: (parent.height - height) / 2
|
||||
width: control.pressed ? implicitWidth + 3 : implicitWidth
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
radius: height / 2
|
||||
scale: control.hovered && control.enabled ? 0.8 : 0.7
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: !control.checked ? "transparent" : Application.styleHints.colorScheme === Qt.Light ? "#0F000000" : "#12FFFFFF"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.5
|
||||
color: !control.checked ? "transparent" : Application.styleHints.colorScheme === Qt.Light ? "#0F000000" : "#12FFFFFF"
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.95
|
||||
color: !control.checked ? "transparent" : Application.styleHints.colorScheme === Qt.Light ? "#29000000" : "#18FFFFFF"
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
x: (parent.width - width) / 2
|
||||
y: (parent.height - height) / 2
|
||||
width: parent.width - 2
|
||||
height: parent.height - 2
|
||||
radius: height / 2
|
||||
color: !control.checked ? Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
? (control.hovered ? control.palette.accent : control.palette.text)
|
||||
: control.palette.placeholderText
|
||||
: Application.styleHints.accessibility.contrastPreference === Qt.HighContrast
|
||||
? (control.hovered ? control.palette.text : control.palette.window)
|
||||
: Application.styleHints.colorScheme === Qt.Dark ? "black" : "white"
|
||||
}
|
||||
|
||||
Behavior on scale {
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
Behavior on x {
|
||||
enabled: !control.pressed
|
||||
NumberAnimation {
|
||||
duration: 167
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
// Copyright (C) 2025 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
|
||||
// Qt-Security score:significant reason:default
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls.FluentWinUI3
|
||||
import QtQuick.Controls.FluentWinUI3.impl as FluentWinUI3Impl
|
||||
|
||||
Menu {
|
||||
id: menu
|
||||
popupType: Qt.platform.pluginName !== "wayland" ? Popup.Window : Popup.Item
|
||||
|
||||
required property Item editor
|
||||
|
||||
FluentWinUI3Impl.UndoAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
FluentWinUI3Impl.RedoAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
|
||||
FluentWinUI3Impl.CutAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
FluentWinUI3Impl.CopyAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
FluentWinUI3Impl.PasteAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
FluentWinUI3Impl.DeleteAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
|
||||
MenuSeparator {}
|
||||
|
||||
FluentWinUI3Impl.SelectAllAction {
|
||||
editor: menu.editor
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// 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
|
||||
|
||||
import QtQuick.Controls.impl
|
||||
|
||||
UndoAction {
|
||||
icon.width: 16
|
||||
icon.height: 16
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
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/qquickfluentwinui3focusstroke_p.h"
|
||||
lineNumber: 20
|
||||
name: "QQuickFluentWinUI3FocusStroke"
|
||||
accessSemantics: "reference"
|
||||
prototype: "QQuickPaintedItem"
|
||||
exports: ["QtQuick.Controls.FluentWinUI3.impl/FocusStroke 6.8"]
|
||||
exportMetaObjectRevisions: [1544]
|
||||
Property {
|
||||
name: "color"
|
||||
type: "QColor"
|
||||
read: "color"
|
||||
write: "setColor"
|
||||
index: 0
|
||||
lineNumber: 23
|
||||
isFinal: true
|
||||
}
|
||||
Property {
|
||||
name: "radius"
|
||||
type: "int"
|
||||
read: "radius"
|
||||
write: "setRadius"
|
||||
index: 1
|
||||
lineNumber: 24
|
||||
isFinal: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
module QtQuick.Controls.FluentWinUI3.impl
|
||||
linktarget Qt6::qtquickcontrols2fluentwinui3styleimplplugin
|
||||
optional plugin qtquickcontrols2fluentwinui3styleimplplugin
|
||||
classname QtQuickControls2FluentWinUI3StyleImplPlugin
|
||||
typeinfo plugins.qmltypes
|
||||
depends QtQuick auto
|
||||
prefer :/qt-project.org/imports/QtQuick/Controls/FluentWinUI3/impl/
|
||||
ButtonBackground 6.0 ButtonBackground.qml
|
||||
ButtonBackground 2.0 ButtonBackground.qml
|
||||
CheckIndicator 6.0 CheckIndicator.qml
|
||||
CheckIndicator 2.0 CheckIndicator.qml
|
||||
CopyAction 6.11 CopyAction.qml
|
||||
CutAction 6.11 CutAction.qml
|
||||
DeleteAction 6.11 DeleteAction.qml
|
||||
FocusFrame 6.0 FocusFrame.qml
|
||||
FocusFrame 2.0 FocusFrame.qml
|
||||
PasteAction 6.11 PasteAction.qml
|
||||
RadioIndicator 6.0 RadioIndicator.qml
|
||||
RadioIndicator 2.0 RadioIndicator.qml
|
||||
RedoAction 6.11 RedoAction.qml
|
||||
SelectAllAction 6.11 SelectAllAction.qml
|
||||
SwitchIndicator 6.0 SwitchIndicator.qml
|
||||
SwitchIndicator 2.0 SwitchIndicator.qml
|
||||
StyleImage 6.0 StyleImage.qml
|
||||
StyleImage 2.0 StyleImage.qml
|
||||
TextEditingContextMenu 6.11 TextEditingContextMenu.qml
|
||||
UndoAction 6.11 UndoAction.qml
|
||||
|
||||
Reference in New Issue
Block a user