Compare commits

..

2 Commits

Author SHA1 Message Date
4efb91084a update 2023-06-19 18:08:49 +08:00
103dbe9d56 update 2023-06-19 17:50:54 +08:00
16 changed files with 64 additions and 72 deletions

View File

@ -20,7 +20,7 @@ endif()
file(TO_CMAKE_PATH "/" PATH_SEPARATOR) file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
#设置版本号 #设置版本号
add_definitions(-DVERSION=1,3,5,0) add_definitions(-DVERSION=1,3,5,1)
find_package(Qt6 REQUIRED COMPONENTS Quick) find_package(Qt6 REQUIRED COMPONENTS Quick)
qt_standard_project_setup() qt_standard_project_setup()

View File

@ -33,12 +33,14 @@ FluScrollablePage{
indeterminate: false indeterminate: false
} }
FluSlider{ FluSlider{
value:50
onValueChanged:{ onValueChanged:{
var progress = value/100 var progress = value/100
progress_bar.progress = progress progress_bar.progress = progress
progress_ring.progress = progress progress_ring.progress = progress
} }
Component.onCompleted: {
value = 50
}
} }
} }
} }

View File

@ -87,7 +87,7 @@ FluScrollablePage{
text:"删除" text:"删除"
horizontalPadding: 6 horizontalPadding: 6
onClicked:{ onClicked:{
table_view.remove(dataModel.index) tableView.remove(dataModel.index)
} }
} }
} }

View File

@ -13,7 +13,7 @@ endif()
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI) set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
#设置版本号 #设置版本号
add_definitions(-DVERSION=1,3,5,0) add_definitions(-DVERSION=1,3,5,1)
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml) find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml)
qt_standard_project_setup() qt_standard_project_setup()

View File

@ -6,33 +6,31 @@ import FluentUI
T.Menu { T.Menu {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding) contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding) contentHeight + topPadding + bottomPadding)
margins: 0 margins: 0
overlap: 1 overlap: 1
spacing: 0 spacing: 0
delegate: FluMenuItem { } delegate: FluMenuItem { }
enter: Transition { enter: Transition {
reversible: true reversible: true
NumberAnimation { NumberAnimation {
property: "opacity" property: "opacity"
from:0 from:0
to:1 to:1
duration: 83 duration: 83
} }
} }
exit:Transition { exit:Transition {
NumberAnimation { NumberAnimation {
property: "opacity" property: "opacity"
from:1 from:1
to:0 to:0
duration: 83 duration: 83
} }
} }
contentItem: ListView { contentItem: ListView {
implicitHeight: contentHeight implicitHeight: contentHeight
model: control.contentModel model: control.contentModel
@ -43,8 +41,6 @@ T.Menu {
currentIndex: control.currentIndex currentIndex: control.currentIndex
ScrollIndicator.vertical: ScrollIndicator {} ScrollIndicator.vertical: ScrollIndicator {}
} }
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
implicitHeight: 40 implicitHeight: 40
@ -54,11 +50,9 @@ T.Menu {
radius: 5 radius: 5
FluShadow{} FluShadow{}
} }
T.Overlay.modal: Rectangle { T.Overlay.modal: Rectangle {
color: Color.transparent(control.palette.shadow, 0.5) color: Color.transparent(control.palette.shadow, 0.5)
} }
T.Overlay.modeless: Rectangle { T.Overlay.modeless: Rectangle {
color: Color.transparent(control.palette.shadow, 0.12) color: Color.transparent(control.palette.shadow, 0.12)
} }

View File

@ -4,21 +4,17 @@ import QtQuick.Controls.impl
T.MenuBar { T.MenuBar {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
contentWidth + leftPadding + rightPadding) contentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
contentHeight + topPadding + bottomPadding) contentHeight + topPadding + bottomPadding)
delegate: FluMenuBarItem { } delegate: FluMenuBarItem { }
contentItem: Row { contentItem: Row {
spacing: control.spacing spacing: control.spacing
Repeater { Repeater {
model: control.contentModel model: control.contentModel
} }
} }
background: Item { background: Item {
implicitHeight: 30 implicitHeight: 30
} }

View File

