FluentUI/FluentUI/SelectionRectangle.qml
yxdy a44db97aa3
Some checks failed
Gallery App Build / Windows (push) Has been cancelled
Gallery App Build / macOS (push) Has been cancelled
Gallery App Build / Ubuntu (push) Has been cancelled
init
2025-02-12 10:31:20 +08:00

47 lines
1.3 KiB
QML

import QtQuick
import QtQuick.Templates as T
import FluentUI.Controls
import FluentUI.impl
T.SelectionRectangle {
id: control
FluentUI.theme: Theme.of(control)
property var accentColor: FluentUI.theme.accentColor
topLeftHandle: Handle {}
bottomRightHandle: Handle {}
component Handle : Rectangle {
id: handle
property Item handleControl: SelectionRectangle.control
width: 20
height: width
radius: width / 2
color: control.FluentUI.theme.res.controlSolidFillColorDefault
Shadow{
radius: width / 2
}
visible: SelectionRectangle.control.active
Rectangle{
width: 10
height: 10
anchors.centerIn: parent
radius: width / 2
scale:{
if(!handleControl.enabled){
return 1
}
if(handleControl.pressed){
return 0.9
}
return handleControl.hovered ? 1.2 : 1
}
color: Theme.checkedInputColor(handleControl,control.accentColor,control.FluentUI.dark)
Behavior on scale{
NumberAnimation{
duration: Theme.fastAnimationDuration
easing.type: Theme.animationCurve
}
}
}
}
}