mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-08 12:47:40 +08:00
update
This commit is contained in:
@ -9,6 +9,7 @@ Button {
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(246/255,246/255,246/255,1)
|
||||
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(244/255,244/255,244/255,1)
|
||||
property color dividerColor: FluTheme.dark ? Qt.rgba(80/255,80/255,80/255,1) : Qt.rgba(233/255,233/255,233/255,1)
|
||||
property color textColor: {
|
||||
if(FluTheme.dark){
|
||||
if(!enabled){
|
||||
@ -41,7 +42,7 @@ Button {
|
||||
background: Rectangle{
|
||||
implicitWidth: 28
|
||||
implicitHeight: 28
|
||||
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
||||
border.color: control.dividerColor
|
||||
border.width: 1
|
||||
radius: 4
|
||||
color:{
|
||||
|
@ -4,35 +4,22 @@ import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Rectangle {
|
||||
property color dividerColor: FluTheme.dark ? Qt.rgba(77/255,77/255,77/255,1) : Qt.rgba(239/255,239/255,239/255,1)
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
property string text: qsTr("Pick a date")
|
||||
FluButton {
|
||||
text: {
|
||||
if(control.current){
|
||||
return control.current.toLocaleDateString(FluApp.locale,"yyyy/M/d")
|
||||
}
|
||||
return qsTr("Pick a date")
|
||||
}
|
||||
property date from: new Date(1924, 0, 1)
|
||||
property date to: new Date(2124, 11, 31)
|
||||
property var current
|
||||
signal accepted()
|
||||
id:control
|
||||
color: {
|
||||
if(mouse_area.containsMouse){
|
||||
return hoverColor
|
||||
}
|
||||
return normalColor
|
||||
}
|
||||
height: 30
|
||||
width: 120
|
||||
radius: 4
|
||||
border.width: 1
|
||||
border.color: dividerColor
|
||||
MouseArea{
|
||||
id:mouse_area
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
popup.showPopup()
|
||||
}
|
||||
onClicked: {
|
||||
popup.showPopup()
|
||||
}
|
||||
rightPadding: 36
|
||||
CalendarModel {
|
||||
id:calender_model
|
||||
from: control.from
|
||||
@ -53,28 +40,10 @@ Rectangle {
|
||||
signal previousButton
|
||||
property point yearRing : Qt.point(0,0)
|
||||
}
|
||||
FluText{
|
||||
id:text_date
|
||||
anchors{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
rightMargin: 30
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
}
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text:{
|
||||
if(control.current){
|
||||
return control.current.toLocaleDateString(FluApp.locale,"yyyy/M/d")
|
||||
}
|
||||
return control.text
|
||||
}
|
||||
}
|
||||
FluIcon{
|
||||
iconSource: FluentIcons.Calendar
|
||||
iconSize: 14
|
||||
iconColor: text_date.color
|
||||
iconColor: control.textColor
|
||||
anchors{
|
||||
verticalCenter: parent.verticalCenter
|
||||
right: parent.right
|
||||
|
@ -4,10 +4,7 @@ import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Rectangle {
|
||||
property color dividerColor: FluTheme.dark ? Qt.rgba(77/255,77/255,77/255,1) : Qt.rgba(239/255,239/255,239/255,1)
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
FluButton {
|
||||
property bool showYear: true
|
||||
property var current
|
||||
property string yearText: qsTr("Year")
|
||||
@ -17,17 +14,8 @@ Rectangle {
|
||||
property string okText: qsTr("OK")
|
||||
signal accepted()
|
||||
id:control
|
||||
color: {
|
||||
if(mouse_area.containsMouse){
|
||||
return hoverColor
|
||||
}
|
||||
return normalColor
|
||||
}
|
||||
height: 30
|
||||
width: 300
|
||||
radius: 4
|
||||
border.width: 1
|
||||
border.color: dividerColor
|
||||
implicitHeight: 30
|
||||
implicitWidth: 300
|
||||
Component.onCompleted: {
|
||||
if(current){
|
||||
const now = current;
|
||||
@ -46,20 +34,15 @@ Rectangle {
|
||||
property var rowData: ["","",""]
|
||||
visible: false
|
||||
}
|
||||
MouseArea{
|
||||
id:mouse_area
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
popup.showPopup()
|
||||
}
|
||||
onClicked: {
|
||||
popup.showPopup()
|
||||
}
|
||||
Rectangle{
|
||||
id:divider_1
|
||||
width: 1
|
||||
x: parent.width/3
|
||||
height: parent.height
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
visible: showYear
|
||||
}
|
||||
Rectangle{
|
||||
@ -67,7 +50,7 @@ Rectangle {
|
||||
width: 1
|
||||
x: showYear ? parent.width*2/3 : parent.width/2
|
||||
height: parent.height
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
}
|
||||
FluText{
|
||||
id:text_year
|
||||
@ -81,6 +64,7 @@ Rectangle {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text:control.yearText
|
||||
color: control.textColor
|
||||
}
|
||||
FluText{
|
||||
id:text_month
|
||||
@ -93,6 +77,7 @@ Rectangle {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text:control.monthText
|
||||
color: control.textColor
|
||||
}
|
||||
FluText{
|
||||
id:text_day
|
||||
@ -105,6 +90,7 @@ Rectangle {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text:control.dayText
|
||||
color: control.textColor
|
||||
}
|
||||
Menu{
|
||||
id:popup
|
||||
@ -247,7 +233,7 @@ Rectangle {
|
||||
Rectangle{
|
||||
width: 1
|
||||
height: parent.height
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
}
|
||||
ListView{
|
||||
id:list_view_2
|
||||
@ -269,7 +255,7 @@ Rectangle {
|
||||
Rectangle{
|
||||
width: 1
|
||||
height: parent.height
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
}
|
||||
ListView{
|
||||
id:list_view_3
|
||||
@ -294,7 +280,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.top: layout_content.bottom
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_actions
|
||||
|
@ -4,10 +4,7 @@ import QtQuick.Layouts
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Rectangle {
|
||||
property color dividerColor: FluTheme.dark ? Qt.rgba(77/255,77/255,77/255,1) : Qt.rgba(239/255,239/255,239/255,1)
|
||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||
property color normalColor: FluTheme.dark ? Qt.rgba(61/255,61/255,61/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||
FluButton {
|
||||
property int hourFormat: FluTimePickerType.H
|
||||
property int isH: hourFormat === FluTimePickerType.H
|
||||
property var current
|
||||
@ -19,17 +16,8 @@ Rectangle {
|
||||
property string okText: "确定"
|
||||
signal accepted()
|
||||
id:control
|
||||
color: {
|
||||
if(mouse_area.containsMouse){
|
||||
return hoverColor
|
||||
}
|
||||
return normalColor
|
||||
}
|
||||
height: 30
|
||||
width: 300
|
||||
radius: 4
|
||||
border.width: 1
|
||||
border.color: dividerColor
|
||||
implicitHeight: 30
|
||||
implicitWidth: 300
|
||||
Component.onCompleted: {
|
||||
if(current){
|
||||
var now = current;
|
||||
@ -62,16 +50,9 @@ Rectangle {
|
||||
property bool changeFlag: true
|
||||
property var rowData: ["","",""]
|
||||
visible: false
|
||||
|
||||
|
||||
}
|
||||
MouseArea{
|
||||
id: mouse_area
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
popup.showPopup()
|
||||
}
|
||||
onClicked: {
|
||||
popup.showPopup()
|
||||
}
|
||||
Rectangle{
|
||||
id: divider_1
|
||||
@ -99,6 +80,7 @@ Rectangle {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: control.hourText
|
||||
color: control.textColor
|
||||
}
|
||||
FluText{
|
||||
id: text_minute
|
||||
@ -111,6 +93,7 @@ Rectangle {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: control.minuteText
|
||||
color: control.textColor
|
||||
}
|
||||
FluText{
|
||||
id:text_ampm
|
||||
@ -124,6 +107,7 @@ Rectangle {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: "%1/%2".arg(control.amText).arg(control.pmText)
|
||||
color: control.textColor
|
||||
}
|
||||
Menu{
|
||||
id:popup
|
||||
@ -254,7 +238,7 @@ Rectangle {
|
||||
Rectangle{
|
||||
width: 1
|
||||
height: parent.height
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
}
|
||||
ListView{
|
||||
id:list_view_2
|
||||
@ -277,7 +261,7 @@ Rectangle {
|
||||
Rectangle{
|
||||
width: 1
|
||||
height: parent.height
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
visible: isH
|
||||
}
|
||||
ListView{
|
||||
@ -305,7 +289,7 @@ Rectangle {
|
||||
width: parent.width
|
||||
height: 1
|
||||
anchors.top: layout_content.bottom
|
||||
color: dividerColor
|
||||
color: control.dividerColor
|
||||
}
|
||||
Rectangle{
|
||||
id:layout_actions
|
||||
|
Reference in New Issue
Block a user