Advertisement
Guest User

Untitled

a guest
Nov 29th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 0.78 KB | None | 0 0
  1. Rectangle {
  2.             id: positionSlider
  3.             x: 100
  4.             y: 100
  5.             width: 200
  6.             height: 10
  7.             color: "#333333"
  8.             radius: 5
  9.             property real position: 0.33
  10.             property real bufferized: 0.66
  11.             MouseArea {
  12.                 anchors.fill: parent
  13.                 onPressed: {
  14.                     parent.position = mouseX / parent.width
  15.                 }
  16.                 onReleased: {
  17.                     parent.position = mouseX / parent.width
  18.                 }
  19.                 onPositionChanged: {
  20.                     parent.position = mouseX / parent.width
  21.                 }
  22.             }
  23.             Rectangle {
  24.                 width: parent.width * parent.bufferized
  25.                 x: 1
  26.                 y: 1
  27.                 height: 8
  28.                 color: "#777777"
  29.                 radius: 4
  30.                 id: bufferizingSliderValue
  31.             }
  32.             Rectangle {
  33.                 width: parent.width * parent.position
  34.                 x: 1
  35.                 y: 1
  36.                 height: 8
  37.                 color: "#eeeeee"
  38.                 radius: 4
  39.                 id: positionSliderValue
  40.             }
  41.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement