This commit is contained in:
zhuzichu 2023-06-30 18:47:25 +08:00
parent bbb6fe9329
commit 64bbae9266
5 changed files with 81 additions and 9 deletions

View File

@ -134,13 +134,11 @@ FluExpander{
"FluMenuBar", "FluMenuBar",
"FluPagination", "FluPagination",
"FluRadioButtons", "FluRadioButtons",
"FluImage" "FluImage",
"FluSpinBox"
]; ];
code = code.replace(/\n/g, "<br>"); code = code.replace(/\n/g, "<br>");
code = code.replace(/ /g, "&nbsp;"); code = code.replace(/ /g, "&nbsp;");
return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>"); return code.replace(RegExp("\\b(" + qmlKeywords.join("|") + ")\\b", "g"), "<span style='color: #c23a80'>$1</span>");
} }
} }

View File

@ -166,6 +166,41 @@ FluScrollablePage{
}' }'
} }
FluArea{
Layout.fillWidth: true
height: 68
paddings: 10
Layout.topMargin: 20
FluSpinBox{
Layout.topMargin: 20
disabled: spin_box_switch.checked
anchors{
verticalCenter: parent.verticalCenter
left: parent.left
}
}
Row{
spacing: 5
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
}
FluToggleSwitch{
id:spin_box_switch
Layout.alignment: Qt.AlignRight
text:"Disabled"
}
}
}
CodeExpander{
Layout.fillWidth: true
Layout.topMargin: -1
code:'FluSpinBox{
}'
}
function generateRandomNames(numNames) { function generateRandomNames(numNames) {
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';

View File

@ -0,0 +1,42 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import FluentUI
FluTextBox {
id:control
width: 200
closeRightMargin:55
rightPadding: 80
text:"0"
validator: IntValidator {}
inputMethodHints: Qt.ImhDigitsOnly
FluIconButton{
width: 20
height: 20
iconSize: 16
iconSource: FluentIcons.ChevronUp
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 30
}
onClicked: {
control.text = Number(control.text) + 1
}
}
FluIconButton{
iconSource: FluentIcons.ChevronDown
width: 20
height: 20
iconSize: 16
anchors{
verticalCenter: parent.verticalCenter
right: parent.right
rightMargin: 5
}
onClicked: {
control.text = Number(control.text) - 1
}
}
}

View File

@ -11,7 +11,6 @@ Rectangle {
property color selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6) property color selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6)
property color hoverButtonColor: Qt.alpha(selectionColor,0.2) property color hoverButtonColor: Qt.alpha(selectionColor,0.2)
property color pressedButtonColor: Qt.alpha(selectionColor,0.4) property color pressedButtonColor: Qt.alpha(selectionColor,0.4)
id:control id:control
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1) color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
onColumnSourceChanged: { onColumnSourceChanged: {
@ -190,9 +189,6 @@ Rectangle {
id:item_table id:item_table
property var position: Qt.point(column,row) property var position: Qt.point(column,row)
required property bool selected required property bool selected
// onSelectedChanged: {
// d.selectionFlag = !d.selectionFlag
// }
color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06)) color: (row%2!==0) ? control.color : (FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06))
implicitHeight: 40 implicitHeight: 40
implicitWidth: columnSource[column].width implicitWidth: columnSource[column].width

View File

@ -12,6 +12,7 @@ TextField{
property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1) property color placeholderNormalColor: FluTheme.dark ? Qt.rgba(210/255,210/255,210/255,1) : Qt.rgba(96/255,96/255,96/255,1)
property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1) property color placeholderFocusColor: FluTheme.dark ? Qt.rgba(152/255,152/255,152/255,1) : Qt.rgba(141/255,141/255,141/255,1)
property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1) property color placeholderDisableColor: FluTheme.dark ? Qt.rgba(131/255,131/255,131/255,1) : Qt.rgba(160/255,160/255,160/255,1)
property int closeRightMargin: icon_end.visible ? 25 : 5
id:control id:control
width: 300 width: 300
enabled: !disabled enabled: !disabled
@ -78,7 +79,7 @@ TextField{
anchors{ anchors{
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
right: parent.right right: parent.right
rightMargin: icon_end.visible ? 25 : 5 rightMargin: closeRightMargin
} }
onClicked:{ onClicked:{
control.text = "" control.text = ""