This commit is contained in:
Brad Davis 2016-01-03 20:29:31 -08:00
parent 435ab8c4e8
commit 297e58fbc6
3 changed files with 8 additions and 18 deletions

View file

@ -24,17 +24,11 @@ Hifi.VrMenu {
property var columns: []
onEnabledChanged: {
console.log("Activating menu " + enabled);
if (enabled && columns.length == 0) {
console.log(rootMenu)
console.log(rootMenu.items)
pushColumn(rootMenu.items);
}
opacity = enabled ? 1.0 : 0.0
offscreenFlags.navigationFocused = enabled;
// if (enabled) {
//forceActiveFocus()
// }
}
// The actual animator
@ -67,7 +61,6 @@ Hifi.VrMenu {
x = lastColumn.x + 64;
y = lastMousePosition.y - height / 2;
}
//recalcSize();
}
onSelected: {
@ -112,8 +105,6 @@ Hifi.VrMenu {
function itemsToModel(items) {
var newListModel = Qt.createQmlObject('import QtQuick 2.2; ListModel {}', root);
console.log(items)
console.log(items.length)
for (var i = 0; i < items.length; ++i) {
var item = items[i];
switch (item.type) {

View file

@ -1,19 +1,19 @@
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import "styles"
import "controls"
import "styles"
Item {
id: root
HifiConstants { id: hifi }
HifiConstants {
id: hifi
}
// The model object
property alias text: label.text
property var source
implicitHeight: source.visible ? label.implicitHeight * 1.5 : 0
implicitWidth: label.width + label.height * 2.5
visible: source.visible

View file

@ -9,15 +9,16 @@ ListView {
HifiConstants { id: hifi }
width: 128
height: count * 32
onEnabledChanged: root.recalcSize();
onVisibleChanged: root.recalcSize();
onEnabledChanged: recalcSize();
onVisibleChanged: recalcSize();
onCountChanged: recalcSize();
signal selected(var item)
highlight: Rectangle {
width: root.currentItem ? root.currentItem.width : 0
height: root.currentItem ? root.currentItem.height : 0
color: "lightsteelblue"; radius: 3
// y: root.currentItem ? root.currentItem.y : 0
}
delegate: VrMenuItem {
@ -34,8 +35,6 @@ ListView {
}
}
onCountChanged: recalcSize();
function recalcSize() {
if (model.count !== count || !visible) {
return;