diff --git a/example/qml/page/T_Progress.qml b/example/qml/page/T_Progress.qml index 404de735..56f92512 100644 --- a/example/qml/page/T_Progress.qml +++ b/example/qml/page/T_Progress.qml @@ -33,12 +33,14 @@ FluScrollablePage{ indeterminate: false } FluSlider{ - value:50 onValueChanged:{ var progress = value/100 progress_bar.progress = progress progress_ring.progress = progress } + Component.onCompleted: { + value = 50 + } } } } diff --git a/example/qml/page/T_TableView.qml b/example/qml/page/T_TableView.qml index 2e3db4f3..7eacfa01 100644 --- a/example/qml/page/T_TableView.qml +++ b/example/qml/page/T_TableView.qml @@ -87,7 +87,7 @@ FluScrollablePage{ text:"删除" horizontalPadding: 6 onClicked:{ - table_view.remove(dataModel.index) + tableView.remove(dataModel.index) } } } diff --git a/src/imports/FluentUI/Controls/FluMenu.qml b/src/imports/FluentUI/Controls/FluMenu.qml index 8551344a..c8726fbb 100644 --- a/src/imports/FluentUI/Controls/FluMenu.qml +++ b/src/imports/FluentUI/Controls/FluMenu.qml @@ -43,8 +43,6 @@ T.Menu { currentIndex: control.currentIndex ScrollIndicator.vertical: ScrollIndicator {} } - - background: Rectangle { implicitWidth: 150 implicitHeight: 40 @@ -54,11 +52,9 @@ T.Menu { radius: 5 FluShadow{} } - T.Overlay.modal: Rectangle { color: Color.transparent(control.palette.shadow, 0.5) } - T.Overlay.modeless: Rectangle { color: Color.transparent(control.palette.shadow, 0.12) } diff --git a/src/imports/FluentUI/Controls/FluSlider.qml b/src/imports/FluentUI/Controls/FluSlider.qml index c4faab2a..d8bfdc5d 100644 --- a/src/imports/FluentUI/Controls/FluSlider.qml +++ b/src/imports/FluentUI/Controls/FluSlider.qml @@ -4,6 +4,7 @@ import QtQuick.Templates as T import FluentUI T.Slider { + property bool tooltipEnabled: true id: control to:100 stepSize:1 @@ -11,9 +12,7 @@ T.Slider { implicitHandleWidth + leftPadding + rightPadding) implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHandleHeight + topPadding + bottomPadding) - padding: 6 - handle: Rectangle { x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height)) @@ -44,6 +43,13 @@ T.Slider { } } + + FluTooltip{ + parent: control.handle + visible: control.tooltipEnabled && control.pressed + text:String(control.value) + } + background: Rectangle { x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) diff --git a/src/imports/FluentUI/Controls/FluTabView.qml b/src/imports/FluentUI/Controls/FluTabView.qml index 7f12ab3c..53ae702d 100644 --- a/src/imports/FluentUI/Controls/FluTabView.qml +++ b/src/imports/FluentUI/Controls/FluTabView.qml @@ -110,6 +110,11 @@ Item { anchors.fill: parent hoverEnabled: true } + FluTooltip{ + visible: item_mouse_hove.containsMouse + text:item_text.text + delay: 1000 + } MouseArea{ id:item_mouse_drag anchors.fill: parent @@ -242,11 +247,6 @@ Item { Layout.preferredWidth: visible?item_container.width - 41 - item_btn_close.width:0 elide: Text.ElideRight Layout.alignment: Qt.AlignVCenter - FluTooltip{ - visible: item_mouse_hove.containsMouse - text:item_text.text - delay: 1000 - } } } FluIconButton{ diff --git a/src/imports/FluentUI/Controls/FluTableView.qml b/src/imports/FluentUI/Controls/FluTableView.qml index cc5688f1..a00c99d4 100644 --- a/src/imports/FluentUI/Controls/FluTableView.qml +++ b/src/imports/FluentUI/Controls/FluTableView.qml @@ -37,7 +37,6 @@ Item { model_data_source.clear() model_data_source.append(dataSource) } - Component{ id:header_columns FluRectangle{ @@ -114,7 +113,6 @@ Item { } } } - Flickable{ id:layout_flickable height: layout_table.height @@ -219,6 +217,7 @@ Item { property var model : modelData property var dataModel : listModel property var dataObject : itemObject + property var tableView : control anchors.verticalCenter: parent.verticalCenter width: parent.width sourceComponent: { @@ -245,7 +244,6 @@ Item { } } } - Component{ id:com_text Item{ diff --git a/src/imports/FluentUI/Controls/FluTooltip.qml b/src/imports/FluentUI/Controls/FluTooltip.qml index 5e4227fa..79add780 100644 --- a/src/imports/FluentUI/Controls/FluTooltip.qml +++ b/src/imports/FluentUI/Controls/FluTooltip.qml @@ -1,18 +1,36 @@ import QtQuick -import QtQuick.Controls +import QtQuick.Controls.impl +import QtQuick.Templates as T import FluentUI -ToolTip { - id:tool_tip +T.ToolTip { + id: control + + x: parent ? (parent.width - implicitWidth) / 2 : 0 + y: -implicitHeight - 3 + + implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + contentWidth + leftPadding + rightPadding) + implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + contentHeight + topPadding + bottomPadding) + + margins: 6 + padding: 6 + font: FluTextStyle.Body + + closePolicy: T.Popup.CloseOnEscape | T.Popup.CloseOnPressOutsideParent | T.Popup.CloseOnReleaseOutsideParent + contentItem: FluText { - text: tool_tip.text - padding: 4 - wrapMode: Text.WrapAnywhere + text: control.text + font: control.font + wrapMode: Text.Wrap } - background: Rectangle{ - anchors.fill: parent + + background: Rectangle { color: FluTheme.dark ? Qt.rgba(50/255,49/255,48/255,1) : Qt.rgba(1,1,1,1) - radius: 5 - FluShadow{} + radius: 3 + FluShadow{ + radius: 3 + } } }