diff options
| author | rating89us <45968869+rating89us@users.noreply.github.com> | 2021-06-06 20:49:31 +0200 |
|---|---|---|
| committer | rating89us <rating89us@rating89us.com> | 2021-06-06 23:15:53 +0200 |
| commit | 23301da51b9421bbd67e0dddc932a42a33447ad9 (patch) | |
| tree | 16abf2d0354395f974017f72c3607d0539cb09bd /components | |
| parent | 2946127ed791ef8dd6dc430b681a14cd5bd2d71e (diff) | |
| download | monzero-gui-23301da51b9421bbd67e0dddc932a42a33447ad9.tar.gz monzero-gui-23301da51b9421bbd67e0dddc932a42a33447ad9.tar.xz monzero-gui-23301da51b9421bbd67e0dddc932a42a33447ad9.zip | |
DatePicker: highlight selected date/today; hide invalid days
Diffstat (limited to 'components')
| -rw-r--r-- | components/DatePicker.qml | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/components/DatePicker.qml b/components/DatePicker.qml index 8a79b2e8..c8221b83 100644 --- a/components/DatePicker.qml +++ b/components/DatePicker.qml @@ -305,11 +305,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 { @@ -327,19 +322,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) { |
