X-Git-Url: https://www.flypig.org.uk/git/?p=harbour-pedalo.git;a=blobdiff_plain;f=qml%2Fpages%2FDurationEditDialog.qml;fp=qml%2Fpages%2FDurationEditDialog.qml;h=95e2dfff3e64fabd23e4b8c49386d0ec9ac8000a;hp=0000000000000000000000000000000000000000;hb=badbb9139e0e5b3bc114ae7c150e6d9ab5183566;hpb=b22fdac4f96ee5858c4672f1743fd58ad8f6d6f4 diff --git a/qml/pages/DurationEditDialog.qml b/qml/pages/DurationEditDialog.qml new file mode 100644 index 0000000..95e2dff --- /dev/null +++ b/qml/pages/DurationEditDialog.qml @@ -0,0 +1,91 @@ +import QtQuick 2.0 +import Sailfish.Silica 1.0 +//import "editdialog" +//import "../common" + +// Amended version of /usr/share/jolla-clock/pages/ClockEditDialog.qml +Dialog { + id: dialog + + property alias hour: timePicker.hour + property alias minute: timePicker.minute + + property Item timePicker: timePicker + property bool leftToRight: qsTr("LTR") !== "RTL" + + canAccept: true + + SilicaFlickable { + anchors.fill: parent + contentHeight: column.height + flickableDirection: Flickable.VerticalFlick + + Column { + id: column + + width: parent.width + spacing: Theme.paddingLarge + + DialogHeader { + id: header + } + Item { + height: childrenRect.height + width: parent.width + TimePicker { + id: timePicker + x: isPortrait ? (column.width-width)/2 : Theme.horizontalPageMargin + // otherwise in 12h mode this caused timer 00:00 to display as 12:00am + hourMode: DateTime.TwentyFourHours + + Column { + id: timerLabelColumn + anchors.centerIn: parent + + //: Can have two values: "LTR" if remaining time in timer item should be written in "[value] [unit]" order i.e. "2 min", or "RTL" i.e. right-to-left like in Arabic writing systems + spacing: -Theme.paddingMedium + Row { + spacing: Theme.paddingSmall + anchors.horizontalCenter: parent.horizontalCenter + layoutDirection: leftToRight ? Qt.LeftToRight : Qt.RightToLeft + Label { + id: hours + text: timePicker.hour.toLocaleString() + font.pixelSize: Theme.fontSizeHuge + height: Math.min(implicitHeight, (timePicker.height*0.4 - timerLabelColumn.spacing)/2) + fontSizeMode: Text.VerticalFit + } + Label { + id: hoursLabel + //: "Hour abbrevation. Should be short form if possible." + text: qsTr("h") + anchors.baseline: hours.baseline + opacity: 0.7 + } + } + Row { + spacing: Theme.paddingSmall + anchors.horizontalCenter: parent.horizontalCenter + layoutDirection: leftToRight ? Qt.LeftToRight : Qt.RightToLeft + Label { + id: minutes + text: timePicker.minute.toLocaleString() + font.pixelSize: Theme.fontSizeHuge + height: Math.min(implicitHeight, (timePicker.height*0.4 - timerLabelColumn.spacing)/2) + fontSizeMode: Text.VerticalFit + } + Label { + id: minuteLabel + //: "Minute abbrevation. Should be short form if possible." + text: qsTr("min") + anchors.baseline: minutes.baseline + verticalAlignment: Text.AlignBottom + opacity: 0.7 + } + } + } + } + } + } + } +}