aboutsummaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-06-10 10:27:42 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-06-10 10:27:42 -0500
commit2c54787644f261e475848334788e68265c7f2d9e (patch)
tree943a1b30829f6491bae1bb865b89bd72ca6952fa /components
parent7770621a2fd55e007c4db3e30e1ed5e018b40b91 (diff)
parent23301da51b9421bbd67e0dddc932a42a33447ad9 (diff)
downloadmonzero-gui-2c54787644f261e475848334788e68265c7f2d9e.tar.gz
monzero-gui-2c54787644f261e475848334788e68265c7f2d9e.tar.xz
monzero-gui-2c54787644f261e475848334788e68265c7f2d9e.zip
Merge pull request #3532
23301da DatePicker: highlight selected date/today; hide invalid days (rating89us)
Diffstat (limited to 'components')
-rw-r--r--components/DatePicker.qml30
1 files changed, 19 insertions, 11 deletions
diff --git a/components/DatePicker.qml b/components/DatePicker.qml
index f9290d6c..8dd7347c 100644
--- a/components/DatePicker.qml
+++ b/components/DatePicker.qml
@@ -303,11 +303,6 @@ Item {
id: dayRect
anchors.fill: parent
radius: parent.implicitHeight / 2
- color: {
- if(dayArea.pressed && styleData.visibleMonth)
- return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
- return "transparent";
- }
}
MoneroComponents.TextPlain {
@@ -325,19 +320,32 @@ Item {
text: styleData.date.getDate()
themeTransition: false
color: {
- if(!styleData.visibleMonth) return MoneroComponents.Style.lightGreyFontColor
- if(dayArea.pressed) return MoneroComponents.Style.defaultFontColor
- if(styleData.today) return MoneroComponents.Style.orange
- return MoneroComponents.Style.defaultFontColor
+ if (currentDate.toDateString() === styleData.date.toDateString()) {
+ if (dayArea.containsMouse) {
+ dayRect.color = MoneroComponents.Style.buttonBackgroundColorHover;
+ } 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 {
id: dayArea
anchors.fill: parent
+ visible: styleData.valid
hoverEnabled: true
- onEntered: dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
- onExited: dayRect.color = "transparent"
cursorShape: Qt.PointingHandCursor
onClicked: {
if(styleData.visibleMonth) {