mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-26 20:45:54 +00:00
DatePicker: highlight selected date/today; hide invalid days
This commit is contained in:
parent
2946127ed7
commit
23301da51b
1 changed files with 19 additions and 11 deletions
|
@ -305,11 +305,6 @@ Item {
|
||||||
id: dayRect
|
id: dayRect
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: parent.implicitHeight / 2
|
radius: parent.implicitHeight / 2
|
||||||
color: {
|
|
||||||
if(dayArea.pressed && styleData.visibleMonth)
|
|
||||||
return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
|
|
||||||
return "transparent";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MoneroComponents.TextPlain {
|
MoneroComponents.TextPlain {
|
||||||
|
@ -327,19 +322,32 @@ Item {
|
||||||
text: styleData.date.getDate()
|
text: styleData.date.getDate()
|
||||||
themeTransition: false
|
themeTransition: false
|
||||||
color: {
|
color: {
|
||||||
if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor
|
if (currentDate.toDateString() === styleData.date.toDateString()) {
|
||||||
if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor
|
if (dayArea.containsMouse) {
|
||||||
if(styleData.today) return MoneroComponents.Style.orange
|
dayRect.color = MoneroComponents.Style.buttonBackgroundColorHover;
|
||||||
return MoneroComponents.Style.defaultFontColor
|
} else {
|
||||||
|
dayRect.color = MoneroComponents.Style.buttonBackgroundColor;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (dayArea.containsMouse) {
|
||||||
|
dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
|
||||||
|
} else {
|
||||||
|
dayRect.color = "transparent";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!styleData.valid) return "transparent"
|
||||||
|
if(styleData.date.toDateString() === (new Date()).toDateString()) return "#FFFF00"
|
||||||
|
if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor
|
||||||
|
if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor
|
||||||
|
return MoneroComponents.Style.defaultFontColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: dayArea
|
id: dayArea
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
visible: styleData.valid
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onEntered: dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
|
|
||||||
onExited: dayRect.color = "transparent"
|
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(styleData.visibleMonth) {
|
if(styleData.visibleMonth) {
|
||||||
|
|
Loading…
Reference in a new issue