overte/interface/resources/qml/hifi/toolbars/StateImage.qml
Anthony J. Thibault 4503923665 Initial version of TabletProxy.toolbarMode boolean
Copies all tablet buttons between the tablet and the system toolbar.

To test type this in the console:

    Tablet.getTablet("com.highfidelity.interface.tablet.system").toolbarMode = true;
2017-02-14 15:36:03 -08:00

35 lines
803 B
QML

import QtQuick 2.5
import QtQuick.Controls 1.4
Item {
property alias imageURL: image.source
property alias alpha: image.opacity
property var subImage;
property int yOffset: 0
property int buttonState: 1
property real size: 50
width: size; height: size
property bool pinned: false
clip: true
function updateYOffset() { yOffset = size * buttonState; }
onButtonStateChanged: updateYOffset();
Component.onCompleted: {
if (subImage) {
if (subImage.y) {
yOffset = subImage.y;
return;
}
}
updateYOffset();
}
Image {
id: image
y: -parent.yOffset;
width: parent.width
source: "../../../icons/tablet-icons/empty-toolbar-button.svg"
}
}