From 1566e3934e99fa60c932fc583db41af5396c1ca7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 27 Jun 2023 21:02:57 +0800 Subject: [PATCH] update --- src/imports/FluentUI/Controls/FluTableView.qml | 6 ++++-- src/imports/FluentUI/Controls/FluTextBox.qml | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/imports/FluentUI/Controls/FluTableView.qml b/src/imports/FluentUI/Controls/FluTableView.qml index 25ccc105..1c1a7e86 100644 --- a/src/imports/FluentUI/Controls/FluTableView.qml +++ b/src/imports/FluentUI/Controls/FluTableView.qml @@ -45,14 +45,16 @@ Rectangle { FluTextBox { anchors.fill: parent text: display + readOnly: true === columnSource[column].readOnly verticalAlignment: TextInput.AlignVCenter Component.onCompleted: { forceActiveFocus() selectAll() } onCommit: { - if(!columnSource[column].readOnly) + if(!readOnly){ display = text + } tableView.closeEditor() } } @@ -358,7 +360,7 @@ Rectangle { } function resetPosition(){ - table_view.positionViewAtCell(Qt.point(0, 0),Qt.AlignTop|Qt.AlignLeft) + table_view.positionViewAtCell(Qt.point(0, 0),Qt.AlignTop|Qt.AlignLeft) } } diff --git a/src/imports/FluentUI/Controls/FluTextBox.qml b/src/imports/FluentUI/Controls/FluTextBox.qml index 230a2f93..6f3b4b57 100644 --- a/src/imports/FluentUI/Controls/FluTextBox.qml +++ b/src/imports/FluentUI/Controls/FluTextBox.qml @@ -62,7 +62,11 @@ TextField{ width: 20 height: 20 opacity: 0.5 - visible: control.text !== "" + visible: { + if(control.readOnly) + return false + return control.text !== "" + } anchors{ verticalCenter: parent.verticalCenter right: parent.right