diff --git a/src/controls/FluAutoSuggestBox.qml b/src/controls/FluAutoSuggestBox.qml index 62bbb602..55d26e60 100644 --- a/src/controls/FluAutoSuggestBox.qml +++ b/src/controls/FluAutoSuggestBox.qml @@ -7,6 +7,8 @@ TextField{ property var values:[] property int fontStyle: FluText.Body property int pixelSize : FluTheme.textSize + property int icon: -1 + signal itemClicked(string data) id:input width: 300 @@ -24,7 +26,7 @@ TextField{ } return FluTheme.isDark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1) } - rightPadding: 30 + rightPadding: icon_right.visible ? 50 : 30 selectByMouse: true font.bold: { switch (fontStyle) { @@ -83,12 +85,25 @@ TextField{ anchors{ verticalCenter: parent.verticalCenter right: parent.right - rightMargin: 5 + rightMargin: icon_right.visible ? 25 : 5 } onClicked:{ input.text = "" } } + + FluIcon{ + id:icon_right + icon: input.icon + iconSize: 15 + opacity: 0.5 + visible: input.icon != -1 + anchors{ + verticalCenter: parent.verticalCenter + right: parent.right + rightMargin: 5 + } + } } Component.onCompleted: { @@ -152,6 +167,7 @@ TextField{ hoverEnabled: true onClicked: { input_popup.close() + input.itemClicked(modelData) input.text = modelData } } @@ -175,6 +191,10 @@ TextField{ function searchData(){ var result = [] + if(values==null){ + list_view.model = result + return + } values.map(function(item){ if(item.indexOf(input.text)!==-1){ result.push(item) diff --git a/src/controls/FluDivider.qml b/src/controls/FluDivider.qml index 71961492..17cc78e5 100644 --- a/src/controls/FluDivider.qml +++ b/src/controls/FluDivider.qml @@ -3,6 +3,6 @@ import FluentUI 1.0 Rectangle { - color: FluTheme.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(238/255,238/255,238/255,1) + color: FluTheme.isDark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1) } diff --git a/src/controls/FluNavigationView.qml b/src/controls/FluNavigationView.qml index 44b2e570..a8d4daa2 100644 --- a/src/controls/FluNavigationView.qml +++ b/src/controls/FluNavigationView.qml @@ -209,8 +209,12 @@ Item { clip: true anchors.margins: 10 popEnter : Transition{} - popExit : Transition{} - pushEnter : Transition{} + popExit : Transition { + NumberAnimation { properties: "y"; from: 0; to: nav_swipe.height; duration: 200 } + } + pushEnter: Transition { + NumberAnimation { properties: "y"; from: nav_swipe.height; to: 0; duration: 200 } + } pushExit : Transition{} replaceEnter : Transition{} replaceExit : Transition{} @@ -257,13 +261,58 @@ Item { duration: 300 } } + + Item{ + id:layout_header + width: layout_list.width + height: 50 + + FluAutoSuggestBox{ + width: 280 + anchors.centerIn: parent + icon: FluentIcons.Zoom + values: { + var arr = [] + if(items==null) + return arr + if(items.children==null) + return arr + for(var i=0;i{ + var arr = [] + if(items==null) + return arr + if(items.children==null) + return arr + for(var i=0;i