@ -5,27 +5,22 @@ import FluentUI
T.MenuBarItem { T.MenuBarItem {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding, implicitContentHeight + topPadding + bottomPadding,
implicitIndicatorHeight + topPadding + bottomPadding) implicitIndicatorHeight + topPadding + bottomPadding)
spacing: 6 spacing: 6
padding: 6 padding: 6
leftPadding: 12 leftPadding: 12
rightPadding: 16 rightPadding: 16
icon.width: 24 icon.width: 24
icon.height: 24 icon.height: 24
icon.color: control.palette.buttonText icon.color: control.palette.buttonText
contentItem: FluText { contentItem: FluText {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: control.text text: control.text
} }
background: Rectangle { background: Rectangle {
implicitWidth: 30 implicitWidth: 30
implicitHeight: 30 implicitHeight: 30

View File

@ -15,13 +15,10 @@ T.MenuItem {
padding: 6 padding: 6
spacing: 6 spacing: 6
icon.width: 24 icon.width: 24
icon.height: 24 icon.height: 24
icon.color: control.palette.windowText icon.color: control.palette.windowText
height: visible ? implicitHeight : 0 height: visible ? implicitHeight : 0
contentItem: FluText { contentItem: FluText {
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0 readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0 readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
@ -30,21 +27,18 @@ T.MenuItem {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: control.text text: control.text
} }
indicator: FluIcon { indicator: FluIcon {
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
y: control.topPadding + (control.availableHeight - height) / 2 y: control.topPadding + (control.availableHeight - height) / 2
visible: control.checked visible: control.checked
iconSource: FluentIcons.CheckMark iconSource: FluentIcons.CheckMark
} }
arrow: FluIcon { arrow: FluIcon {
x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
y: control.topPadding + (control.availableHeight - height) / 2 y: control.topPadding + (control.availableHeight - height) / 2
visible: control.subMenu visible: control.subMenu
iconSource: FluentIcons.ChevronRightMed iconSource: FluentIcons.ChevronRightMed
} }
background: Rectangle { background: Rectangle {
implicitWidth: 150 implicitWidth: 150
implicitHeight: 40 implicitHeight: 40

View File

@ -5,15 +5,12 @@ import FluentUI
T.MenuSeparator { T.MenuSeparator {
id: control id: control
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding) implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitContentHeight + topPadding + bottomPadding) implicitContentHeight + topPadding + bottomPadding)
padding: 0 padding: 0
verticalPadding: 0 verticalPadding: 0
contentItem: Rectangle { contentItem: Rectangle {
implicitWidth: 188 implicitWidth: 188
implicitHeight: 1 implicitHeight: 1

View File

@ -3,6 +3,6 @@ import QtQuick.Controls
import FluentUI import FluentUI
QtObject { QtObject {
default property list<QtObject> children; default property list<QtObject> children
id:flu_object; id:control
} }

View File

@ -4,6 +4,7 @@ import QtQuick.Templates as T
import FluentUI import FluentUI
T.Slider { T.Slider {
property bool tooltipEnabled: true
id: control id: control
to:100 to:100
stepSize:1 stepSize:1
@ -11,9 +12,7 @@ T.Slider {
implicitHandleWidth + leftPadding + rightPadding) implicitHandleWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
implicitHandleHeight + topPadding + bottomPadding) implicitHandleHeight + topPadding + bottomPadding)
padding: 6 padding: 6
handle: Rectangle { handle: Rectangle {
x: control.leftPadding + (control.horizontal ? control.visualPosition * (control.availableWidth - width) : (control.availableWidth - width) / 2) 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)) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : control.visualPosition * (control.availableHeight - height))
@ -43,7 +42,11 @@ T.Slider {
} }
} }
} }
FluTooltip{
parent: control.handle
visible: control.tooltipEnabled && control.pressed
text:String(control.value)
}
background: Rectangle { background: Rectangle {
x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2) x: control.leftPadding + (control.horizontal ? 0 : (control.availableWidth - width) / 2)
y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0) y: control.topPadding + (control.horizontal ? (control.availableHeight - height) / 2 : 0)

View File

@ -110,6 +110,11 @@ Item {
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
} }
FluTooltip{
visible: item_mouse_hove.containsMouse
text:item_text.text
delay: 1000
}
MouseArea{ MouseArea{
id:item_mouse_drag id:item_mouse_drag
anchors.fill: parent anchors.fill: parent
@ -242,11 +247,6 @@ Item {
Layout.preferredWidth: visible?item_container.width - 41 - item_btn_close.width:0 Layout.preferredWidth: visible?item_container.width - 41 - item_btn_close.width:0
elide: Text.ElideRight elide: Text.ElideRight
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
FluTooltip{
visible: item_mouse_hove.containsMouse
text:item_text.text
delay: 1000
}
} }
} }
FluIconButton{ FluIconButton{

View File

@ -37,7 +37,6 @@ Item {
model_data_source.clear() model_data_source.clear()
model_data_source.append(dataSource) model_data_source.append(dataSource)
} }
Component{ Component{
id:header_columns id:header_columns
FluRectangle{ FluRectangle{
@ -114,7 +113,6 @@ Item {
} }
} }
} }
Flickable{ Flickable{
id:layout_flickable id:layout_flickable
height: layout_table.height height: layout_table.height
@ -219,6 +217,7 @@ Item {
property var model : modelData property var model : modelData
property var dataModel : listModel property var dataModel : listModel
property var dataObject : itemObject property var dataObject : itemObject
property var tableView : control
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: parent.width width: parent.width
sourceComponent: { sourceComponent: {
@ -245,7 +244,6 @@ Item {
} }
} }
} }
Component{ Component{
id:com_text id:com_text
Item{ Item{

View File

@ -5,7 +5,6 @@ import QtQuick.Window
import FluentUI import FluentUI
Rectangle { Rectangle {
enum HourFormat { enum HourFormat {
H, H,
HH HH
@ -16,7 +15,6 @@ Rectangle {
property var window : Window.window property var window : Window.window
property int hourFormat: FluTimePicker.H property int hourFormat: FluTimePicker.H
property int isH: hourFormat === FluTimePicker.H property int isH: hourFormat === FluTimePicker.H
id:root id:root
color: { color: {
if(mouse_area.containsMouse){ if(mouse_area.containsMouse){
@ -29,7 +27,6 @@ Rectangle {
radius: 4 radius: 4
border.width: 1 border.width: 1
border.color: dividerColor border.color: dividerColor
MouseArea{ MouseArea{
id:mouse_area id:mouse_area
hoverEnabled: true hoverEnabled: true

View File

@ -7,15 +7,16 @@ import FluentUI
Button { Button {
property bool disabled: false property bool disabled: false
property string contentDescription: "" property string contentDescription: ""
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(159/255,159/255,159/255,1) :FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(240/255,240/255,240/255,1) property color disableColor: checked ? FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(233/255,233/255,233/255,1) :FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(233/255,233/255,233/255,1)
property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1) property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1)
property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1)
property color borderNormalColor: FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) property color borderNormalColor: FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
property color borderCheckColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark property color borderCheckColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property color borderDisableColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1) property color borderDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(200/255,200/255,200/255,1)
property color dotNormalColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1) property color dotNormalColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1)
property color dotCheckColor: FluTheme.dark ? Qt.rgba(0/255,0/255,0/255,1) : Qt.rgba(255/255,255/255,255/255,1) property color dotCheckColor: FluTheme.dark ? Qt.rgba(0/255,0/255,0/255,1) : Qt.rgba(255/255,255/255,255/255,1)
property color dotDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(150/255,150/255,150/255,1)
property var clickListener : function(){ property var clickListener : function(){
checked = !checked checked = !checked
} }
@ -76,6 +77,9 @@ Button {
scale: hovered&!disabled ? 7/10 : 6/10 scale: hovered&!disabled ? 7/10 : 6/10
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
color: { color: {
if(disabled){
return dotDisableColor
}
if(checked){ if(checked){
return dotCheckColor return dotCheckColor
} }

View File

@ -1,18 +1,30 @@
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls.impl
import QtQuick.Templates as T
import FluentUI import FluentUI
ToolTip { T.ToolTip {
id:tool_tip 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 { contentItem: FluText {
text: tool_tip.text text: control.text
padding: 4 font: control.font
wrapMode: Text.WrapAnywhere wrapMode: Text.Wrap
} }
background: Rectangle{ background: Rectangle {
anchors.fill: parent
color: FluTheme.dark ? Qt.rgba(50/255,49/255,48/255,1) : Qt.rgba(1,1,1,1) color: FluTheme.dark ? Qt.rgba(50/255,49/255,48/255,1) : Qt.rgba(1,1,1,1)
radius: 5 radius: 3
FluShadow{} FluShadow{
radius: 3
}
} }
} }