From 381aa10342b0fcaeaef874334ab1405c03474b85 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 7 Jul 2021 21:35:53 +0800 Subject: [PATCH] Add checked status --- qml/StandardItem.qml | 12 ++++++++++++ qml/main.qml | 1 + 2 files changed, 13 insertions(+) diff --git a/qml/StandardItem.qml b/qml/StandardItem.qml index 651bd5a..58b5bd8 100644 --- a/qml/StandardItem.qml +++ b/qml/StandardItem.qml @@ -39,6 +39,12 @@ Item { signal clicked signal rightClicked + onCheckedChanged: { + _bgRect.x = 0 + _bgRect.y = 0 + _bgRect.state = checked ? "shown" : "hidden" + } + MouseArea { id: _mouseArea anchors.fill: parent @@ -46,12 +52,18 @@ Item { hoverEnabled: true onEntered: { + if (checked) + return + _bgRect.x = mouseX _bgRect.y = mouseY _bgRect.state = "shown" } onExited: { + if (checked) + return + control.moveX = mouseX control.moveY = mouseY _bgRect.state = "hidden" diff --git a/qml/main.qml b/qml/main.qml index 2c04bff..0964b09 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -264,6 +264,7 @@ Item { StandardItem { id: controler + checked: controlCenter.visible animationEnabled: true Layout.fillHeight: true Layout.preferredWidth: _controlerLayout.implicitWidth + FishUI.Units.largeSpacing