Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Start implementing the date picker (linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBriza committed Dec 6, 2019
1 parent e510a9e commit 624a7a4
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 12 deletions.
59 changes: 53 additions & 6 deletions src/ui/linux/TogglDesktop/TimeEntryListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ Item {

TogglTextField {
id: durationField
width: timeContainer.separate ? parent.width : timeMetrics.width + 3
width: timeContainer.separate ? parent.width : timeMetrics.width + 6
height: implicitHeight
implicitWidth: timeMetrics.width + 3
implicitWidth: timeMetrics.width + 6
text: timeEntry ? timeEntry.Duration : ""
}

Expand All @@ -157,7 +157,7 @@ Item {
}
TogglTextField {
id: startTimeField
implicitWidth: timeMetrics.width + 3
implicitWidth: timeMetrics.width + 6
//Layout.minimumWidth: timeMetrics.width
Layout.fillWidth: timeContainer.separate
text: timeEntry ? timeEntry.StartTimeString : ""
Expand All @@ -169,19 +169,66 @@ Item {
}
TogglTextField {
id: endTimeField
implicitWidth: timeMetrics.width + 3
implicitWidth: timeMetrics.width + 6
Layout.fillWidth: timeContainer.separate
//Layout.minimumWidth: timeMetrics.width
text: timeEntry ? timeEntry.EndTimeString : ""
}
}
}

TogglTextField {
TogglButtonBackground {
visible: expanded
Layout.fillWidth: true
Layout.columnSpan: 3
text: timeEntry ? (new Date(Date(timeEntry.Started)).toLocaleDateString(Qt.locale(), Locale.ShortFormat)) : ""

MouseArea {
anchors.fill: parent
onClicked: console.log("This would open a calendar")
}
MouseArea {
anchors {
right: leftSeparator.left
top: parent.top
bottom: parent.bottom
left: parent.left
}
onClicked: console.log("Date--")
}
MouseArea {
anchors {
left: rightSeparator.right
top: parent.top
bottom: parent.bottom
right: parent.right
}
onClicked: console.log("Date++")
}

Rectangle {
id: leftSeparator
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.leftMargin: 32
width: 1
color: parent.borderColor
}
Rectangle {
id: rightSeparator
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 32
width: 1
color: parent.borderColor
}

Text {
color: mainPalette.text
anchors.centerIn: parent
text: timeEntry ? (new Date(Date(timeEntry.Started)).toLocaleDateString(Qt.locale(), Locale.ShortFormat)) : ""
}
}


Expand Down
12 changes: 6 additions & 6 deletions src/ui/linux/TogglDesktop/TogglButtonBackground.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Rectangle {
implicitHeight: 32
radius: 6

property color borderColor: control.enabled ? mainPalette.borderColor : disabledPalette.button
property color borderColor: !control || control.enabled ? mainPalette.borderColor : disabledPalette.button
//property color shadowColor: control.enabled ? control.checked ? "#595959" : control.hovered ? "#e5e5e5" : "#d4d4d4" : baseColor
//property color baseColor: control.enabled ? control.checked ? "#7a7a7a" : control.hovered ? "#d4d4d4" : "#c3c3c3" : "#b2b2b2"
property color shadowColor: control.enabled ? control.pressed | control.checked ? mixColors(palette.button, mainPalette.buttonText, 0.5)
: control.hovered ? mixColors(palette.button, mainPalette.light, 0.5)
: mixColors(palette.button, mainPalette.light, 0.5)
property color shadowColor: !control || control.enabled ? !control || control.pressed || control.checked ? mixColors(mainPalette.button, mainPalette.buttonText, 0.5)
: control.hovered ? mixColors(mainPalette.button, mainPalette.light, 0.5)
: mixColors(mainPalette.button, mainPalette.light, 0.5)
: baseColor
property color baseColor: control.enabled ? control.pressed | control.checked ? mixColors(palette.buttonText, mainPalette.button, 0.66)
: control.hovered ? mixColors(palette.button, mainPalette.light, 0.5)
property color baseColor: !control || control.enabled ? !control || control.pressed || control.checked ? mixColors(mainPalette.buttonText, mainPalette.button, 0.66)
: control.hovered ? mixColors(mainPalette.button, mainPalette.light, 0.5)
: mainPalette.button
: disabledPalette.button

Expand Down

0 comments on commit 624a7a4

Please sign in to comment.