From 5718e9308f0257b3f8ca211cc98d96e25bfa2b79 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 9 Aug 2024 13:39:38 +0800 Subject: [PATCH 1/3] chore: ListView hover background color tweak light: #000000 %10 dark: #ffffff %10 --- qt6/src/qml/ListView.qml | 11 +++++++++++ qt6/src/qml/private/ButtonPanel.qml | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/qt6/src/qml/ListView.qml b/qt6/src/qml/ListView.qml index 562839d36..ba2da84d2 100644 --- a/qt6/src/qml/ListView.qml +++ b/qt6/src/qml/ListView.qml @@ -160,8 +160,19 @@ ListView { active: hoveredItem sourceComponent: P.ButtonPanel { button: hoveredItem + enableAnimation: false // avoid hover animation outsideBorderColor: null + insideBorderColor: null visible: hoveredItem && !hoveredItem.checked && hoveredItem.enabled + color1: D.Palette { + normal { + common: Qt.rgba(0, 0, 0, 0.1) + } + normalDark { + common: Qt.rgba(1, 1, 1, 0.1) + } + } + color2: color1 } } diff --git a/qt6/src/qml/private/ButtonPanel.qml b/qt6/src/qml/private/ButtonPanel.qml index f8c62798e..a77aa8bb0 100644 --- a/qt6/src/qml/private/ButtonPanel.qml +++ b/qt6/src/qml/private/ButtonPanel.qml @@ -11,6 +11,7 @@ BoxPanel { id: control property Item button + property bool enableAnimation: control.D.ColorSelector.controlState === D.DTK.HoveredState && control.D.ColorSelector.family === D.Palette.CommonColor color1: selectValue(DS.Style.button.background1, DS.Style.checkedButton.background, DS.Style.highlightedButton.background1) color2: selectValue(DS.Style.button.background2, DS.Style.checkedButton.background, DS.Style.highlightedButton.background2) insideBorderColor: selectValue(DS.Style.button.insideBorder, null, DS.Style.highlightedButton.border) @@ -52,8 +53,7 @@ BoxPanel { CicleSpreadAnimation { id: hoverAnimation anchors.fill: parent - visible: control.D.ColorSelector.controlState === D.DTK.HoveredState - && control.D.ColorSelector.family === D.Palette.CommonColor + visible: enableAnimation Rectangle { anchors.fill: parent From a450fbaebb77ebe5a37c868b4c6f296b8b973489 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 9 Aug 2024 13:42:46 +0800 Subject: [PATCH 2/3] chore: avoid warnning read property from null --- qt6/src/qml/ButtonBox.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/qt6/src/qml/ButtonBox.qml b/qt6/src/qml/ButtonBox.qml index 2f116fc62..fb5688ccf 100644 --- a/qt6/src/qml/ButtonBox.qml +++ b/qt6/src/qml/ButtonBox.qml @@ -35,17 +35,17 @@ Control { ParallelAnimation { running: btnGroup.checkedButton && (btnGroup.checkedButton.x !== backgroundPanel.x || btnGroup.checkedButton.y !== backgroundPanel.y) - NumberAnimation { target: backgroundPanel; property: "x"; to: btnGroup.checkedButton.x; duration: 200 } - NumberAnimation { target: backgroundPanel; property: "y"; to: btnGroup.checkedButton.y; duration: 200 } - NumberAnimation { target: backgroundPanel; property: "width"; to: btnGroup.checkedButton.width; duration: 200 } - NumberAnimation { target: backgroundPanel; property: "height"; to: btnGroup.checkedButton.height; duration: 200 } + NumberAnimation { target: backgroundPanel; property: "x"; to: btnGroup.checkedButton ? btnGroup.checkedButton.x : backgroundPanel.x; duration: 200 } + NumberAnimation { target: backgroundPanel; property: "y"; to: btnGroup.checkedButton ? btnGroup.checkedButton.y : backgroundPanel.y; duration: 200 } + NumberAnimation { target: backgroundPanel; property: "width"; to: btnGroup.checkedButton ? btnGroup.checkedButton.width : backgroundPanel.width; duration: 200 } + NumberAnimation { target: backgroundPanel; property: "height"; to: btnGroup.checkedButton ? btnGroup.checkedButton.height : backgroundPanel.height; duration: 200 } } P.ButtonPanel { id: backgroundPanel visible: btnGroup.checkedButton - implicitWidth: btnGroup.checkedButton.width - implicitHeight: btnGroup.checkedButton.height + implicitWidth: visible ? btnGroup.checkedButton.width : 0 + implicitHeight: visible ? btnGroup.checkedButton.height : 0 button: control outsideBorderColor: null color1: D.Palette { From df068ba2f073c92017a2cc0fd862bf402cd1f226 Mon Sep 17 00:00:00 2001 From: ck Date: Fri, 9 Aug 2024 13:52:35 +0800 Subject: [PATCH 3/3] fix: drag item image pixelated image size == item size --- qt6/src/qml/DragItemsImage.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qt6/src/qml/DragItemsImage.qml b/qt6/src/qml/DragItemsImage.qml index 934b362b0..e978a6834 100644 --- a/qt6/src/qml/DragItemsImage.qml +++ b/qt6/src/qml/DragItemsImage.qml @@ -55,7 +55,9 @@ Item { if (!item) return - // item.dragActive = true + img.width = item.width + img.height = item.height + aboutToGrabToImage(item) item.grabToImage(function(result) { img.source = result.url