SHOW:
|
|
- or go back to the newest paste.
| 1 | import QtQuick 2.0 | |
| 2 | import Sailfish.Silica 1.0 | |
| 3 | ||
| 4 | Item{
| |
| 5 | id: root | |
| 6 | height: columnA.height | |
| 7 | transformOrigin: Item.Bottom | |
| 8 | state: "current" | |
| 9 | ||
| 10 | property var stack; | |
| 11 | property int invertedIndex: memory.count - index | |
| 12 | ||
| 13 | Column {
| |
| 14 | id: columnA | |
| 15 | ||
| 16 | width: parent.width | |
| 17 | ||
| 18 | anchors{
| |
| 19 | top: parent.top | |
| 20 | left: parent.left | |
| 21 | } | |
| 22 | ||
| 23 | spacing: 10 | |
| 24 | ||
| 25 | BackgroundItem {
| |
| 26 | id: bg | |
| 27 | ||
| 28 | width: parent.width | |
| 29 | height: Theme.fontSizeExtraLarge | |
| 30 | //highlighted: true | |
| 31 | ||
| 32 | onClicked: {
| |
| 33 | console.log("lol");
| |
| 34 | } | |
| 35 | ||
| 36 | Label {
| |
| 37 | id: idLabel | |
| 38 | ||
| 39 | anchors.left: parent.left | |
| 40 | anchors.verticalCenter: parent.verticalCenter | |
| 41 | ||
| 42 | height: Theme.fontSizeExtraLarge + 10 | |
| 43 | ||
| 44 | horizontalAlignment: Text.AlignLeft | |
| 45 | verticalAlignment: Text.AlignVCenter | |
| 46 | font.family: Theme.fontFamily | |
| 47 | font.pixelSize: Theme.fontSizeExtraLarge | |
| 48 | ||
| 49 | text: String(invertedIndex) + ":" | |
| 50 | } | |
| 51 | ||
| 52 | Flickable {
| |
| 53 | id: flickable | |
| 54 | ||
| 55 | height: Theme.fontSizeExtraLarge | |
| 56 | width: bg.width - idLabel.width - (dropBtn.visible ? dropBtn.width : 0) | |
| 57 | ||
| 58 | anchors.right: dropBtn.visible ? dropBtn.left : parent.right | |
| 59 | anchors.verticalCenter: parent.verticalCenter | |
| 60 | ||
| 61 | contentHeight: height | |
| 62 | contentWidth: valueLabel.paintedWidth | |
| 63 | ||
| 64 | clip: true | |
| 65 | ||
| 66 | HorizontalScrollDecorator{
| |
| 67 | height: Math.round(Theme.paddingSmall/4) | |
| 68 | ||
| 69 | opacity: 0.5 // always visible | |
| 70 | } | |
| 71 | ||
| 72 | Label {
| |
| 73 | id: valueLabel | |
| 74 | ||
| 75 | //anchors.fill: parent | |
| 76 | - | anchors.fill: parent |
| 76 | + | anchors.right: parent.right |
| 77 | - | //anchors.right: parent.right |
| 77 | + | anchors.verticalCenter: parent.verticalCenter |
| 78 | - | //anchors.verticalCenter: parent.verticalCenter |
| 78 | + | |
| 79 | height: Theme.fontSizeExtraLarge + 10 | |
| 80 | width: bg.width - idLabel.width - (dropBtn.visible ? dropBtn.width : 0) | |
| 81 | ||
| 82 | horizontalAlignment: Text.AlignRight | |
| 83 | verticalAlignment: Text.AlignVCenter | |
| 84 | font.family: Theme.fontFamily | |
| 85 | font.pixelSize: Theme.fontSizeExtraLarge | |
| 86 | ||
| 87 | text: value | |
| 88 | } | |
| 89 | } | |
| 90 | ||
| 91 | IconButton{
| |
| 92 | id: dropBtn | |
| 93 | ||
| 94 | anchors.verticalCenter: parent.verticalCenter | |
| 95 | anchors.right: parent.right | |
| 96 | width: height | |
| 97 | height: Theme.fontSizeExtraLarge + 10 | |
| 98 | ||
| 99 | visible: invertedIndex == 1 ? true : false | |
| 100 | ||
| 101 | icon.source: "image://Theme/icon-l-backspace" | |
| 102 | ||
| 103 | onClicked: {
| |
| 104 | stackDropFirst(); | |
| 105 | /* | |
| 106 | if(settings.vibration()){
| |
| 107 | vibration.start(); | |
| 108 | } | |
| 109 | */ | |
| 110 | } | |
| 111 | onPressAndHold: {
| |
| 112 | stackDropAll(); | |
| 113 | /* | |
| 114 | if(settings.vibration()){
| |
| 115 | longVibration.start(); | |
| 116 | } | |
| 117 | */ | |
| 118 | } | |
| 119 | } | |
| 120 | } | |
| 121 | ||
| 122 | } | |
| 123 | } |