Compare commits

...

2 Commits

Author SHA1 Message Date
朱子楚\zhuzi
bc4510077f update 2024-04-19 01:04:13 +08:00
朱子楚\zhuzi
179bc8b21f update 2024-04-19 00:42:35 +08:00
17 changed files with 1865 additions and 1855 deletions

View File

@ -1089,46 +1089,6 @@ Updated content:
<source>Click to Select a Color - &gt;</source> <source>Click to Select a Color - &gt;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="22"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="23"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="24"/>
<source>Color Picker</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="25"/>
<source>Edit Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="26"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="27"/>
<source>Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="28"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="qml/page/T_ColorPicker.qml" line="29"/>
<source>Opacity</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>T_ComboBox</name> <name>T_ComboBox</name>

View File

@ -1113,44 +1113,36 @@ Updated content:
<translation type="unfinished"> - &gt;</translation> <translation type="unfinished"> - &gt;</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="22"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="23"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="24"/>
<source>Color Picker</source> <source>Color Picker</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="25"/>
<source>Edit Color</source> <source>Edit Color</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="26"/>
<source>Red</source> <source>Red</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="27"/>
<source>Green</source> <source>Green</source>
<translation type="unfinished">绿</translation> <translation type="obsolete">绿</translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="28"/>
<source>Blue</source> <source>Blue</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
<message> <message>
<location filename="qml/page/T_ColorPicker.qml" line="29"/>
<source>Opacity</source> <source>Opacity</source>
<translation type="unfinished"></translation> <translation type="obsolete"></translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -18,16 +18,7 @@ FluScrollablePage{
text: qsTr("Click to Select a Color - >") text: qsTr("Click to Select a Color - >")
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
} }
FluColorPicker{ FluColorPicker{}
cancelText: qsTr("Cancel")
okText: qsTr("OK")
titleText: qsTr("Color Picker")
editText: qsTr("Edit Color")
redText: qsTr("Red")
greenText: qsTr("Green")
blueText: qsTr("Blue")
opacityText: qsTr("Opacity")
}
} }
} }
CodeExpander{ CodeExpander{

File diff suppressed because it is too large Load Diff

View File

@ -13,16 +13,15 @@ Button{
property color current : Qt.rgba(1,1,1,1) property color current : Qt.rgba(1,1,1,1)
signal accepted() signal accepted()
property int colorHandleRadius: 8 property int colorHandleRadius: 8
property string cancelText: "取消" property string cancelText: qsTr("Cancel")
property string okText: "确定" property string okText: qsTr("OK")
property string titleText: "颜色选择器" property string titleText: qsTr("Color Picker")
property string editText: "编辑颜色" property string editText: qsTr("Edit Color")
property string redText: "红色" property string redText: qsTr("Red")
property string greenText: "绿色" property string greenText: qsTr("Green")
property string blueText: "蓝色" property string blueText: qsTr("Blue")
property string opacityText: "透明度" property string opacityText: qsTr("Opacity")
background: background: Rectangle{
Rectangle{
id:layout_color id:layout_color
radius: 5 radius: 5
color:"#00000000" color:"#00000000"

View File

@ -134,10 +134,9 @@ T.ComboBox {
} }
} }
background:Rectangle{ background:Rectangle{
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
border.width: 1
radius: 5 radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 5 radius: 5
} }

View File

@ -4,7 +4,6 @@ import QtQuick.Layouts 1.15
import QtQuick.Window 2.15 import QtQuick.Window 2.15
import FluentUI 1.0 import FluentUI 1.0
FluButton { FluButton {
property bool showYear: true property bool showYear: true
property var current property var current
@ -96,8 +95,6 @@ FluButton {
Menu{ Menu{
id:popup id:popup
modal: true modal: true
width: container.width
height: container.height
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
reversible: true reversible: true
@ -116,227 +113,220 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true id:container
Rectangle{ implicitHeight: 340
id:container implicitWidth: 300
radius: 4 MouseArea{
width: 300 anchors.fill: parent
height: 340 }
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1) RowLayout{
MouseArea{ id:layout_content
anchors.fill: parent spacing: 0
} width: parent.width
FluShadow{ height: 280
radius: 4 Component{
} id:list_delegate
RowLayout{ Item{
id:layout_content height: 38
spacing: 0 width: getListView().width
width: parent.width function getListView(){
height: 300 if(type === 0)
Component{ return list_view_1
id:list_delegate if(type === 1)
Item{ return list_view_2
height:38 if(type === 2)
width:getListView().width return list_view_3
function getListView(){ }
if(type === 0) Rectangle{
return list_view_1 anchors.fill: parent
if(type === 1) anchors.topMargin: 2
return list_view_2 anchors.bottomMargin: 2
if(type === 2) anchors.leftMargin: 5
return list_view_3 anchors.rightMargin: 5
color: {
if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor
}
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return Qt.rgba(0,0,0,0)
} }
Rectangle{ radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 2 hoverEnabled: true
anchors.bottomMargin: 2 onClicked: {
anchors.leftMargin: 5 getListView().currentIndex = position
anchors.rightMargin: 5 if(type === 0){
color: { text_year.text = model
list_view_2.model = generateMonthArray(1,12)
text_month.text = list_view_2.model[list_view_2.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 1){
text_month.text = model
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 2){
text_day.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){ if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor if(FluTheme.dark){
} return Qt.rgba(0,0,0,1)
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
}
radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
getListView().currentIndex = position
if(type === 0){
text_year.text = model
list_view_2.model = generateMonthArray(1,12)
text_month.text = list_view_2.model[list_view_2.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 1){
text_month.text = model
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 2){
text_day.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){
if(FluTheme.dark){
return Qt.rgba(0,0,0,1)
}else{
return Qt.rgba(1,1,1,1)
}
}else{ }else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A" return Qt.rgba(1,1,1,1)
} }
}else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A"
} }
anchors.centerIn: parent
} }
anchors.centerIn: parent
} }
} }
} }
ListView{ }
id:list_view_1 ListView{
width: 100 id:list_view_1
height: parent.height Layout.preferredWidth: 100
boundsBehavior:Flickable.StopAtBounds Layout.preferredHeight: parent.height - 2
ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter
model: generateYearArray(1924,2048) boundsBehavior:Flickable.StopAtBounds
clip: true ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0 model: generateYearArray(1924,2048)
preferredHighlightEnd: 0 clip: true
highlightMoveDuration: 0 preferredHighlightBegin: 0
visible: showYear preferredHighlightEnd: 0
delegate: FluLoader{ highlightMoveDuration: 0
property var model: modelData visible: showYear
property int type:0 delegate: FluLoader{
property int position:index property var model: modelData
sourceComponent: list_delegate property int type:0
} property int position:index
} sourceComponent: list_delegate
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
}
ListView{
id:list_view_2
width: showYear ? 100 : 150
height: parent.height
clip: true
ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
}
ListView{
id:list_view_3
width: showYear ? 100 : 150
height: parent.height
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
} }
} }
Rectangle{ Rectangle{
width: parent.width Layout.preferredWidth: 1
height: 1 Layout.preferredHeight: parent.height
anchors.top: layout_content.bottom color: control.dividerColor
visible: showYear
}
ListView{
id:list_view_2
Layout.preferredWidth: showYear ? 99 : 150
Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
clip: true
ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{
Layout.preferredWidth: 1
Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
} }
Rectangle{ ListView{
id:layout_actions id:list_view_3
height: 40 Layout.preferredWidth: showYear ? 99 : 150
radius: 5 Layout.preferredHeight: parent.height - 2
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) Layout.alignment: Qt.AlignVCenter
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
}
}
Rectangle{
id:layout_actions
height: 60
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{
bottom:parent.bottom
left: parent.left
right: parent.right
}
Item {
id:divider
width: 1
height: parent.height
anchors.centerIn: parent
}
FluButton{
anchors{ anchors{
bottom:parent.bottom
left: parent.left left: parent.left
leftMargin: 20
rightMargin: 10
right: divider.left
verticalCenter: parent.verticalCenter
}
text: control.cancelText
onClicked: {
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
} }
Item { text: control.okText
id:divider onClicked: {
width: 1 d.changeFlag = false
height: parent.height popup.close()
anchors.centerIn: parent const year = text_year.text
} const month = text_month.text
FluButton{ const day = text_day.text
anchors{ const date = new Date()
left: parent.left date.setFullYear(parseInt(year));
leftMargin: 20 date.setMonth(parseInt(month) - 1);
rightMargin: 10 date.setDate(parseInt(day));
right: divider.left date.setHours(0);
verticalCenter: parent.verticalCenter date.setMinutes(0);
} date.setSeconds(0);
text: control.cancelText current = date
onClicked: { control.accepted()
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
}
text: control.okText
onClicked: {
d.changeFlag = false
popup.close()
const year = text_year.text
const month = text_month.text
const day = text_day.text
const date = new Date()
date.setFullYear(parseInt(year));
date.setMonth(parseInt(month) - 1);
date.setDate(parseInt(day));
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
current = date
control.accepted()
}
} }
} }
} }
@ -361,7 +351,7 @@ FluButton {
text_day.text = day text_day.text = day
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

View File

@ -778,9 +778,9 @@ Rectangle {
timer_vertical_force_layout.restart() timer_vertical_force_layout.restart()
} }
Connections{ Connections{
target: table_model target: table_view
function onRowCountChanged(){ function onRowsChanged(){
header_row_model.rows = Array.from({length: table_model.rows.length}, (_, i) => ({rowIndex:i+1})) header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
} }
} }
Timer{ Timer{

View File

@ -111,8 +111,6 @@ FluButton {
} }
Menu{ Menu{
id:popup id:popup
width: container.width
height: container.height
modal: true modal: true
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
@ -132,224 +130,219 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true id:container
Rectangle{ implicitHeight: 340
id:container implicitWidth: 300
height: 340 MouseArea{
width: 300 anchors.fill: parent
radius: 4 }
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1) RowLayout{
MouseArea{ id:layout_content
anchors.fill: parent spacing: 0
} width: parent.width
RowLayout{ height: 280
id:layout_content Component{
spacing: 0 id:list_delegate
width: parent.width Item{
height: 300 height:38
Component{ width:getListView().width
id:list_delegate function getListView(){
Item{ if(type === 0)
height:38 return list_view_1
width:getListView().width if(type === 1)
function getListView(){ return list_view_2
if(type === 0) if(type === 2)
return list_view_1 return list_view_3
if(type === 1) }
return list_view_2 Rectangle{
if(type === 2) anchors.fill: parent
return list_view_3 anchors.topMargin: 2
anchors.bottomMargin: 2
anchors.leftMargin: 5
anchors.rightMargin: 5
color: {
if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor
}
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return Qt.rgba(0,0,0,0)
} }
Rectangle{ radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 2 hoverEnabled: true
anchors.bottomMargin: 2 onClicked: {
anchors.leftMargin: 5 getListView().currentIndex = position
anchors.rightMargin: 5 if(type === 0){
color: { text_hour.text = model
}
if(type === 1){
text_minute.text = model
}
if(type === 2){
text_ampm.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){ if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor if(FluTheme.dark){
} return Qt.rgba(0,0,0,1)
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
}
radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
getListView().currentIndex = position
if(type === 0){
text_hour.text = model
}
if(type === 1){
text_minute.text = model
}
if(type === 2){
text_ampm.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){
if(FluTheme.dark){
return Qt.rgba(0,0,0,1)
}else{
return Qt.rgba(1,1,1,1)
}
}else{ }else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A" return Qt.rgba(1,1,1,1)
} }
}else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A"
} }
anchors.centerIn: parent
} }
anchors.centerIn: parent
} }
} }
} }
ListView{ }
id:list_view_1 ListView{
width: isH ? 100 : 150 id:list_view_1
height: parent.height Layout.preferredWidth: isH ? 100 : 150
boundsBehavior:Flickable.StopAtBounds Layout.preferredHeight: parent.height-2
ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter
preferredHighlightBegin: 0 boundsBehavior:Flickable.StopAtBounds
preferredHighlightEnd: 0 ScrollBar.vertical: FluScrollBar {}
highlightMoveDuration: 0 preferredHighlightBegin: 0
model: isH ? generateArray(1,12) : generateArray(0,23) preferredHighlightEnd: 0
clip: true highlightMoveDuration: 0
delegate: FluLoader{ model: isH ? generateArray(1,12) : generateArray(0,23)
property var model: modelData clip: true
property int type:0 delegate: FluLoader{
property int position:index property var model: modelData
sourceComponent: list_delegate property int type:0
} property int position:index
} sourceComponent: list_delegate
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
}
ListView{
id:list_view_2
width: isH ? 100 : 150
height: parent.height
model: generateArray(0,59)
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
visible: isH
}
ListView{
id:list_view_3
width: 100
height: 76
model: [control.amText,control.pmText]
clip: true
visible: isH
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
} }
} }
Rectangle{ Rectangle{
width: parent.width Layout.preferredWidth: 1
height: 1 Layout.preferredHeight: parent.height
anchors.top: layout_content.bottom
color: control.dividerColor color: control.dividerColor
} }
ListView{
id:list_view_2
Layout.preferredWidth: isH ? 99 : 150
Layout.preferredHeight: parent.height-2
Layout.alignment: Qt.AlignVCenter
model: generateArray(0,59)
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{ Rectangle{
id:layout_actions width: 1
height: 40 height: parent.height
radius: 5 color: control.dividerColor
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) visible: isH
}
ListView{
id:list_view_3
Layout.preferredWidth: 100
Layout.preferredHeight: 76
model: [control.amText,control.pmText]
clip: true
visible: isH
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
}
}
Rectangle{
id:layout_actions
height: 60
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{
bottom:parent.bottom
left: parent.left
right: parent.right
}
Item {
id:divider
width: 1
height: parent.height
anchors.centerIn: parent
}
FluButton{
anchors{ anchors{
bottom:parent.bottom
left: parent.left left: parent.left
leftMargin: 20
rightMargin: 10
right: divider.left
verticalCenter: parent.verticalCenter
}
text: control.cancelText
onClicked: {
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
} }
Item { text: control.okText
id:divider onClicked: {
width: 1 d.changeFlag = false
height: parent.height popup.close()
anchors.centerIn: parent const hours = text_hour.text
} const minutes = text_minute.text
FluButton{ const period = text_ampm.text
anchors{ const date = new Date()
left: parent.left var hours24 = parseInt(hours);
leftMargin: 20 if(control.hourFormat === FluTimePickerType.H){
rightMargin: 10 if (hours === "12") {
right: divider.left hours24 = (period === control.amText) ? 0 : 12;
verticalCenter: parent.verticalCenter } else {
} hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
text: control.cancelText
onClicked: {
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
}
text: control.okText
onClicked: {
d.changeFlag = false
popup.close()
const hours = text_hour.text
const minutes = text_minute.text
const period = text_ampm.text
const date = new Date()
var hours24 = parseInt(hours);
if(control.hourFormat === FluTimePickerType.H){
if (hours === "12") {
hours24 = (period === control.amText) ? 0 : 12;
} else {
hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
}
} }
date.setHours(hours24);
date.setMinutes(parseInt(minutes));
date.setSeconds(0);
current = date
control.accepted()
} }
date.setHours(hours24);
date.setMinutes(parseInt(minutes));
date.setSeconds(0);
current = date
control.accepted()
} }
} }
} }
@ -387,7 +380,7 @@ FluButton {
} }
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

