123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- import QtQuick 1.1
- import com.nokia.meego 1.0
- import TransferUI 1.0
- Item {
- id: transferControls
- property int estimate: estimateTextField.text
- property alias progress: progressSlider.value
- property Style platformStyle: LabelStyle {}
- signal markCancelledButtonClicked()
- signal markCompletedButtonClicked()
- signal markDoneButtonClicked()
- signal markFailureButtonClicked()
- signal markPausedButtonClicked()
- signal markResumedButtonClicked()
- signal setActiveButtonClicked()
- signal setPendingButtonClicked()
- onEstimateChanged: {
- estimateTextField.text = estimate;
- }
- Grid {
- id: controlButtonsGrid
- width: parent.width
- property int buttonWidth: (parent.width - spacing) / 2
- anchors {
- top: parent.top
- left: parent.left
- right: parent.right
- }
- columns: 2
- spacing: 10
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Cancel"
- onClicked: transferControls.markCancelledButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Mark completed"
- onClicked: transferControls.markCompletedButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Mark done"
- onClicked: transferControls.markDoneButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Mark failure"
- onClicked: transferControls.markFailureButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Pause"
- onClicked: transferControls.markPausedButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Resume"
- onClicked: transferControls.markResumedButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Set active"
- onClicked: transferControls.setActiveButtonClicked();
- }
- Button {
- width: controlButtonsGrid.buttonWidth
- text: "Set pending"
- onClicked: transferControls.setPendingButtonClicked();
- }
- }
- Grid {
- id: labeledControlsGrid
- width: parent.width
- anchors {
- top: controlButtonsGrid.bottom
- left: parent.left
- right: parent.right
- topMargin: spacing
- }
- columns: 2
- spacing: 10
- Text {
- id: estimateLabel
- width: 150
- height: estimateTextField.height
- verticalAlignment: Text.AlignVCenter
- text: "Estimate"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- TextField {
- id: estimateTextField
- width: transferControls.width - labeledControlsGrid.spacing / 2
- - estimateLabel.width
- validator: IntValidator {}
- inputMethodHints: Qt.ImhPreferNumbers
- onTextChanged: {
- var textAsNum = estimateTextField.text;
- transferControls.estimate = textAsNum;
- }
- }
- Text {
- width: estimateLabel.width
- height: progressSlider.height
- verticalAlignment: Text.AlignVCenter
- text: "Progress"
- font {
- family: platformStyle.fontFamily
- pixelSize: platformStyle.fontPixelSize
- }
- }
- Slider {
- id: progressSlider
- width: estimateTextField.width
- minimumValue: 0.0
- maximumValue: 1.0
- }
- }
- }
- // End of file.
|