From 75f6ad3b9927db9688ec5bcbfa9f0af551c6df88 Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Wed, 29 Apr 2015 00:43:18 -0700 Subject: [PATCH] Working on menus look --- interface/resources/qml/VrMenu.qml | 21 ++++++++++++--------- tests/ui/src/main.cpp | 17 ++++++----------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/interface/resources/qml/VrMenu.qml b/interface/resources/qml/VrMenu.qml index d81d79aa0b..87629e06aa 100644 --- a/interface/resources/qml/VrMenu.qml +++ b/interface/resources/qml/VrMenu.qml @@ -121,6 +121,9 @@ Hifi.VrMenu { property var root property var listView property var border + + + implicitHeight: row.implicitHeight + 4 implicitWidth: row.implicitWidth + label.height // FIXME uncommenting this line results in menus that have blank spots @@ -137,8 +140,7 @@ Hifi.VrMenu { FontAwesome { id: check verticalAlignment: Text.AlignVCenter - y: 2 - size: label.height + size: row.height text: checkText() color: label.color function checkText() { @@ -156,7 +158,10 @@ Hifi.VrMenu { } Text { id: label +// anchors.top: parent.top +// anchors.bottom: parent.bottom text: typedText() + verticalAlignment: Text.AlignVCenter color: source.enabled ? hifi.colors.text : hifi.colors.disabledText enabled: source.enabled && source.visible function typedText() { @@ -189,13 +194,11 @@ Hifi.VrMenu { } MouseArea { - anchors { - top: parent.top - bottom: parent.bottom - left: parent.left - right: tag.right - rightMargin: -4 - } + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: tag.right + anchors.left: parent.left + anchors.rightMargin: -4 acceptedButtons: Qt.LeftButton hoverEnabled: true Rectangle { diff --git a/tests/ui/src/main.cpp b/tests/ui/src/main.cpp index a5bc50b288..7c4d998e47 100644 --- a/tests/ui/src/main.cpp +++ b/tests/ui/src/main.cpp @@ -36,6 +36,7 @@ #include "MessageDialog.h" #include "VrMenu.h" +#include class RateCounter { std::vector times; @@ -339,8 +340,10 @@ public: makeCurrent(); offscreenUi->setProxyWindow(this); - setFramePosition(QPoint(-1000, 0)); - resize(QSize(800, 600)); + QDesktopWidget* desktop = QApplication::desktop(); + setGeometry(desktop->availableGeometry(desktop->screenCount()-1)); +// setFramePosition(QPoint(-1000, 0)); +// resize(QSize(800, 600)); #ifdef QML_CONTROL_GALLERY offscreenUi->setBaseUrl(QUrl::fromLocalFile(getTestQmlDir())); @@ -474,16 +477,8 @@ hifi.offscreen.focus.debug=false qt.quick.mouse.debug=false )V0G0N"; -//int main(int argc, char *argv[]) { -// QGuiApplication app(argc, argv); -// QQmlApplicationEngine engine; -// engine.setBaseUrl(QUrl::fromLocalFile(getQmlDir())); -// engine.load(QUrl("Main.qml")); -// return app.exec(); -//} - int main(int argc, char** argv) { - QGuiApplication app(argc, argv); + QApplication app(argc, argv); QLoggingCategory::setFilterRules(LOG_FILTER_RULES); QTestWindow window; app.exec();