Guest User

Untitled

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