2018-01-07 06:20:45 +01:00
|
|
|
// Copyright (c) 2014-2018, The Monero Project
|
2015-04-01 10:56:05 +02:00
|
|
|
//
|
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Redistribution and use in source and binary forms, with or without modification, are
|
|
|
|
// permitted provided that the following conditions are met:
|
|
|
|
//
|
|
|
|
// 1. Redistributions of source code must retain the above copyright notice, this list of
|
|
|
|
// conditions and the following disclaimer.
|
|
|
|
//
|
|
|
|
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
|
|
|
// of conditions and the following disclaimer in the documentation and/or other
|
|
|
|
// materials provided with the distribution.
|
|
|
|
//
|
|
|
|
// 3. Neither the name of the copyright holder nor the names of its contributors may be
|
|
|
|
// used to endorse or promote products derived from this software without specific
|
|
|
|
// prior written permission.
|
|
|
|
//
|
|
|
|
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
|
|
|
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
|
|
|
|
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
|
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
|
|
|
|
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
import QtQuick 2.9
|
2014-07-13 14:27:50 +02:00
|
|
|
import QtQuick.Controls 1.2
|
2019-04-11 03:17:29 +02:00
|
|
|
import QtQuick.Layouts 1.2
|
|
|
|
import QtGraphicalEffects 1.0
|
2014-07-13 14:27:50 +02:00
|
|
|
import QtQuick.Controls.Styles 1.2
|
2017-12-27 00:53:21 +01:00
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
import "." as MoneroComponents
|
|
|
|
import "effects/" as MoneroEffects
|
2014-07-13 14:27:50 +02:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: datePicker
|
2019-04-11 03:17:29 +02:00
|
|
|
z: parent.z + 1
|
2014-07-13 14:27:50 +02:00
|
|
|
property bool expanded: false
|
2016-10-08 00:20:55 +02:00
|
|
|
property date currentDate
|
2014-07-13 14:27:50 +02:00
|
|
|
property bool showCurrentDate: true
|
2019-04-11 03:17:29 +02:00
|
|
|
property color backgroundColor : MoneroComponents.Style.appWindowBorderColor
|
2017-12-27 00:53:21 +01:00
|
|
|
property color errorColor : "red"
|
2016-11-06 17:10:25 +01:00
|
|
|
property bool error: false
|
2017-12-27 00:53:21 +01:00
|
|
|
property alias inputLabel: inputLabel
|
|
|
|
|
|
|
|
signal dateChanged();
|
2016-11-06 17:10:25 +01:00
|
|
|
|
2017-12-27 00:53:21 +01:00
|
|
|
height: 50
|
2014-07-13 14:27:50 +02:00
|
|
|
|
|
|
|
onExpandedChanged: if(expanded) appWindow.currentItem = datePicker
|
2016-10-08 00:20:55 +02:00
|
|
|
|
2014-07-13 14:27:50 +02:00
|
|
|
function hide() { datePicker.expanded = false }
|
|
|
|
function containsPoint(px, py) {
|
|
|
|
if(px < 0)
|
|
|
|
return false
|
|
|
|
if(px > width)
|
|
|
|
return false
|
|
|
|
if(py < 0)
|
|
|
|
return false
|
|
|
|
if(py > height + calendarRect.height)
|
|
|
|
return false
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2017-12-27 00:53:21 +01:00
|
|
|
Rectangle {
|
|
|
|
id: inputLabelRect
|
|
|
|
color: "transparent"
|
|
|
|
height: 22
|
|
|
|
width: parent.width
|
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
MoneroComponents.TextPlain {
|
2017-12-27 00:53:21 +01:00
|
|
|
id: inputLabel
|
|
|
|
anchors.top: parent.top
|
2018-01-12 01:45:27 +01:00
|
|
|
anchors.topMargin: 2
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.left: parent.left
|
2018-03-31 03:25:20 +02:00
|
|
|
font.family: MoneroComponents.Style.fontLight.name
|
2018-01-12 01:45:27 +01:00
|
|
|
font.pixelSize: 14
|
2018-01-28 00:14:42 +01:00
|
|
|
font.bold: false
|
2017-12-27 00:53:21 +01:00
|
|
|
textFormat: Text.RichText
|
2018-03-31 03:25:20 +02:00
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
2019-04-11 03:17:29 +02:00
|
|
|
themeTransition: false
|
2016-11-06 17:10:25 +01:00
|
|
|
|
2017-12-27 00:53:21 +01:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
acceptedButtons: Qt.NoButton
|
|
|
|
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
2017-12-27 00:53:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: head
|
|
|
|
anchors.top: inputLabelRect.bottom
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.topMargin: 6
|
2017-12-27 00:53:21 +01:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: 28
|
2014-07-13 14:27:50 +02:00
|
|
|
|
|
|
|
Rectangle {
|
2017-12-27 00:53:21 +01:00
|
|
|
anchors.top: parent.top
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
height: parent.height - 1
|
2014-07-23 11:25:27 +02:00
|
|
|
anchors.leftMargin: datePicker.expanded ? 1 : 0
|
|
|
|
anchors.rightMargin: datePicker.expanded ? 1 : 0
|
2017-12-27 00:53:21 +01:00
|
|
|
radius: 4
|
2014-07-13 14:27:50 +02:00
|
|
|
y: 1
|
2017-12-27 00:53:21 +01:00
|
|
|
color: datePicker.backgroundColor
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
RowLayout {
|
2016-10-08 00:20:55 +02:00
|
|
|
id: dateInput
|
2014-07-23 11:25:27 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.left: parent.left
|
2019-04-11 03:17:29 +02:00
|
|
|
anchors.leftMargin: 2
|
|
|
|
anchors.right: parent.right
|
|
|
|
property string headerFontColor: MoneroComponents.Style.blackTheme ? "#e6e6e6" : "#333333"
|
|
|
|
spacing: 0
|
2014-07-23 11:25:27 +02:00
|
|
|
|
2016-10-08 00:20:55 +02:00
|
|
|
function setDate(date) {
|
|
|
|
var day = date.getDate()
|
|
|
|
var month = date.getMonth() + 1
|
|
|
|
dayInput.text = day < 10 ? "0" + day : day
|
|
|
|
monthInput.text = month < 10 ? "0" + month : month
|
|
|
|
yearInput.text = date.getFullYear()
|
|
|
|
}
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
target: datePicker
|
|
|
|
onCurrentDateChanged: {
|
|
|
|
dateInput.setDate(datePicker.currentDate)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-07-23 11:25:27 +02:00
|
|
|
TextInput {
|
|
|
|
id: dayInput
|
2016-10-08 00:20:55 +02:00
|
|
|
readOnly: true
|
2019-04-11 03:17:29 +02:00
|
|
|
Layout.preferredWidth: childrenRect.width + 40
|
2018-03-31 03:25:20 +02:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
2017-12-27 00:53:21 +01:00
|
|
|
font.pixelSize: 14
|
2019-04-11 03:17:29 +02:00
|
|
|
color: datePicker.error ? errorColor : parent.headerFontColor
|
|
|
|
selectionColor: MoneroComponents.Style.dimmedFontColor
|
|
|
|
selectByMouse: true
|
2014-07-23 11:25:27 +02:00
|
|
|
horizontalAlignment: TextInput.AlignHCenter
|
2019-04-11 03:17:29 +02:00
|
|
|
maximumLength: 2
|
2014-07-23 11:25:27 +02:00
|
|
|
validator: IntValidator{bottom: 01; top: 31;}
|
|
|
|
KeyNavigation.tab: monthInput
|
2016-10-08 00:20:55 +02:00
|
|
|
|
2014-07-23 11:25:27 +02:00
|
|
|
text: {
|
|
|
|
if(datePicker.showCurrentDate) {
|
|
|
|
var day = datePicker.currentDate.getDate()
|
|
|
|
return day < 10 ? "0" + day : day
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
|
|
|
onFocusChanged: {
|
|
|
|
if(focus === false) {
|
|
|
|
if(text.length === 0 || text === "0" || text === "00") text = "01"
|
|
|
|
else if(text.length === 1) text = "0" + text
|
2014-07-17 13:01:12 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
MoneroComponents.TextPlain {
|
2018-03-31 03:25:20 +02:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
2017-12-27 00:53:21 +01:00
|
|
|
font.pixelSize: 14
|
2018-03-31 03:25:20 +02:00
|
|
|
color: datePicker.error ? errorColor : MoneroComponents.Style.defaultFontColor
|
2017-12-27 00:53:21 +01:00
|
|
|
text: "-"
|
2019-04-11 03:17:29 +02:00
|
|
|
themeTransition: false
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
|
2014-07-23 11:25:27 +02:00
|
|
|
TextInput {
|
|
|
|
id: monthInput
|
2016-10-08 00:20:55 +02:00
|
|
|
readOnly: true
|
2019-04-11 03:17:29 +02:00
|
|
|
Layout.preferredWidth: childrenRect.width + 40
|
2018-03-31 03:25:20 +02:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
2017-12-27 00:53:21 +01:00
|
|
|
font.pixelSize: 14
|
2019-04-11 03:17:29 +02:00
|
|
|
color: datePicker.error ? errorColor : parent.headerFontColor
|
|
|
|
selectionColor: MoneroComponents.Style.dimmedFontColor
|
|
|
|
selectByMouse: true
|
2014-07-23 11:25:27 +02:00
|
|
|
horizontalAlignment: TextInput.AlignHCenter
|
2019-04-11 03:17:29 +02:00
|
|
|
maximumLength: 2
|
2014-07-23 11:25:27 +02:00
|
|
|
validator: IntValidator{bottom: 01; top: 12;}
|
|
|
|
KeyNavigation.tab: yearInput
|
|
|
|
text: {
|
|
|
|
if(datePicker.showCurrentDate) {
|
|
|
|
var month = datePicker.currentDate.getMonth() + 1
|
|
|
|
return month < 10 ? "0" + month : month
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
|
|
|
onFocusChanged: {
|
|
|
|
if(focus === false) {
|
|
|
|
if(text.length === 0 || text === "0" || text === "00") text = "01"
|
|
|
|
else if(text.length === 1) text = "0" + text
|
2014-07-17 13:01:12 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
MoneroComponents.TextPlain {
|
2018-03-31 03:25:20 +02:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
2017-12-27 00:53:21 +01:00
|
|
|
font.pixelSize: 14
|
2018-03-31 03:25:20 +02:00
|
|
|
color: datePicker.error ? errorColor : MoneroComponents.Style.defaultFontColor
|
2017-12-27 00:53:21 +01:00
|
|
|
text: "-"
|
2019-04-11 03:17:29 +02:00
|
|
|
themeTransition: false
|
2014-07-23 11:25:27 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
|
2014-07-23 11:25:27 +02:00
|
|
|
TextInput {
|
|
|
|
id: yearInput
|
2019-04-11 03:17:29 +02:00
|
|
|
Layout.preferredWidth: childrenRect.width + 60
|
2018-03-31 03:25:20 +02:00
|
|
|
font.family: MoneroComponents.Style.fontRegular.name
|
2017-12-27 00:53:21 +01:00
|
|
|
font.pixelSize: 14
|
2019-04-11 03:17:29 +02:00
|
|
|
color: datePicker.error ? errorColor : parent.headerFontColor
|
|
|
|
selectionColor: MoneroComponents.Style.dimmedFontColor
|
|
|
|
selectByMouse: true
|
2014-07-23 11:25:27 +02:00
|
|
|
horizontalAlignment: TextInput.AlignHCenter
|
2019-04-11 03:17:29 +02:00
|
|
|
maximumLength: 4
|
2014-07-23 11:25:27 +02:00
|
|
|
validator: IntValidator{bottom: 1000; top: 9999;}
|
|
|
|
text: if(datePicker.showCurrentDate) datePicker.currentDate.getFullYear()
|
2019-04-11 03:17:29 +02:00
|
|
|
|
2014-07-23 11:25:27 +02:00
|
|
|
onFocusChanged: {
|
|
|
|
if(focus === false) {
|
|
|
|
var d = new Date()
|
|
|
|
var y = d.getFullYear()
|
|
|
|
if(text.length != 4 || text[0] === "0")
|
|
|
|
text = y
|
2014-07-17 13:01:12 +02:00
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
}
|
2019-04-11 03:17:29 +02:00
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
Layout.preferredHeight: parent.height
|
|
|
|
Layout.fillWidth: true
|
|
|
|
color: "transparent"
|
|
|
|
|
|
|
|
Image {
|
|
|
|
id: button
|
|
|
|
anchors.right: parent.right
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.rightMargin: 10
|
2019-04-11 03:17:29 +02:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
source: "qrc:///images/whiteDropIndicator.png"
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
source: button
|
|
|
|
anchors.fill: button
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
rotation: datePicker.expanded ? 180 : 0
|
|
|
|
opacity: 1
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: datePicker.expanded = !datePicker.expanded
|
|
|
|
hoverEnabled: true
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
}
|
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: calendarRect
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: head.bottom
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.topMargin: 10
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.middlePanelBackgroundColor
|
2014-07-23 11:25:27 +02:00
|
|
|
border.width: 1
|
2019-04-11 03:17:29 +02:00
|
|
|
border.color: MoneroComponents.Style.appWindowBorderColor
|
2014-07-23 11:25:27 +02:00
|
|
|
height: datePicker.expanded ? calendar.height + 2 : 0
|
2014-07-13 14:27:50 +02:00
|
|
|
clip: true
|
|
|
|
|
|
|
|
Behavior on height {
|
|
|
|
NumberAnimation { duration: 100; easing.type: Easing.InQuad }
|
|
|
|
}
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
2014-07-23 11:25:27 +02:00
|
|
|
anchors.leftMargin: 1
|
|
|
|
anchors.rightMargin: 1
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.top: parent.top
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.appWindowBorderColor
|
2014-07-23 11:25:27 +02:00
|
|
|
height: 1
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Calendar {
|
|
|
|
id: calendar
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.top: parent.top
|
2014-07-23 11:25:27 +02:00
|
|
|
anchors.margins: 1
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.bottomMargin: 10
|
2019-04-11 03:17:29 +02:00
|
|
|
height: 220
|
2014-07-13 14:27:50 +02:00
|
|
|
frameVisible: false
|
|
|
|
|
|
|
|
style: CalendarStyle {
|
|
|
|
gridVisible: false
|
2019-04-11 03:17:29 +02:00
|
|
|
background: Rectangle { color: MoneroComponents.Style.middlePanelBackgroundColor }
|
2014-07-13 14:27:50 +02:00
|
|
|
dayDelegate: Item {
|
2018-03-27 02:03:59 +02:00
|
|
|
z: parent.z + 1
|
2014-07-13 14:27:50 +02:00
|
|
|
implicitHeight: implicitWidth
|
|
|
|
implicitWidth: calendar.width / 7
|
|
|
|
|
|
|
|
Rectangle {
|
2019-04-11 03:17:29 +02:00
|
|
|
id: dayRect
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
radius: parent.implicitHeight / 2
|
2019-04-11 03:17:29 +02:00
|
|
|
color: {
|
|
|
|
if(dayArea.pressed && styleData.visibleMonth)
|
|
|
|
return MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
|
|
|
|
return "transparent";
|
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
MoneroComponents.TextPlain {
|
|
|
|
id: dayText
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.centerIn: parent
|
2019-04-11 03:17:29 +02:00
|
|
|
font.family: MoneroComponents.Style.fontMonoRegular.name
|
|
|
|
font.pixelSize: {
|
|
|
|
if(!styleData.visibleMonth) return 12
|
|
|
|
return 14
|
|
|
|
}
|
|
|
|
font.bold: {
|
|
|
|
if(dayArea.pressed || styleData.visibleMonth) return true;
|
|
|
|
return false;
|
|
|
|
}
|
2014-07-13 14:27:50 +02:00
|
|
|
text: styleData.date.getDate()
|
2019-04-11 03:17:29 +02:00
|
|
|
themeTransition: false
|
2014-07-13 14:27:50 +02:00
|
|
|
color: {
|
2019-04-11 03:17:29 +02:00
|
|
|
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
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: dayArea
|
|
|
|
anchors.fill: parent
|
2019-04-11 03:17:29 +02:00
|
|
|
hoverEnabled: true
|
|
|
|
onEntered: dayRect.color = MoneroComponents.Style.blackTheme ? "#20FFFFFF" : "#10000000"
|
|
|
|
onExited: dayRect.color = "transparent"
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2014-07-13 14:27:50 +02:00
|
|
|
onClicked: {
|
|
|
|
if(styleData.visibleMonth) {
|
2016-10-08 00:20:55 +02:00
|
|
|
currentDate = styleData.date
|
2014-07-13 14:27:50 +02:00
|
|
|
datePicker.expanded = false
|
|
|
|
} else {
|
|
|
|
var date = styleData.date
|
|
|
|
if(date.getMonth() > calendar.visibleMonth)
|
|
|
|
calendar.showNextMonth()
|
|
|
|
else calendar.showPreviousMonth()
|
|
|
|
}
|
2017-12-27 00:53:21 +01:00
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
datePicker.dateChanged();
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dayOfWeekDelegate: Item {
|
|
|
|
implicitHeight: 20
|
|
|
|
implicitWidth: calendar.width / 7
|
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
MoneroComponents.TextPlain {
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.centerIn: parent
|
|
|
|
elide: Text.ElideRight
|
2019-04-11 03:17:29 +02:00
|
|
|
font.family: MoneroComponents.Style.fontMonoRegular.name
|
|
|
|
font.pixelSize: 12
|
|
|
|
color: MoneroComponents.Style.lightGreyFontColor
|
|
|
|
themeTransition: false
|
2014-07-13 14:27:50 +02:00
|
|
|
text: {
|
|
|
|
var locale = Qt.locale()
|
|
|
|
return locale.dayName(styleData.dayOfWeek, Locale.ShortFormat)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
navigationBar: Rectangle {
|
2019-04-11 03:17:29 +02:00
|
|
|
color: MoneroComponents.Style.middlePanelBackgroundColor
|
2014-07-13 14:27:50 +02:00
|
|
|
implicitWidth: calendar.width
|
|
|
|
implicitHeight: 30
|
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
MoneroComponents.TextPlain {
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.centerIn: parent
|
2019-04-11 03:17:29 +02:00
|
|
|
font.family: MoneroComponents.Style.fontMonoRegular.name
|
|
|
|
font.pixelSize: 14
|
|
|
|
color: MoneroComponents.Style.dimmedFontColor
|
|
|
|
themeTransition: false
|
2014-07-13 14:27:50 +02:00
|
|
|
text: styleData.title
|
|
|
|
}
|
|
|
|
|
2019-04-11 03:17:29 +02:00
|
|
|
|
2014-07-13 14:27:50 +02:00
|
|
|
Item {
|
|
|
|
anchors.left: parent.left
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.leftMargin: 4
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
width: height
|
|
|
|
|
|
|
|
Image {
|
2019-04-11 03:17:29 +02:00
|
|
|
id: prevMonthIcon
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.centerIn: parent
|
2019-04-11 03:17:29 +02:00
|
|
|
source: "qrc:///images/prevMonth.png"
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
source: prevMonthIcon
|
|
|
|
anchors.fill: prevMonthIcon
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
opacity: 0.5
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
2019-04-11 03:17:29 +02:00
|
|
|
hoverEnabled: true
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: calendar.showPreviousMonth()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
anchors.right: parent.right
|
2019-04-25 21:09:23 +02:00
|
|
|
anchors.rightMargin: 4
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
width: height
|
|
|
|
|
|
|
|
Image {
|
2019-04-11 03:17:29 +02:00
|
|
|
id: nextMonthIcon
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.centerIn: parent
|
2019-04-11 03:17:29 +02:00
|
|
|
source: "qrc:///images/prevMonth.png"
|
|
|
|
visible: false
|
|
|
|
}
|
|
|
|
|
|
|
|
ColorOverlay {
|
|
|
|
source: nextMonthIcon
|
|
|
|
anchors.fill: nextMonthIcon
|
|
|
|
color: MoneroComponents.Style.defaultFontColor
|
|
|
|
opacity: 0.5
|
2019-01-07 11:04:35 +01:00
|
|
|
rotation: 180
|
2014-07-13 14:27:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
2019-04-11 03:17:29 +02:00
|
|
|
hoverEnabled: true
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
2014-07-13 14:27:50 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: calendar.showNextMonth()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|