From e16a8d6b0990fa57edee72221181f21ef80cc227 Mon Sep 17 00:00:00 2001 From: zhuzichu Date: Sat, 22 Apr 2023 18:18:13 +0800 Subject: [PATCH] update --- src/controls/FluAppBar.qml | 2 -- src/controls/FluAutoSuggestBox.qml | 15 +++++++++----- src/controls/FluCarousel.qml | 2 ++ src/controls/FluDatePicker.qml | 1 - src/controls/FluPivot.qml | 3 +-- src/controls/FluRectangle.qml | 4 +++- src/controls/FluScrollBar.qml | 2 +- src/controls/FluTabView.qml | 29 +++++++++++++-------------- src/controls/FluTableView.qml | 2 +- src/controls/FluText.qml | 8 ++++---- src/controls/FluTextBoxBackground.qml | 2 +- src/controls/FluTextBoxMenu.qml | 3 +++ src/controls/FluTooltip.qml | 1 + src/controls/FluTreeView.qml | 1 + 14 files changed, 42 insertions(+), 33 deletions(-) diff --git a/src/controls/FluAppBar.qml b/src/controls/FluAppBar.qml index 64d1cf12..9fd26fb6 100644 --- a/src/controls/FluAppBar.qml +++ b/src/controls/FluAppBar.qml @@ -19,8 +19,6 @@ Rectangle{ property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.1) : Qt.rgba(0,0,0,0.06) property color closeNormalColor: Qt.rgba(0,0,0,0) property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1) - - property bool showDark: false property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark diff --git a/src/controls/FluAutoSuggestBox.qml b/src/controls/FluAutoSuggestBox.qml index 32ba2c24..5194cf32 100644 --- a/src/controls/FluAutoSuggestBox.qml +++ b/src/controls/FluAutoSuggestBox.qml @@ -3,20 +3,25 @@ import QtQuick.Controls import FluentUI FluTextBox{ + property var items:[] property string emptyText: "没有找到结果" property int autoSuggestBoxReplacement: FluentIcons.Search signal itemClicked(var data) signal handleClicked + + id:control + width: 300 + + Component.onCompleted: { + loadData() + } + QtObject{ id:d property bool flagVisible: true } - id:control - width: 300 - Component.onCompleted: { - loadData() - } + Popup{ id:control_popup y:control.height diff --git a/src/controls/FluCarousel.qml b/src/controls/FluCarousel.qml index 759fed84..31c946ce 100644 --- a/src/controls/FluCarousel.qml +++ b/src/controls/FluCarousel.qml @@ -12,9 +12,11 @@ Item { id:control width: 400 height: 300 + ListModel{ id:content_model } + FluRectangle{ anchors.fill: parent radius: [control.radius,control.radius,control.radius,control.radius] diff --git a/src/controls/FluDatePicker.qml b/src/controls/FluDatePicker.qml index 84be305a..b5b13309 100644 --- a/src/controls/FluDatePicker.qml +++ b/src/controls/FluDatePicker.qml @@ -14,7 +14,6 @@ Rectangle { property bool changeFlag: true readonly property var rowData: ["","",""] - id:root color: { if(mouse_area.containsMouse){ diff --git a/src/controls/FluPivot.qml b/src/controls/FluPivot.qml index fc9301d4..d18958ed 100644 --- a/src/controls/FluPivot.qml +++ b/src/controls/FluPivot.qml @@ -4,13 +4,12 @@ import FluentUI Item { - - id:control default property alias content: d.children property alias currentIndex: nav_list.currentIndex property color normalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120 property color hoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black + id:control width: 400 height: 300 implicitHeight: height diff --git a/src/controls/FluRectangle.qml b/src/controls/FluRectangle.qml index 90728ab6..7177e033 100644 --- a/src/controls/FluRectangle.qml +++ b/src/controls/FluRectangle.qml @@ -3,12 +3,14 @@ import QtQuick.Controls import Qt5Compat.GraphicalEffects Item{ - id:control + property var radius:[0,0,0,0] property color color : "#FFFFFF" property bool shadow: true default property alias contentItem: container.data + id:control + FluShadow{ anchors.fill: container radius: control.radius[0] diff --git a/src/controls/FluScrollBar.qml b/src/controls/FluScrollBar.qml index 0a0d5b32..a814b595 100644 --- a/src/controls/FluScrollBar.qml +++ b/src/controls/FluScrollBar.qml @@ -3,13 +3,13 @@ import QtQuick.Controls import FluentUI ScrollBar { - id: control property color handleNormalColor: Qt.rgba(134/255,134/255,134/255,1) property color handleHoverColor: Qt.lighter(handleNormalColor) property color handlePressColor: Qt.darker(handleNormalColor) property bool expand: false + id: control implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, diff --git a/src/controls/FluTabView.qml b/src/controls/FluTabView.qml index 6cdd7ea3..ced4b68a 100644 --- a/src/controls/FluTabView.qml +++ b/src/controls/FluTabView.qml @@ -5,21 +5,6 @@ import FluentUI Item { - id:control - anchors.fill: { - if(parent) - return parent - return undefined - } - - implicitHeight: height - implicitWidth: width - - MouseArea{ - anchors.fill: parent - preventStealing: true - } - enum TabWidthBehavior { Equal, SizeToContent, @@ -38,6 +23,15 @@ Item { property bool addButtonVisibility: true signal newPressed + id:control + implicitHeight: height + implicitWidth: width + anchors.fill: { + if(parent) + return parent + return undefined + } + QtObject { id: d property int dragIndex: -1 @@ -46,6 +40,11 @@ Item { property int maxEqualWidth: 240 } + MouseArea{ + anchors.fill: parent + preventStealing: true + } + ListModel{ id:tab_model } diff --git a/src/controls/FluTableView.qml b/src/controls/FluTableView.qml index ad74a3c0..c2d6e7ab 100644 --- a/src/controls/FluTableView.qml +++ b/src/controls/FluTableView.qml @@ -5,7 +5,6 @@ import FluentUI Item { - id:control property var columns : [] property var dataSource : [] property int pageCurrent: 1 @@ -14,6 +13,7 @@ Item { property int itemHeight: 56 signal requestPage(int page,int count) + id:control implicitHeight: layout_coumns.height + layout_table.height MouseArea{ diff --git a/src/controls/FluText.qml b/src/controls/FluText.qml index 4224a182..a6a8bbf4 100644 --- a/src/controls/FluText.qml +++ b/src/controls/FluText.qml @@ -3,10 +3,6 @@ import FluentUI Text { - property int fontStyle: FluText.Body - property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220 - property int pixelSize : FluTheme.textSize - enum FontStyle { Display, TitleLarge, @@ -17,6 +13,10 @@ Text { Caption } + property int fontStyle: FluText.Body + property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220 + property int pixelSize : FluTheme.textSize + id:text color: textColor renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering diff --git a/src/controls/FluTextBoxBackground.qml b/src/controls/FluTextBoxBackground.qml index a8dc03e1..6260fc6c 100644 --- a/src/controls/FluTextBoxBackground.qml +++ b/src/controls/FluTextBoxBackground.qml @@ -2,10 +2,10 @@ import Qt5Compat.GraphicalEffects Rectangle{ - id:content property Item inputItem + id:content radius: 4 layer.enabled: true color: { diff --git a/src/controls/FluTextBoxMenu.qml b/src/controls/FluTextBoxMenu.qml index 5c6b7214..8ff1e319 100644 --- a/src/controls/FluTextBoxMenu.qml +++ b/src/controls/FluTextBoxMenu.qml @@ -1,12 +1,15 @@ import QtQuick +import QtQuick.Controls import FluentUI FluMenu{ + property string cutText : "剪切" property string copyText : "复制" property string pasteText : "粘贴" property string selectAllText : "全选" property var inputItem + id:menu focus: false FluMenuItem{ diff --git a/src/controls/FluTooltip.qml b/src/controls/FluTooltip.qml index f10b3e03..5d189fdc 100644 --- a/src/controls/FluTooltip.qml +++ b/src/controls/FluTooltip.qml @@ -3,6 +3,7 @@ import QtQuick.Controls import FluentUI ToolTip { + id:tool_tip contentItem: FluText { diff --git a/src/controls/FluTreeView.qml b/src/controls/FluTreeView.qml index ded9f6e6..45425665 100644 --- a/src/controls/FluTreeView.qml +++ b/src/controls/FluTreeView.qml @@ -11,6 +11,7 @@ Item { Single, Multiple } + property int selectionMode: FluTreeView.None property var currentElement property var currentParentElement