Files
clide/qml/Components/ClideHandle.qml

45 lines
941 B
QML
Raw Permalink Normal View History

2026-02-02 23:05:53 -05:00
// SPDX-FileCopyrightText: 2026, Shaun Reed <shaunrd0@gmail.com>
//
// SPDX-License-Identifier: GNU General Public License v3.0 or later
import QtQuick
import QtQuick.Controls
import clide.module 1.0
Rectangle {
2026-02-07 10:51:37 -05:00
id: root
2026-02-04 19:29:52 -05:00
readonly property color currentColor: {
if (pressed) {
return RustColors.pressed;
} else if (hovered) {
return RustColors.hovered;
} else {
2026-02-08 10:08:47 -05:00
return "transparent";
2026-02-04 19:29:52 -05:00
}
}
2026-02-02 23:05:53 -05:00
required property bool hovered
required property bool pressed
2026-02-04 19:29:52 -05:00
border.color: currentColor
color: currentColor
2026-02-02 23:05:53 -05:00
implicitHeight: 8
2026-02-08 10:08:47 -05:00
implicitWidth: 8
2026-02-02 23:05:53 -05:00
radius: 2.5
2026-02-07 10:51:37 -05:00
opacity: root.hovered ? 1.0 : 0.0
2026-02-02 23:05:53 -05:00
// Execute these behaviors when the color is changed.
Behavior on color {
ColorAnimation {
2026-02-07 10:51:37 -05:00
duration: 500
}
}
Behavior on opacity {
OpacityAnimator {
duration: 500
2026-02-02 23:05:53 -05:00
}
}
}