From ea8f25ff736e6de2ae2b93421e75722d4306dee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E5=AD=90=E6=A5=9A=5Czhuzi?= Date: Tue, 19 Mar 2024 18:06:58 +0800 Subject: [PATCH] update --- example/example_en_US.ts | 6 ++-- example/example_zh_CN.ts | 6 ++-- example/qml/page/T_TableView.qml | 3 +- .../FluentUI/Controls/FluTableView.qml | 34 ++++++++++++------- .../FluentUI/Controls/FluWindowDialog.qml | 1 + .../FluentUI/Controls/FluTableView.qml | 34 ++++++++++++------- .../FluentUI/Controls/FluWindowDialog.qml | 2 ++ 7 files changed, 55 insertions(+), 31 deletions(-) diff --git a/example/example_en_US.ts b/example/example_en_US.ts index ebc9833b..e3d09e49 100644 --- a/example/example_en_US.ts +++ b/example/example_en_US.ts @@ -1982,17 +1982,17 @@ My only desire is to be permitted to drive out the traitors and restore the Han. - + Options - + <Previous - + Next> diff --git a/example/example_zh_CN.ts b/example/example_zh_CN.ts index 40df5ef0..01ca4e79 100644 --- a/example/example_zh_CN.ts +++ b/example/example_zh_CN.ts @@ -2052,17 +2052,17 @@ My only desire is to be permitted to drive out the traitors and restore the Han. 长字符串 - + Options 操作 - + <Previous <上一页 - + Next> 下一页> diff --git a/example/qml/page/T_TableView.qml b/example/qml/page/T_TableView.qml index 31296ec1..e3c509be 100644 --- a/example/qml/page/T_TableView.qml +++ b/example/qml/page/T_TableView.qml @@ -506,7 +506,8 @@ FluContentPage{ dataIndex: 'longstring', width:200, minimumWidth:100, - maximumWidth:300 + maximumWidth:300, + editMultiline: true }, { title: qsTr("Options"), diff --git a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml index 8aa5fb5e..b06c2c68 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml @@ -97,27 +97,23 @@ Rectangle { id:com_edit_multiline Item{ anchors.fill: parent - ScrollView{ + Flickable{ id:item_scroll clip: true anchors.fill: parent - ScrollBar.vertical: FluScrollBar{ - parent: item_scroll - x: item_scroll.mirrored ? 0 : item_scroll.width - width - y: item_scroll.topPadding - height: item_scroll.availableHeight - active: item_scroll.ScrollBar.horizontal.active - } - FluMultilineTextBox { + ScrollBar.vertical: multiline_text_srcoll_bar + boundsBehavior: Flickable.StopAtBounds + TextArea.flickable: FluMultilineTextBox { id:text_box - text: display + text: String(display) readOnly: true === d.columns_data[column].readOnly verticalAlignment: TextInput.AlignVCenter + isCtrlEnterForNewline: true Component.onCompleted: { forceActiveFocus() selectAll() } - rightPadding: 24 + rightPadding: 34 onCommit: { if(!readOnly){ editTextChaged(text_box.text) @@ -131,6 +127,9 @@ Rectangle { iconSize: 10 width: 20 height: 20 + padding: 0 + verticalPadding: 0 + horizontalPadding: 0 visible: { if(text_box.readOnly) return false @@ -139,12 +138,23 @@ Rectangle { anchors{ verticalCenter: parent.verticalCenter right: parent.right - rightMargin: 5 + rightMargin: 15 } onClicked:{ text_box.text = "" } } + FluScrollBar{ + id:multiline_text_srcoll_bar + anchors{ + right: parent.right + rightMargin: 5 + top: parent.top + bottom: parent.bottom + topMargin: 3 + bottomMargin: 3 + } + } } } Component{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml b/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml index 582774ec..7468ac21 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindowDialog.qml @@ -27,6 +27,7 @@ FluWindow { function showDialog(){ var x = transientParent.x + (transientParent.width - width)/2 var y = transientParent.y + (transientParent.height - height)/2 + control.stayTop = Qt.binding(function(){return transientParent.stayTop}) setGeometry(x,y,width,height) visible = true } diff --git a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml index b934c4fb..f2160281 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml @@ -98,27 +98,23 @@ Rectangle { id:com_edit_multiline Item{ anchors.fill: parent - ScrollView{ + Flickable{ id:item_scroll clip: true anchors.fill: parent - ScrollBar.vertical: FluScrollBar{ - parent: item_scroll - x: item_scroll.mirrored ? 0 : item_scroll.width - width - y: item_scroll.topPadding - height: item_scroll.availableHeight - active: item_scroll.ScrollBar.horizontal.active - } - FluMultilineTextBox { + ScrollBar.vertical: multiline_text_srcoll_bar + boundsBehavior: Flickable.StopAtBounds + TextArea.flickable: FluMultilineTextBox { id:text_box - text: display + text: String(display) readOnly: true === d.columns_data[column].readOnly verticalAlignment: TextInput.AlignVCenter + isCtrlEnterForNewline: true Component.onCompleted: { forceActiveFocus() selectAll() } - rightPadding: 24 + rightPadding: 34 onCommit: { if(!readOnly){ editTextChaged(text_box.text) @@ -132,6 +128,9 @@ Rectangle { iconSize: 10 width: 20 height: 20 + padding: 0 + verticalPadding: 0 + horizontalPadding: 0 visible: { if(text_box.readOnly) return false @@ -140,12 +139,23 @@ Rectangle { anchors{ verticalCenter: parent.verticalCenter right: parent.right - rightMargin: 5 + rightMargin: 15 } onClicked:{ text_box.text = "" } } + FluScrollBar{ + id:multiline_text_srcoll_bar + anchors{ + right: parent.right + rightMargin: 5 + top: parent.top + bottom: parent.bottom + topMargin: 3 + bottomMargin: 3 + } + } } } Component{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml b/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml index 60a40d21..18c8b2d3 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindowDialog.qml @@ -10,6 +10,7 @@ FluWindow { autoVisible: false autoCenter: false autoDestory: true + stayTop: true fixSize: true Loader{ anchors.fill: parent @@ -27,6 +28,7 @@ FluWindow { function showDialog(){ var x = transientParent.x + (transientParent.width - width)/2 var y = transientParent.y + (transientParent.height - height)/2 + control.stayTop = Qt.binding(function(){return transientParent.stayTop}) setGeometry(x,y,width,height) visible = true }