File diff suppressed because it is too large Load Diff

View File

@ -13,16 +13,15 @@ Button{
property color current : Qt.rgba(1,1,1,1) property color current : Qt.rgba(1,1,1,1)
signal accepted() signal accepted()
property int colorHandleRadius: 8 property int colorHandleRadius: 8
property string cancelText: "取消" property string cancelText: qsTr("Cancel")
property string okText: "确定" property string okText: qsTr("OK")
property string titleText: "颜色选择器" property string titleText: qsTr("Color Picker")
property string editText: "编辑颜色" property string editText: qsTr("Edit Color")
property string redText: "红色" property string redText: qsTr("Red")
property string greenText: "绿色" property string greenText: qsTr("Green")
property string blueText: "蓝色" property string blueText: qsTr("Blue")
property string opacityText: "透明度" property string opacityText: qsTr("Opacity")
background: background: Rectangle{
Rectangle{
id:layout_color id:layout_color
radius: 5 radius: 5
color:"#00000000" color:"#00000000"

View File

@ -134,10 +134,9 @@ T.ComboBox {
} }
} }
background:Rectangle{ background:Rectangle{
color:FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
border.color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,229/255,234/255,1)
border.width: 1
radius: 5 radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 5 radius: 5
} }

View File

@ -41,7 +41,7 @@ FluButton {
id:divider_1 id:divider_1
width: 1 width: 1
x: parent.width/3 x: parent.width/3
height: parent.height-1 height: parent.height - 1
color: control.dividerColor color: control.dividerColor
visible: showYear visible: showYear
} }
@ -49,7 +49,7 @@ FluButton {
id:divider_2 id:divider_2
width: 1 width: 1
x: showYear ? parent.width*2/3 : parent.width/2 x: showYear ? parent.width*2/3 : parent.width/2
height: parent.height-1 height: parent.height - 1
color: control.dividerColor color: control.dividerColor
} }
FluText{ FluText{
@ -95,8 +95,6 @@ FluButton {
Menu{ Menu{
id:popup id:popup
modal: true modal: true
width: container.width
height: container.height
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
reversible: true reversible: true
@ -115,227 +113,220 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true id:container
Rectangle{ implicitHeight: 340
id:container implicitWidth: 300
radius: 4 MouseArea{
width: 300 anchors.fill: parent
height: 340 }
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1) RowLayout{
MouseArea{ id:layout_content
anchors.fill: parent spacing: 0
} width: parent.width
FluShadow{ height: 280
radius: 4 Component{
} id:list_delegate
RowLayout{ Item{
id:layout_content height: 38
spacing: 0 width: getListView().width
width: parent.width function getListView(){
height: 300 if(type === 0)
Component{ return list_view_1
id:list_delegate if(type === 1)
Item{ return list_view_2
height:38 if(type === 2)
width:getListView().width return list_view_3
function getListView(){ }
if(type === 0) Rectangle{
return list_view_1 anchors.fill: parent
if(type === 1) anchors.topMargin: 2
return list_view_2 anchors.bottomMargin: 2
if(type === 2) anchors.leftMargin: 5
return list_view_3 anchors.rightMargin: 5
color: {
if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor
}
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return Qt.rgba(0,0,0,0)
} }
Rectangle{ radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 2 hoverEnabled: true
anchors.bottomMargin: 2 onClicked: {
anchors.leftMargin: 5 getListView().currentIndex = position
anchors.rightMargin: 5 if(type === 0){
color: { text_year.text = model
list_view_2.model = generateMonthArray(1,12)
text_month.text = list_view_2.model[list_view_2.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 1){
text_month.text = model
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 2){
text_day.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){ if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor if(FluTheme.dark){
} return Qt.rgba(0,0,0,1)
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
}
radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
getListView().currentIndex = position
if(type === 0){
text_year.text = model
list_view_2.model = generateMonthArray(1,12)
text_month.text = list_view_2.model[list_view_2.currentIndex]
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 1){
text_month.text = model
list_view_3.model = generateMonthDaysArray(list_view_1.model[list_view_1.currentIndex],list_view_2.model[list_view_2.currentIndex])
text_day.text = list_view_3.model[list_view_3.currentIndex]
}
if(type === 2){
text_day.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){
if(FluTheme.dark){
return Qt.rgba(0,0,0,1)
}else{
return Qt.rgba(1,1,1,1)
}
}else{ }else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A" return Qt.rgba(1,1,1,1)
} }
}else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A"
} }
anchors.centerIn: parent
} }
anchors.centerIn: parent
} }
} }
} }
ListView{ }
id:list_view_1 ListView{
width: 100 id:list_view_1
height: parent.height Layout.preferredWidth: 100
boundsBehavior:Flickable.StopAtBounds Layout.preferredHeight: parent.height - 2
ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter
model: generateYearArray(1924,2048) boundsBehavior:Flickable.StopAtBounds
clip: true ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0 model: generateYearArray(1924,2048)
preferredHighlightEnd: 0 clip: true
highlightMoveDuration: 0 preferredHighlightBegin: 0
visible: showYear preferredHighlightEnd: 0
delegate: FluLoader{ highlightMoveDuration: 0
property var model: modelData visible: showYear
property int type:0 delegate: FluLoader{
property int position:index property var model: modelData
sourceComponent: list_delegate property int type:0
} property int position:index
} sourceComponent: list_delegate
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
}
ListView{
id:list_view_2
width: showYear ? 100 : 150
height: parent.height
clip: true
ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
}
ListView{
id:list_view_3
width: showYear ? 100 : 150
height: parent.height
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
} }
} }
Rectangle{ Rectangle{
width: parent.width Layout.preferredWidth: 1
height: 1 Layout.preferredHeight: parent.height
anchors.top: layout_content.bottom color: control.dividerColor
visible: showYear
}
ListView{
id:list_view_2
Layout.preferredWidth: showYear ? 99 : 150
Layout.preferredHeight: parent.height - 2
Layout.alignment: Qt.AlignVCenter
clip: true
ScrollBar.vertical: FluScrollBar {}
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{
Layout.preferredWidth: 1
Layout.preferredHeight: parent.height
color: control.dividerColor color: control.dividerColor
} }
Rectangle{ ListView{
id:layout_actions id:list_view_3
height: 40 Layout.preferredWidth: showYear ? 99 : 150
radius: 5 Layout.preferredHeight: parent.height - 2
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) Layout.alignment: Qt.AlignVCenter
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
}
}
Rectangle{
id:layout_actions
height: 60
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{
bottom:parent.bottom
left: parent.left
right: parent.right
}
Item {
id:divider
width: 1
height: parent.height
anchors.centerIn: parent
}
FluButton{
anchors{ anchors{
bottom:parent.bottom
left: parent.left left: parent.left
leftMargin: 20
rightMargin: 10
right: divider.left
verticalCenter: parent.verticalCenter
}
text: control.cancelText
onClicked: {
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
} }
Item { text: control.okText
id:divider onClicked: {
width: 1 d.changeFlag = false
height: parent.height popup.close()
anchors.centerIn: parent const year = text_year.text
} const month = text_month.text
FluButton{ const day = text_day.text
anchors{ const date = new Date()
left: parent.left date.setFullYear(parseInt(year));
leftMargin: 20 date.setMonth(parseInt(month) - 1);
rightMargin: 10 date.setDate(parseInt(day));
right: divider.left date.setHours(0);
verticalCenter: parent.verticalCenter date.setMinutes(0);
} date.setSeconds(0);
text: control.cancelText current = date
onClicked: { control.accepted()
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
}
text: control.okText
onClicked: {
d.changeFlag = false
popup.close()
const year = text_year.text
const month = text_month.text
const day = text_day.text
const date = new Date()
date.setFullYear(parseInt(year));
date.setMonth(parseInt(month) - 1);
date.setDate(parseInt(day));
date.setHours(0);
date.setMinutes(0);
date.setSeconds(0);
current = date
control.accepted()
}
} }
} }
} }
@ -360,7 +351,7 @@ FluButton {
text_day.text = day text_day.text = day
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

View File

@ -778,9 +778,9 @@ Rectangle {
timer_vertical_force_layout.restart() timer_vertical_force_layout.restart()
} }
Connections{ Connections{
target: table_model target: table_view
function onRowCountChanged(){ function onRowsChanged(){
header_row_model.rows = Array.from({length: table_model.rows.length}, (_, i) => ({rowIndex:i+1})) header_row_model.rows = Array.from({length: table_view.rows}, (_, i) => ({rowIndex:i+1}))
} }
} }
Timer{ Timer{

View File

@ -58,14 +58,14 @@ FluButton {
id: divider_1 id: divider_1
width: 1 width: 1
x: isH ? parent.width/3 : parent.width/2 x: isH ? parent.width/3 : parent.width/2
height: parent.height-1 height: parent.height - 1
color: dividerColor color: dividerColor
} }
Rectangle{ Rectangle{
id: divider_2 id: divider_2
width: 1 width: 1
x: parent.width*2/3 x: parent.width*2/3
height: parent.height-1 height: parent.height - 1
color: dividerColor color: dividerColor
visible: isH visible: isH
} }
@ -111,8 +111,6 @@ FluButton {
} }
Menu{ Menu{
id:popup id:popup
width: container.width
height: container.height
modal: true modal: true
Overlay.modal: Item {} Overlay.modal: Item {}
enter: Transition { enter: Transition {
@ -132,224 +130,219 @@ FluButton {
duration: FluTheme.animationEnabled ? 83 : 0 duration: FluTheme.animationEnabled ? 83 : 0
} }
} }
background:Item{ background:Rectangle{
radius: 5
color: FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(1,1,1,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
FluShadow{ FluShadow{
radius: 4 radius: 5
} }
} }
contentItem: Item{ contentItem: Item{
clip: true id:container
Rectangle{ implicitHeight: 340
id:container implicitWidth: 300
height: 340 MouseArea{
width: 300 anchors.fill: parent
radius: 4 }
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1) RowLayout{
MouseArea{ id:layout_content
anchors.fill: parent spacing: 0
} width: parent.width
RowLayout{ height: 280
id:layout_content Component{
spacing: 0 id:list_delegate
width: parent.width Item{
height: 300 height:38
Component{ width:getListView().width
id:list_delegate function getListView(){
Item{ if(type === 0)
height:38 return list_view_1
width:getListView().width if(type === 1)
function getListView(){ return list_view_2
if(type === 0) if(type === 2)
return list_view_1 return list_view_3
if(type === 1) }
return list_view_2 Rectangle{
if(type === 2) anchors.fill: parent
return list_view_3 anchors.topMargin: 2
anchors.bottomMargin: 2
anchors.leftMargin: 5
anchors.rightMargin: 5
color: {
if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor
}
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return Qt.rgba(0,0,0,0)
} }
Rectangle{ radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 2 hoverEnabled: true
anchors.bottomMargin: 2 onClicked: {
anchors.leftMargin: 5 getListView().currentIndex = position
anchors.rightMargin: 5 if(type === 0){
color: { text_hour.text = model
}
if(type === 1){
text_minute.text = model
}
if(type === 2){
text_ampm.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){ if(getListView().currentIndex === position){
return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor if(FluTheme.dark){
} return Qt.rgba(0,0,0,1)
if(item_mouse.containsMouse){
return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1)
}
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
}
radius: 3
MouseArea{
id:item_mouse
anchors.fill: parent
hoverEnabled: true
onClicked: {
getListView().currentIndex = position
if(type === 0){
text_hour.text = model
}
if(type === 1){
text_minute.text = model
}
if(type === 2){
text_ampm.text = model
}
}
}
FluText{
text:model
color: {
if(getListView().currentIndex === position){
if(FluTheme.dark){
return Qt.rgba(0,0,0,1)
}else{
return Qt.rgba(1,1,1,1)
}
}else{ }else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A" return Qt.rgba(1,1,1,1)
} }
}else{
return FluTheme.dark ? "#FFFFFF" : "#1A1A1A"
} }
anchors.centerIn: parent
} }
anchors.centerIn: parent
} }
} }
} }
ListView{ }
id:list_view_1 ListView{
width: isH ? 100 : 150 id:list_view_1
height: parent.height Layout.preferredWidth: isH ? 100 : 150
boundsBehavior:Flickable.StopAtBounds Layout.preferredHeight: parent.height-2
ScrollBar.vertical: FluScrollBar {} Layout.alignment: Qt.AlignVCenter
preferredHighlightBegin: 0 boundsBehavior:Flickable.StopAtBounds
preferredHighlightEnd: 0 ScrollBar.vertical: FluScrollBar {}
highlightMoveDuration: 0 preferredHighlightBegin: 0
model: isH ? generateArray(1,12) : generateArray(0,23) preferredHighlightEnd: 0
clip: true highlightMoveDuration: 0
delegate: FluLoader{ model: isH ? generateArray(1,12) : generateArray(0,23)
property var model: modelData clip: true
property int type:0 delegate: FluLoader{
property int position:index property var model: modelData
sourceComponent: list_delegate property int type:0
} property int position:index
} sourceComponent: list_delegate
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
}
ListView{
id:list_view_2
width: isH ? 100 : 150
height: parent.height
model: generateArray(0,59)
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{
width: 1
height: parent.height
color: control.dividerColor
visible: isH
}
ListView{
id:list_view_3
width: 100
height: 76
model: [control.amText,control.pmText]
clip: true
visible: isH
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
} }
} }
Rectangle{ Rectangle{
width: parent.width Layout.preferredWidth: 1
height: 1 Layout.preferredHeight: parent.height
anchors.top: layout_content.bottom
color: control.dividerColor color: control.dividerColor
} }
ListView{
id:list_view_2
Layout.preferredWidth: isH ? 99 : 150
Layout.preferredHeight: parent.height-2
Layout.alignment: Qt.AlignVCenter
model: generateArray(0,59)
clip: true
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:1
property int position:index
sourceComponent: list_delegate
}
}
Rectangle{ Rectangle{
id:layout_actions width: 1
height: 40 height: parent.height
radius: 5 color: control.dividerColor
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1) visible: isH
}
ListView{
id:list_view_3
Layout.preferredWidth: 100
Layout.preferredHeight: 76
model: [control.amText,control.pmText]
clip: true
visible: isH
preferredHighlightBegin: 0
preferredHighlightEnd: 0
highlightMoveDuration: 0
ScrollBar.vertical: FluScrollBar {}
Layout.alignment: Qt.AlignVCenter
boundsBehavior:Flickable.StopAtBounds
delegate: FluLoader{
property var model: modelData
property int type:2
property int position:index
sourceComponent: list_delegate
}
}
}
Rectangle{
id:layout_actions
height: 60
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(243/255,243/255,243/255,1)
border.color: FluTheme.dark ? Qt.rgba(26/255,26/255,26/255,1) : Qt.rgba(191/255,191/255,191/255,1)
radius: 5
anchors{
bottom:parent.bottom
left: parent.left
right: parent.right
}
Item {
id:divider
width: 1
height: parent.height
anchors.centerIn: parent
}
FluButton{
anchors{ anchors{
bottom:parent.bottom
left: parent.left left: parent.left
leftMargin: 20
rightMargin: 10
right: divider.left
verticalCenter: parent.verticalCenter
}
text: control.cancelText
onClicked: {
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
} }
Item { text: control.okText
id:divider onClicked: {
width: 1 d.changeFlag = false
height: parent.height popup.close()
anchors.centerIn: parent const hours = text_hour.text
} const minutes = text_minute.text
FluButton{ const period = text_ampm.text
anchors{ const date = new Date()
left: parent.left var hours24 = parseInt(hours);
leftMargin: 20 if(control.hourFormat === FluTimePickerType.H){
rightMargin: 10 if (hours === "12") {
right: divider.left hours24 = (period === control.amText) ? 0 : 12;
verticalCenter: parent.verticalCenter } else {
} hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
text: control.cancelText
onClicked: {
popup.close()
}
}
FluFilledButton{
anchors{
right: parent.right
left: divider.right
rightMargin: 20
leftMargin: 10
verticalCenter: parent.verticalCenter
}
text: control.okText
onClicked: {
d.changeFlag = false
popup.close()
const hours = text_hour.text
const minutes = text_minute.text
const period = text_ampm.text
const date = new Date()
var hours24 = parseInt(hours);
if(control.hourFormat === FluTimePickerType.H){
if (hours === "12") {
hours24 = (period === control.amText) ? 0 : 12;
} else {
hours24 = (period === control.pmText) ? hours24 : hours24 + 12;
}
} }
date.setHours(hours24);
date.setMinutes(parseInt(minutes));
date.setSeconds(0);
current = date
control.accepted()
} }
date.setHours(hours24);
date.setMinutes(parseInt(minutes));
date.setSeconds(0);
current = date
control.accepted()
} }
} }
} }
@ -387,7 +380,7 @@ FluButton {
} }
var pos = control.mapToItem(null, 0, 0) var pos = control.mapToItem(null, 0, 0)
if(d.window.height>pos.y+control.height+container.height){ if(d.window.height>pos.y+control.height+container.height){
popup.y = control.height popup.y = control.height-1
} else if(pos.y>container.height){ } else if(pos.y>container.height){
popup.y = -container.height popup.y = -container.height
} else { } else {

View File

@ -70,6 +70,57 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>FluColorPicker</name>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="16"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="16"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="17"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="17"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="18"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="18"/>
<source>Color Picker</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="19"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="19"/>
<source>Edit Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="20"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="20"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="21"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="21"/>
<source>Green</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="22"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="22"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="23"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="23"/>
<source>Opacity</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>FluContentDialog</name> <name>FluContentDialog</name>
<message> <message>
@ -94,31 +145,31 @@
<context> <context>
<name>FluDatePicker</name> <name>FluDatePicker</name>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="10"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="10"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="10"/>
<source>Year</source> <source>Year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/>
<source>Month</source> <source>Month</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/>
<source>Day</source> <source>Day</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="15"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -212,31 +263,37 @@
<name>FluTimePicker</name> <name>FluTimePicker</name>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="11"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="11"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="11"/>
<source>AM</source> <source>AM</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="12"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="12"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="12"/>
<source>PM</source> <source>PM</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="13"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="13"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="13"/>
<source>Hour</source> <source>Hour</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="14"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="14"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="14"/>
<source>Minute</source> <source>Minute</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="15"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="15"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="15"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="16"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="16"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="16"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -265,8 +322,8 @@
<context> <context>
<name>FluWindow</name> <name>FluWindow</name>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="285"/> <location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="335"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="284"/> <location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="334"/>
<source>Loading...</source> <source>Loading...</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>

View File

@ -70,6 +70,57 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
</context> </context>
<context>
<name>FluColorPicker</name>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="16"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="16"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="17"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="17"/>
<source>OK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="18"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="18"/>
<source>Color Picker</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="19"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="19"/>
<source>Edit Color</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="20"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="20"/>
<source>Red</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="21"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="21"/>
<source>Green</source>
<translation type="unfinished">绿</translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="22"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="22"/>
<source>Blue</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="Qt5/imports/FluentUI/Controls/FluColorPicker.qml" line="23"/>
<location filename="Qt6/imports/FluentUI/Controls/FluColorPicker.qml" line="23"/>
<source>Opacity</source>
<translation type="unfinished"></translation>
</message>
</context>
<context> <context>
<name>FluContentDialog</name> <name>FluContentDialog</name>
<message> <message>
@ -94,31 +145,31 @@
<context> <context>
<name>FluDatePicker</name> <name>FluDatePicker</name>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="10"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="10"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="10"/>
<source>Year</source> <source>Year</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="11"/>
<source>Month</source> <source>Month</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="12"/>
<source>Day</source> <source>Day</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="13"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="15"/> <location filename="Qt5/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/>
<location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/> <location filename="Qt6/imports/FluentUI/Controls/FluDatePicker.qml" line="14"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
@ -212,31 +263,37 @@
<name>FluTimePicker</name> <name>FluTimePicker</name>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="11"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="11"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="11"/>
<source>AM</source> <source>AM</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="12"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="12"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="12"/>
<source>PM</source> <source>PM</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="13"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="13"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="13"/>
<source>Hour</source> <source>Hour</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="14"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="14"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="14"/>
<source>Minute</source> <source>Minute</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="15"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="15"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="15"/>
<source>Cancel</source> <source>Cancel</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="16"/> <location filename="Qt5/imports/FluentUI/Controls/FluTimePicker.qml" line="16"/>
<location filename="Qt6/imports/FluentUI/Controls/FluTimePicker.qml" line="16"/>
<source>OK</source> <source>OK</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
@ -265,8 +322,8 @@
<context> <context>
<name>FluWindow</name> <name>FluWindow</name>
<message> <message>
<location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="285"/> <location filename="Qt5/imports/FluentUI/Controls/FluWindow.qml" line="335"/>
<location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="284"/> <location filename="Qt6/imports/FluentUI/Controls/FluWindow.qml" line="334"/>
<source>Loading...</source> <source>Loading...</source>
<translation type="unfinished">...</translation> <translation type="unfinished">...</translation>
</message> </message>