mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
update
This commit is contained in:
@ -75,7 +75,6 @@ Rectangle{
|
||||
FluText{
|
||||
text:"夜间模式"
|
||||
color:root.textColor
|
||||
fontStyle: FluText.Caption
|
||||
}
|
||||
FluToggleSwitch{
|
||||
selected: FluTheme.dark
|
||||
|
@ -10,7 +10,7 @@ TextField{
|
||||
property int iconSource: 0
|
||||
property bool disabled: false
|
||||
signal itemClicked(string data)
|
||||
|
||||
signal handleClicked
|
||||
id:input
|
||||
width: 300
|
||||
enabled: !disabled
|
||||
@ -47,12 +47,8 @@ TextField{
|
||||
Keys.onDownPressed: {
|
||||
list_view.currentIndex = Math.min(list_view.currentIndex+1,list_view.count-1)
|
||||
}
|
||||
|
||||
signal handleClicked
|
||||
Keys.onEnterPressed:handleClicked()
|
||||
Keys.onReturnPressed:handleClicked()
|
||||
|
||||
|
||||
font.bold: {
|
||||
switch (fontStyle) {
|
||||
case FluText.Display:
|
||||
@ -61,10 +57,8 @@ TextField{
|
||||
return true
|
||||
case FluText.Title:
|
||||
return true
|
||||
case FluText.Subtitle:
|
||||
case FluText.SubTitle:
|
||||
return true
|
||||
case FluText.BodyLarge:
|
||||
return false
|
||||
case FluText.BodyStrong:
|
||||
return true
|
||||
case FluText.Body:
|
||||
@ -78,23 +72,21 @@ TextField{
|
||||
font.pixelSize: {
|
||||
switch (fontStyle) {
|
||||
case FluText.Display:
|
||||
return input.pixelSize * 4
|
||||
return text.pixelSize * 4.857
|
||||
case FluText.TitleLarge:
|
||||
return input.pixelSize * 2
|
||||
return text.pixelSize * 2.857
|
||||
case FluText.Title:
|
||||
return input.pixelSize * 1.5
|
||||
case FluText.Subtitle:
|
||||
return input.pixelSize * 0.9
|
||||
case FluText.BodyLarge:
|
||||
return input.pixelSize * 1.1
|
||||
case FluText.BodyStrong:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 2
|
||||
case FluText.SubTitle:
|
||||
return text.pixelSize * 1.428
|
||||
case FluText.Body:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.BodyStrong:
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.Caption:
|
||||
return input.pixelSize * 0.8
|
||||
return text.pixelSize * 0.857
|
||||
default:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 1.0
|
||||
}
|
||||
}
|
||||
background: FluTextBoxBackground{
|
||||
@ -175,7 +167,6 @@ TextField{
|
||||
id:list_view
|
||||
signal closePopup
|
||||
anchors.fill: parent
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
clip: true
|
||||
currentIndex: -1
|
||||
ScrollBar.vertical: FluScrollBar {}
|
||||
|
@ -73,16 +73,28 @@ Button {
|
||||
}
|
||||
return normalColor
|
||||
}
|
||||
Behavior on color {
|
||||
ColorAnimation{
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
FluIcon {
|
||||
anchors.centerIn: parent
|
||||
iconSource: FluentIcons.AcceptMedium
|
||||
iconSize: 15
|
||||
visible: selected
|
||||
color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1)
|
||||
Behavior on visible {
|
||||
NumberAnimation{
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FluText{
|
||||
text:control.text
|
||||
text: control.text
|
||||
Layout.leftMargin: 5
|
||||
visible: text !== ""
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,15 +51,22 @@ Item {
|
||||
if(root_mouse.containsMouse){
|
||||
return FluTheme.dark ? Qt.rgba(73/255,73/255,73/255,1) : Qt.rgba(245/255,245/255,245/255,1)
|
||||
}
|
||||
return FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
return FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||
}
|
||||
iconSize: 15
|
||||
iconSource: expand ? FluentIcons.ChevronUp : FluentIcons.ChevronDown
|
||||
onClicked: {
|
||||
expand = !expand
|
||||
}
|
||||
contentItem: FluIcon{
|
||||
rotation: expand?0:180
|
||||
iconSource:FluentIcons.ChevronUp
|
||||
iconSize: 15
|
||||
Behavior on rotation {
|
||||
NumberAnimation{
|
||||
duration: 150
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -47,10 +47,8 @@ TextArea{
|
||||
return true
|
||||
case FluText.Title:
|
||||
return true
|
||||
case FluText.Subtitle:
|
||||
case FluText.SubTitle:
|
||||
return true
|
||||
case FluText.BodyLarge:
|
||||
return false
|
||||
case FluText.BodyStrong:
|
||||
return true
|
||||
case FluText.Body:
|
||||
@ -61,27 +59,24 @@ TextArea{
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
font.pixelSize: {
|
||||
switch (fontStyle) {
|
||||
case FluText.Display:
|
||||
return input.pixelSize * 4
|
||||
return text.pixelSize * 4.857
|
||||
case FluText.TitleLarge:
|
||||
return input.pixelSize * 2
|
||||
return text.pixelSize * 2.857
|
||||
case FluText.Title:
|
||||
return input.pixelSize * 1.5
|
||||
case FluText.Subtitle:
|
||||
return input.pixelSize * 0.9
|
||||
case FluText.BodyLarge:
|
||||
return input.pixelSize * 1.1
|
||||
case FluText.BodyStrong:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 2
|
||||
case FluText.SubTitle:
|
||||
return text.pixelSize * 1.428
|
||||
case FluText.Body:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.BodyStrong:
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.Caption:
|
||||
return input.pixelSize * 0.8
|
||||
return text.pixelSize * 0.857
|
||||
default:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 1.0
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,6 @@ Item {
|
||||
return items.children
|
||||
}
|
||||
}
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
delegate: Loader{
|
||||
property var model: modelData
|
||||
property var position: index
|
||||
@ -386,7 +385,6 @@ Item {
|
||||
width: layout_list.width
|
||||
height: childrenRect.height
|
||||
anchors.bottom: parent.bottom
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
model: {
|
||||
if(footerItems){
|
||||
return footerItems.children
|
||||
|
@ -43,7 +43,6 @@ Item {
|
||||
}
|
||||
contentWidth: parent.width
|
||||
contentHeight: container.height
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
ScrollBar.vertical: FluScrollBar {
|
||||
}
|
||||
anchors{
|
||||
|
@ -47,7 +47,6 @@ Item {
|
||||
orientation: ListView.Horizontal
|
||||
width: parent.width
|
||||
interactive: false
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
model: tab_model
|
||||
move: Transition {
|
||||
NumberAnimation { properties: "x"; duration: 100; easing.type: Easing.OutCubic }
|
||||
@ -166,7 +165,10 @@ Item {
|
||||
var idx = tab_nav.indexAt(pos.x+tab_nav.contentX, pos.y)
|
||||
var firstIdx = tab_nav.indexAt(tab_nav.contentX+1, pos.y)
|
||||
var lastIdx = tab_nav.indexAt(tab_nav.width+tab_nav.contentX-1, pos.y)
|
||||
if (idx >= firstIdx && idx <= lastIdx && d.dragIndex !== idx) {
|
||||
if(lastIdx === -1){
|
||||
lastIdx = tab_nav.count-1
|
||||
}
|
||||
if (idx!==-1 && idx >= firstIdx && idx <= lastIdx && d.dragIndex !== idx) {
|
||||
tab_model.move(d.dragIndex, idx, 1)
|
||||
d.dragIndex = idx;
|
||||
}
|
||||
|
@ -11,8 +11,7 @@ Text {
|
||||
Display,
|
||||
TitleLarge,
|
||||
Title,
|
||||
Subtitle,
|
||||
BodyLarge,
|
||||
SubTitle,
|
||||
BodyStrong,
|
||||
Body,
|
||||
Caption
|
||||
@ -29,10 +28,8 @@ Text {
|
||||
return true
|
||||
case FluText.Title:
|
||||
return true
|
||||
case FluText.Subtitle:
|
||||
case FluText.SubTitle:
|
||||
return true
|
||||
case FluText.BodyLarge:
|
||||
return false
|
||||
case FluText.BodyStrong:
|
||||
return true
|
||||
case FluText.Body:
|
||||
@ -46,21 +43,19 @@ Text {
|
||||
font.pixelSize: {
|
||||
switch (fontStyle) {
|
||||
case FluText.Display:
|
||||
return text.pixelSize * 4
|
||||
return text.pixelSize * 4.857
|
||||
case FluText.TitleLarge:
|
||||
return text.pixelSize * 2
|
||||
return text.pixelSize * 2.857
|
||||
case FluText.Title:
|
||||
return text.pixelSize * 1.5
|
||||
case FluText.Subtitle:
|
||||
return text.pixelSize * 0.9
|
||||
case FluText.BodyLarge:
|
||||
return text.pixelSize * 1.1
|
||||
case FluText.BodyStrong:
|
||||
return text.pixelSize * 1.0
|
||||
return text.pixelSize * 2
|
||||
case FluText.SubTitle:
|
||||
return text.pixelSize * 1.428
|
||||
case FluText.Body:
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.BodyStrong:
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.Caption:
|
||||
return text.pixelSize * 0.8
|
||||
return text.pixelSize * 0.857
|
||||
default:
|
||||
return text.pixelSize * 1.0
|
||||
}
|
||||
|
@ -42,10 +42,8 @@ TextField{
|
||||
return true
|
||||
case FluText.Title:
|
||||
return true
|
||||
case FluText.Subtitle:
|
||||
case FluText.SubTitle:
|
||||
return true
|
||||
case FluText.BodyLarge:
|
||||
return false
|
||||
case FluText.BodyStrong:
|
||||
return true
|
||||
case FluText.Body:
|
||||
@ -59,23 +57,21 @@ TextField{
|
||||
font.pixelSize: {
|
||||
switch (fontStyle) {
|
||||
case FluText.Display:
|
||||
return input.pixelSize * 4
|
||||
return text.pixelSize * 4.857
|
||||
case FluText.TitleLarge:
|
||||
return input.pixelSize * 2
|
||||
return text.pixelSize * 2.857
|
||||
case FluText.Title:
|
||||
return input.pixelSize * 1.5
|
||||
case FluText.Subtitle:
|
||||
return input.pixelSize * 0.9
|
||||
case FluText.BodyLarge:
|
||||
return input.pixelSize * 1.1
|
||||
case FluText.BodyStrong:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 2
|
||||
case FluText.SubTitle:
|
||||
return text.pixelSize * 1.428
|
||||
case FluText.Body:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.BodyStrong:
|
||||
return text.pixelSize * 1.0
|
||||
case FluText.Caption:
|
||||
return input.pixelSize * 0.8
|
||||
return text.pixelSize * 0.857
|
||||
default:
|
||||
return input.pixelSize * 1.0
|
||||
return text.pixelSize * 1.0
|
||||
}
|
||||
}
|
||||
selectByMouse: true
|
||||
|
@ -59,7 +59,7 @@ Button {
|
||||
border.color: selected ? Qt.lighter(FluTheme.primaryColor.dark,1.2) : "#666666"
|
||||
Rectangle {
|
||||
x: selected ? control_backgound.width - width - 4 : 4
|
||||
width: control.height - 8
|
||||
width: pressed ? control.height - 6 : control.height - 8
|
||||
height: control.height - 8
|
||||
radius: width / 2
|
||||
antialiasing: true
|
||||
@ -68,20 +68,20 @@ Button {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: selected ? "#FFFFFF" : "#666666"
|
||||
Behavior on x {
|
||||
NumberAnimation { duration: 200 }
|
||||
NumberAnimation { duration: 150 }
|
||||
}
|
||||
Behavior on width {
|
||||
NumberAnimation { duration: 150 }
|
||||
}
|
||||
Behavior on scale {
|
||||
NumberAnimation { duration: 150 }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FluText{
|
||||
text: control.text
|
||||
Layout.leftMargin: 5
|
||||
visible: text !== ""
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ ToolTip {
|
||||
contentItem: FluText {
|
||||
text: tool_tip.text
|
||||
font: tool_tip.font
|
||||
fontStyle: FluText.BodyLarge
|
||||
fontStyle: FluText.Body
|
||||
padding: 4
|
||||
wrapMode: Text.WrapAnywhere
|
||||
}
|
||||
|
@ -267,7 +267,6 @@ Item {
|
||||
id: list_root
|
||||
anchors.fill: parent
|
||||
delegate: delegate_root
|
||||
boundsBehavior: ListView.StopAtBounds
|
||||
contentWidth: contentItem.childrenRect.width
|
||||
model: tree_model
|
||||
flickableDirection: Flickable.HorizontalAndVerticalFlick
|
||||
|
Reference in New Issue
Block a user