From 3c862c34b21fc0b671fe2d8d5a511807243ff85b Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Thu, 20 Jul 2017 21:15:00 +0100 Subject: [PATCH 01/15] disable reload default scripts by default --- .../qml/hifi/dialogs/TabletRunningScripts.qml | 48 +++++++++++++++++-- .../qml/styles-uit/HifiConstants.qml | 1 + interface/src/Menu.cpp | 6 +-- interface/src/ui/overlays/Web3DOverlay.cpp | 2 + 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index 11643ae1f1..7803e95bac 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -16,6 +16,7 @@ import Qt.labs.settings 1.0 import "../../styles-uit" import "../../controls-uit" as HifiControls import "../../windows" +import "../" Rectangle { id: root @@ -26,10 +27,26 @@ Rectangle { property var scripts: ScriptDiscoveryService; property var scriptsModel: scripts.scriptsModelFilter property var runningScriptsModel: ListModel { } + property bool developerMenuEnabled: false property bool isHMD: false color: hifi.colors.baseGray + + LetterboxMessage { + id: letterBoxMessage + z: 999 + visible: false + } + + function letterBox(glyph, text, message) { + letterBoxMessage.headerGlyph = glyph; + letterBoxMessage.headerText = text; + letterBoxMessage.text = message; + letterBoxMessage.visible = true; + letterBoxMessage.popupRadius = 0; + } + Connections { target: ScriptDiscoveryService onScriptCountChanged: updateRunningScripts(); @@ -38,6 +55,7 @@ Rectangle { Component.onCompleted: { isHMD = HMD.active; updateRunningScripts(); + developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); } function updateRunningScripts() { @@ -78,6 +96,14 @@ Rectangle { scripts.stopAllScripts(); } + function canEditScript(script) { + if ((script === "controllerScripts.js") || (script === "defaultScripts.js")) { + return developerMenuEnabled; + } + + return true; + } + Flickable { id: flickable width: tabletRoot.width @@ -125,6 +151,7 @@ Rectangle { expandSelectedRow: true itemDelegate: Item { + property bool canEdit: canEditScript(styleData.value); anchors { left: parent ? parent.left : undefined leftMargin: hifi.dimensions.tablePadding @@ -148,7 +175,7 @@ Rectangle { HiFiGlyphs { id: reloadButton - text: hifi.glyphs.reloadSmall + text: ((canEditScript(styleData.value)) ? hifi.glyphs.reloadSmall : hifi.glyphs.lock) color: reloadButtonArea.pressed ? hifi.colors.white : parent.color anchors { top: parent.top @@ -158,7 +185,17 @@ Rectangle { MouseArea { id: reloadButtonArea anchors { fill: parent; margins: -2 } - onClicked: reloadScript(model.url) + onClicked: { + if (canEdit) { + reloadScript(model.url) + } else { + letterBox(hifi.glyphs.lock, + "Need Developer Mode On", + "In order to edit, delete or reload this script," + + " turn on Developer Mode by going to:" + + " Menu > Settings > Developer Menus"); + } + } } } @@ -166,6 +203,7 @@ Rectangle { id: stopButton text: hifi.glyphs.closeSmall color: stopButtonArea.pressed ? hifi.colors.white : parent.color + visible: canEditScript(styleData.value) anchors { top: parent.top right: parent.right @@ -174,7 +212,11 @@ Rectangle { MouseArea { id: stopButtonArea anchors { fill: parent; margins: -2 } - onClicked: stopScript(model.url) + onClicked: { + if (canEdit) { + stopScript(model.url) + } + } } } diff --git a/interface/resources/qml/styles-uit/HifiConstants.qml b/interface/resources/qml/styles-uit/HifiConstants.qml index 1556a9c0c0..4a26d11128 100644 --- a/interface/resources/qml/styles-uit/HifiConstants.qml +++ b/interface/resources/qml/styles-uit/HifiConstants.qml @@ -337,5 +337,6 @@ Item { readonly property string playback_play: "\ue01d" readonly property string stop_square: "\ue01e" readonly property string avatarTPose: "\ue01f" + readonly property string lock: "\ue006" } } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index c7223be208..1907b0437a 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -98,10 +98,10 @@ Menu::Menu() { // Edit > Running Scripts auto action = addActionToQMenuAndActionHash(editMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J); connect(action, &QAction::triggered, [] { - static const QUrl widgetUrl("hifi/dialogs/RunningScripts.qml"); static const QUrl tabletUrl("../../hifi/dialogs/TabletRunningScripts.qml"); - static const QString name("RunningScripts"); - qApp->showDialog(widgetUrl, tabletUrl, name); + auto tabletScriptingInterface = DependencyManager::get(); + TabletProxy* tablet = tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"); + tablet->pushOntoStack(tabletUrl); }); // Edit > Open and Run Script from File... [advanced] diff --git a/interface/src/ui/overlays/Web3DOverlay.cpp b/interface/src/ui/overlays/Web3DOverlay.cpp index acba15d2ec..c8e2d3bc63 100644 --- a/interface/src/ui/overlays/Web3DOverlay.cpp +++ b/interface/src/ui/overlays/Web3DOverlay.cpp @@ -38,6 +38,7 @@ #include "scripting/AccountScriptingInterface.h" #include "scripting/HMDScriptingInterface.h" #include "scripting/AssetMappingsScriptingInterface.h" +#include "scripting/MenuScriptingInterface.h" #include #include #include "FileDialogHelper.h" @@ -203,6 +204,7 @@ void Web3DOverlay::loadSourceURL() { _webSurface->getSurfaceContext()->setContextProperty("DialogsManager", DialogsManagerScriptingInterface::getInstance()); _webSurface->getSurfaceContext()->setContextProperty("InputConfiguration", DependencyManager::get().data()); _webSurface->getSurfaceContext()->setContextProperty("SoundCache", DependencyManager::get().data()); + _webSurface->getSurfaceContext()->setContextProperty("MenuInterface", MenuScriptingInterface::getInstance()); _webSurface->getSurfaceContext()->setContextProperty("pathToFonts", "../../"); tabletScriptingInterface->setQmlTabletRoot("com.highfidelity.interface.tablet.system", _webSurface.data()); From e2359f6bb9ed93a9d087989cd9fcc7e3da818d99 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 21 Jul 2017 17:15:31 +0100 Subject: [PATCH 02/15] changes api call --- interface/src/Menu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 1907b0437a..71a681fcc9 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -101,7 +101,7 @@ Menu::Menu() { static const QUrl tabletUrl("../../hifi/dialogs/TabletRunningScripts.qml"); auto tabletScriptingInterface = DependencyManager::get(); TabletProxy* tablet = tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"); - tablet->pushOntoStack(tabletUrl); + tablet->loadQMLSource(tabletUrl); }); // Edit > Open and Run Script from File... [advanced] From 7bf3f45e39705e3a1ca1e7404645ca5ba9bfd034 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 21 Jul 2017 23:32:25 +0100 Subject: [PATCH 03/15] finished the locked default scripts --- .../qml/hifi/DesktopLetterboxMessage.qml | 161 ++++++++++++++++++ .../qml/hifi/dialogs/RunningScripts.qml | 83 ++++++++- .../qml/hifi/dialogs/TabletRunningScripts.qml | 80 ++++++++- interface/src/Menu.cpp | 6 +- 4 files changed, 313 insertions(+), 17 deletions(-) create mode 100644 interface/resources/qml/hifi/DesktopLetterboxMessage.qml diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml new file mode 100644 index 0000000000..750cc38247 --- /dev/null +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -0,0 +1,161 @@ +// +// LetterboxMessage.qml +// qml/hifi +// +// Created by Dante Ruiz on 7/21/2017 +// Copyright 2017 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +import QtQuick 2.5 +import QtQuick.Controls 1.4 +import "../styles-uit" + +Item { + property alias text: popupText.text + property alias headerGlyph: headerGlyph.text + property alias headerText: headerText.text + property real popupRadius: hifi.dimensions.borderRadius + property real headerTextPixelSize: 22 + property real popupTextPixelSize: 16 + property bool isDesktop: false + FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } + FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } + visible: false + id: letterbox + anchors.fill: parent + Rectangle { + anchors.fill: parent + color: "black" + opacity: 0.5 + radius: popupRadius + } + Rectangle { + id: textContainer; + width: parent.width * 0.8 + height: contentContainer.height + 50 + anchors.centerIn: parent + radius: popupRadius + color: "white" + Item { + id: contentContainer + width: parent.width - 50 + height: childrenRect.height + anchors.centerIn: parent + Item { + id: popupHeaderContainer + visible: headerText.text !== "" || headerGlyph.text !== "" + height: 30 + // Anchors + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + // Header Glyph + HiFiGlyphs { + id: headerGlyph + visible: headerGlyph.text !== "" + // Size + height: parent.height + // Anchors + anchors.left: parent.left + anchors.leftMargin: -15 + // Text Size + size: headerTextPixelSize*2.5 + // Style + horizontalAlignment: Text.AlignHLeft + verticalAlignment: Text.AlignVCenter + color: hifi.colors.darkGray + } + // Header Text + Text { + id: headerText + visible: headerText.text !== "" + // Size + + height: parent.height + // Anchors + anchors.left: headerGlyph.right + anchors.leftMargin: -5 + // Text Size + font.pixelSize: headerTextPixelSize + // Style + font.family: ralewaySemiBold.name + color: hifi.colors.darkGray + horizontalAlignment: Text.AlignHLeft + verticalAlignment: Text.AlignVCenter + wrapMode: Text.WordWrap + textFormat: Text.StyledText + } + } + // Popup Text + Text { + id: popupText + // Size + width: parent.width + // Anchors + anchors.top: popupHeaderContainer.visible ? popupHeaderContainer.bottom : parent.top + anchors.topMargin: popupHeaderContainer.visible ? 15 : 0 + anchors.left: parent.left + anchors.right: parent.right + // Text alignment + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHLeft + // Style + font.pixelSize: popupTextPixelSize + font.family: ralewayRegular.name + color: hifi.colors.darkGray + wrapMode: Text.WordWrap + textFormat: Text.StyledText + onLinkActivated: { + Qt.openUrlExternally(link) + } + } + } + } + // Left gray MouseArea + MouseArea { + anchors.left: parent.left; + anchors.right: textContainer.left; + anchors.top: textContainer.top; + anchors.bottom: textContainer.bottom; + acceptedButtons: Qt.LeftButton + onClicked: { + letterbox.visible = false + } + } + // Right gray MouseArea + MouseArea { + anchors.left: textContainer.left; + anchors.right: parent.left; + anchors.top: textContainer.top; + anchors.bottom: textContainer.bottom; + acceptedButtons: Qt.LeftButton + onClicked: { + letterbox.visible = false + } + } + // Top gray MouseArea + MouseArea { + anchors.left: parent.left; + anchors.right: parent.right; + anchors.top: parent.top; + anchors.bottom: textContainer.top; + acceptedButtons: Qt.LeftButton + onClicked: { + letterbox.visible = false + } + } + // Bottom gray MouseArea + MouseArea { + anchors.left: parent.left; + anchors.right: parent.right; + anchors.top: textContainer.bottom; + anchors.bottom: parent.bottom; + acceptedButtons: Qt.LeftButton + onClicked: { + letterbox.visible = false + } + } +} diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index da9ffdb07e..f3d81dafbb 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -16,6 +16,7 @@ import Qt.labs.settings 1.0 import "../../styles-uit" import "../../controls-uit" as HifiControls import "../../windows" +import "../" ScrollingWindow { id: root @@ -28,10 +29,11 @@ ScrollingWindow { minSize: Qt.vector2d(424, 300) HifiConstants { id: hifi } - + property var scripts: ScriptDiscoveryService; property var scriptsModel: scripts.scriptsModelFilter property var runningScriptsModel: ListModel { } + property bool developerMenuEnabled: false property bool isHMD: false Settings { @@ -39,6 +41,25 @@ ScrollingWindow { property alias x: root.x property alias y: root.y } + + Component { + id: letterBoxMessage + Window { + implicitWidth: 424 + implicitHeight: 400 + minSize: Qt.vector2d(424, 300) + DesktopLetterboxMessage { + visible: true + headerGlyph: hifi.glyphs.lock + headerText: "Need Developer Mode On" + text: ( "In order to edit, delete or reload this script," + + " turn on Developer Mode by going to:" + + " Menu > Settings > Developer Menus") + popupRadius: 0 + } + } + } + Timer { id: refreshTimer @@ -47,6 +68,15 @@ ScrollingWindow { running: false onTriggered: updateRunningScripts(); } + + + Timer { + id: checkMenu + interval: 1000 + repeat: true + running: false + onTriggered: developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + } Component { id: listModelBuilder @@ -64,6 +94,8 @@ ScrollingWindow { Component.onCompleted: { isHMD = HMD.active; updateRunningScripts(); + developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + checkMenu.restart(); } function updateRunningScripts() { @@ -110,7 +142,17 @@ ScrollingWindow { function reloadAll() { console.log("Reload all scripts"); - scripts.reloadAllScripts(); + if (!developerMenuEnabled) { + for (var index = 0; index < runningScriptsModel.count; index++) { + var url = runningScriptsModel.get(index).url; + var fileName = url.substring(url.lastIndexOf('/')+1); + if (canEditScript(fileName)) { + scripts.stopScript(url, true); + } + } + } else { + scripts.reloadAllScripts(); + } } function loadDefaults() { @@ -120,7 +162,22 @@ ScrollingWindow { function stopAll() { console.log("Stop all scripts"); - scripts.stopAllScripts(); + for (var index = 0; index < runningScriptsModel.count; index++) { + var url = runningScriptsModel.get(index).url; + var fileName = url.substring(url.lastIndexOf('/')+1); + if (canEditScript(fileName)) { + scripts.stopScript(url); + } + } + } + + + function canEditScript(script) { + if ((script === "controllerScripts.js") || (script === "defaultScripts.js")) { + return developerMenuEnabled; + } + + return true; } Column { @@ -162,6 +219,7 @@ ScrollingWindow { expandSelectedRow: true itemDelegate: Item { + property bool canEdit: canEditScript(styleData.value); anchors { left: parent ? parent.left : undefined leftMargin: hifi.dimensions.tablePadding @@ -185,8 +243,9 @@ ScrollingWindow { HiFiGlyphs { id: reloadButton - text: hifi.glyphs.reloadSmall + text: ((canEditScript(styleData.value)) ? hifi.glyphs.reload : hifi.glyphs.lock) color: reloadButtonArea.pressed ? hifi.colors.white : parent.color + size: 21 anchors { top: parent.top right: stopButton.left @@ -195,7 +254,13 @@ ScrollingWindow { MouseArea { id: reloadButtonArea anchors { fill: parent; margins: -2 } - onClicked: reloadScript(model.url) + onClicked: { + if (canEdit) { + reloadScript(model.url) + } else { + letterBoxMessage.createObject(desktop) + } + } } } @@ -203,6 +268,7 @@ ScrollingWindow { id: stopButton text: hifi.glyphs.closeSmall color: stopButtonArea.pressed ? hifi.colors.white : parent.color + visible: canEditScript(styleData.value) anchors { top: parent.top right: parent.right @@ -211,7 +277,11 @@ ScrollingWindow { MouseArea { id: stopButtonArea anchors { fill: parent; margins: -2 } - onClicked: stopScript(model.url) + onClicked: { + if (canEdit) { + stopScript(model.url); + } + } } } @@ -269,6 +339,7 @@ ScrollingWindow { text: "Load Defaults" color: hifi.buttons.black height: 26 + visible: root.developerMenuEnabled; onClicked: loadDefaults() } } diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index 7803e95bac..73fdd17627 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -47,23 +47,67 @@ Rectangle { letterBoxMessage.popupRadius = 0; } + Timer { + id: refreshTimer + interval: 100 + repeat: false + running: false + onTriggered: updateRunningScripts(); + } + + Timer { + id: checkMenu + interval: 1000 + repeat: true + running: false + onTriggered: developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + } + + Component { + id: listModelBuilder + ListModel {} + } + Connections { target: ScriptDiscoveryService - onScriptCountChanged: updateRunningScripts(); + onScriptCountChanged: { + runningScriptsModel = listModelBuilder.createObject(root); + refreshTimer.restart(); + } } Component.onCompleted: { isHMD = HMD.active; updateRunningScripts(); developerMenuEnabled = MenuInterface.isMenuEnabled("Developer Menus"); + checkMenu.restart(); } function updateRunningScripts() { - var runningScripts = ScriptDiscoveryService.getRunning(); - runningScriptsModel.clear() - for (var i = 0; i < runningScripts.length; ++i) { - runningScriptsModel.append(runningScripts[i]); + function simplify(path) { + // trim URI querystring/fragment + path = (path+'').replace(/[#?].*$/,''); + // normalize separators and grab last path segment (ie: just the filename) + path = path.replace(/\\/g, '/').split('/').pop(); + // return lowercased because we want to sort mnemonically + return path.toLowerCase(); } + var runningScripts = ScriptDiscoveryService.getRunning(); + runningScripts.sort(function(a,b) { + a = simplify(a.path); + b = simplify(b.path); + return a < b ? -1 : a > b ? 1 : 0; + }); + // Calling `runningScriptsModel.clear()` here instead of creating a new object + // triggers some kind of weird heap corruption deep inside Qt. So instead of + // modifying the model in place, possibly triggering behaviors in the table + // instead we create a new `ListModel`, populate it and update the + // existing model atomically. + var newRunningScriptsModel = listModelBuilder.createObject(root); + for (var i = 0; i < runningScripts.length; ++i) { + newRunningScriptsModel.append(runningScripts[i]); + } + runningScriptsModel = newRunningScriptsModel; } function loadScript(script) { @@ -72,6 +116,7 @@ Rectangle { } function reloadScript(script) { + console.log(script); console.log("Reload script " + script); scripts.stopScript(script, true); } @@ -83,7 +128,17 @@ Rectangle { function reloadAll() { console.log("Reload all scripts"); - scripts.reloadAllScripts(); + if (!developerMenuEnabled) { + for (var index = 0; index < runningScriptsModel.count; index++) { + var url = runningScriptsModel.get(index).url; + var fileName = url.substring(url.lastIndexOf('/')+1); + if (canEditScript(fileName)) { + scripts.stopScript(url, true); + } + } + } else { + scripts.reloadAllScripts(); + } } function loadDefaults() { @@ -93,7 +148,14 @@ Rectangle { function stopAll() { console.log("Stop all scripts"); - scripts.stopAllScripts(); + for (var index = 0; index < runningScriptsModel.count; index++) { + var url = runningScriptsModel.get(index).url; + console.log(url); + var fileName = url.substring(url.lastIndexOf('/')+1); + if (canEditScript(fileName)) { + scripts.stopScript(url); + } + } } function canEditScript(script) { @@ -175,8 +237,9 @@ Rectangle { HiFiGlyphs { id: reloadButton - text: ((canEditScript(styleData.value)) ? hifi.glyphs.reloadSmall : hifi.glyphs.lock) + text: ((canEditScript(styleData.value)) ? hifi.glyphs.reload : hifi.glyphs.lock) color: reloadButtonArea.pressed ? hifi.colors.white : parent.color + size: 21 anchors { top: parent.top right: stopButton.left @@ -297,6 +360,7 @@ Rectangle { text: "Load Defaults" color: hifi.buttons.black height: 26 + visible: root.developerMenuEnabled; onClicked: loadDefaults() } } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 71a681fcc9..c7223be208 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -98,10 +98,10 @@ Menu::Menu() { // Edit > Running Scripts auto action = addActionToQMenuAndActionHash(editMenu, MenuOption::RunningScripts, Qt::CTRL | Qt::Key_J); connect(action, &QAction::triggered, [] { + static const QUrl widgetUrl("hifi/dialogs/RunningScripts.qml"); static const QUrl tabletUrl("../../hifi/dialogs/TabletRunningScripts.qml"); - auto tabletScriptingInterface = DependencyManager::get(); - TabletProxy* tablet = tabletScriptingInterface->getTablet("com.highfidelity.interface.tablet.system"); - tablet->loadQMLSource(tabletUrl); + static const QString name("RunningScripts"); + qApp->showDialog(widgetUrl, tabletUrl, name); }); // Edit > Open and Run Script from File... [advanced] From 95299244cff15e8e418603f46a0e274eaf2d9351 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Sat, 22 Jul 2017 00:24:24 +0100 Subject: [PATCH 04/15] fixed running scripts popup --- .../resources/qml/hifi/DesktopLetterboxMessage.qml | 10 ++-------- .../resources/qml/hifi/dialogs/RunningScripts.qml | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml index 750cc38247..917f8a0a5b 100644 --- a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -26,16 +26,10 @@ Item { visible: false id: letterbox anchors.fill: parent - Rectangle { - anchors.fill: parent - color: "black" - opacity: 0.5 - radius: popupRadius - } Rectangle { id: textContainer; - width: parent.width * 0.8 - height: contentContainer.height + 50 + width: parent.width + height: parent.height anchors.centerIn: parent radius: popupRadius color: "white" diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index f3d81dafbb..f97d202b69 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -45,8 +45,8 @@ ScrollingWindow { Component { id: letterBoxMessage Window { - implicitWidth: 424 - implicitHeight: 400 + implicitWidth: 400 + implicitHeight: 300 minSize: Qt.vector2d(424, 300) DesktopLetterboxMessage { visible: true From 1e1ddf294154d80eec082a44bf30562f5edc303c Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Wed, 2 Aug 2017 22:22:55 +0100 Subject: [PATCH 05/15] making requested changes --- .../qml/hifi/DesktopLetterboxMessage.qml | 4 +++- .../resources/qml/hifi/LetterboxMessage.qml | 4 +++- .../qml/hifi/dialogs/RunningScripts.qml | 20 ++++++++++--------- .../qml/hifi/dialogs/TabletRunningScripts.qml | 20 ++++++++++--------- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml index 917f8a0a5b..9c8e24e95a 100644 --- a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -17,9 +17,11 @@ Item { property alias text: popupText.text property alias headerGlyph: headerGlyph.text property alias headerText: headerText.text + property alias headerGlyphSize: headerGlyph.size property real popupRadius: hifi.dimensions.borderRadius property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 + property real headerTextMargin: -5 property bool isDesktop: false FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } @@ -71,7 +73,7 @@ Item { height: parent.height // Anchors anchors.left: headerGlyph.right - anchors.leftMargin: -5 + anchors.leftMargin: headerTextMargin // Text Size font.pixelSize: headerTextPixelSize // Style diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index fa9d7aa6f0..5c8ad4ee7f 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -17,9 +17,11 @@ Item { property alias text: popupText.text property alias headerGlyph: headerGlyph.text property alias headerText: headerText.text + property alias headerGlyphSize: headerGlyph.size property real popupRadius: hifi.dimensions.borderRadius property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 + property real headerTextMargin: -5 FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } visible: false @@ -75,7 +77,7 @@ Item { height: parent.height // Anchors anchors.left: headerGlyph.right - anchors.leftMargin: -5 + anchors.leftMargin: headerTextMargin // Text Size font.pixelSize: headerTextPixelSize // Style diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index f97d202b69..cc6ace639d 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -51,11 +51,13 @@ ScrollingWindow { DesktopLetterboxMessage { visible: true headerGlyph: hifi.glyphs.lock - headerText: "Need Developer Mode On" + headerText: "Developer Mode Only" text: ( "In order to edit, delete or reload this script," + " turn on Developer Mode by going to:" + " Menu > Settings > Developer Menus") popupRadius: 0 + headerGlyphSize: 20 + headerTextMargin: 2 } } } @@ -203,6 +205,14 @@ ScrollingWindow { color: hifi.buttons.red onClicked: stopAll() } + + HifiControls.Button { + text: "Load Defaults" + color: hifi.buttons.black + height: 26 + visible: root.developerMenuEnabled; + onClicked: loadDefaults() + } } HifiControls.VerticalSpacer { @@ -334,14 +344,6 @@ ScrollingWindow { height: 26 onClickedQueued: ApplicationInterface.loadDialog() } - - HifiControls.Button { - text: "Load Defaults" - color: hifi.buttons.black - height: 26 - visible: root.developerMenuEnabled; - onClicked: loadDefaults() - } } HifiControls.VerticalSpacer {} diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index 73fdd17627..cce4ce198f 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -45,6 +45,8 @@ Rectangle { letterBoxMessage.text = message; letterBoxMessage.visible = true; letterBoxMessage.popupRadius = 0; + letterBoxMessage.headerGlyphSize = 20 + letterBoxMessage.headerTextMargin = 2 } Timer { @@ -198,6 +200,14 @@ Rectangle { color: hifi.buttons.red onClicked: stopAll() } + + HifiControls.Button { + text: "Load Defaults" + color: hifi.buttons.black + height: 26 + visible: root.developerMenuEnabled; + onClicked: loadDefaults() + } } HifiControls.VerticalSpacer { @@ -253,7 +263,7 @@ Rectangle { reloadScript(model.url) } else { letterBox(hifi.glyphs.lock, - "Need Developer Mode On", + "Developer Mode Only", "In order to edit, delete or reload this script," + " turn on Developer Mode by going to:" + " Menu > Settings > Developer Menus"); @@ -355,14 +365,6 @@ Rectangle { onTriggered: ApplicationInterface.loadDialog(); } } - - HifiControls.Button { - text: "Load Defaults" - color: hifi.buttons.black - height: 26 - visible: root.developerMenuEnabled; - onClicked: loadDefaults() - } } HifiControls.VerticalSpacer {} From 9be60ee6584e4479ca31f80ef8f42abad0f7bfd7 Mon Sep 17 00:00:00 2001 From: Dante Ruiz Date: Fri, 4 Aug 2017 17:57:53 +0100 Subject: [PATCH 06/15] made more requested changes --- interface/resources/qml/hifi/DesktopLetterboxMessage.qml | 3 ++- interface/resources/qml/hifi/LetterboxMessage.qml | 3 ++- interface/resources/qml/hifi/dialogs/RunningScripts.qml | 3 ++- interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml index 9c8e24e95a..bafa518eb9 100644 --- a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -22,6 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 + property real headerGlyphMargin: -15 property bool isDesktop: false FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } @@ -56,7 +57,7 @@ Item { height: parent.height // Anchors anchors.left: parent.left - anchors.leftMargin: -15 + anchors.leftMargin: headerGlyphMargin // Text Size size: headerTextPixelSize*2.5 // Style diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index 5c8ad4ee7f..6f41154d4d 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -22,6 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 + property real headerGlyphMargin: -15 FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } visible: false @@ -61,7 +62,7 @@ Item { height: parent.height // Anchors anchors.left: parent.left - anchors.leftMargin: -15 + anchors.leftMargin: headerGlyphMargin // Text Size size: headerTextPixelSize*2.5 // Style diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index cc6ace639d..4e598ca1be 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -51,13 +51,14 @@ ScrollingWindow { DesktopLetterboxMessage { visible: true headerGlyph: hifi.glyphs.lock - headerText: "Developer Mode Only" + headerText: "Developer Mode only" text: ( "In order to edit, delete or reload this script," + " turn on Developer Mode by going to:" + " Menu > Settings > Developer Menus") popupRadius: 0 headerGlyphSize: 20 headerTextMargin: 2 + headerGlyphMargin: 0 } } } diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index cce4ce198f..dda8e6c596 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -47,6 +47,7 @@ Rectangle { letterBoxMessage.popupRadius = 0; letterBoxMessage.headerGlyphSize = 20 letterBoxMessage.headerTextMargin = 2 + letterBoxMessage.headerGlyphMargin = 0 } Timer { @@ -263,7 +264,7 @@ Rectangle { reloadScript(model.url) } else { letterBox(hifi.glyphs.lock, - "Developer Mode Only", + "Developer Mode only", "In order to edit, delete or reload this script," + " turn on Developer Mode by going to:" + " Menu > Settings > Developer Menus"); From 7aad4af533f25a617285724b7e57688386eb8186 Mon Sep 17 00:00:00 2001 From: mukulHF Date: Fri, 4 Aug 2017 17:44:16 -0700 Subject: [PATCH 07/15] Update LetterboxMessage.qml --- interface/resources/qml/hifi/LetterboxMessage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index 6f41154d4d..6e091e7239 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -22,7 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 - property real headerGlyphMargin: -15 + property real headerGlyphMargin: -13 FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } visible: false From 1ce1e29368639128a627ed6f6fce6b12b5450fc9 Mon Sep 17 00:00:00 2001 From: mukulHF Date: Fri, 4 Aug 2017 17:44:43 -0700 Subject: [PATCH 08/15] Update DesktopLetterboxMessage.qml --- interface/resources/qml/hifi/DesktopLetterboxMessage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml index bafa518eb9..1242c18c8f 100644 --- a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -22,7 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 - property real headerGlyphMargin: -15 + property real headerGlyphMargin: -13 property bool isDesktop: false FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } From 4382f22622ad73fc8a4370a02137b73aa8b581cc Mon Sep 17 00:00:00 2001 From: mukulHF Date: Mon, 7 Aug 2017 10:01:26 -0700 Subject: [PATCH 09/15] Update DesktopLetterboxMessage.qml --- interface/resources/qml/hifi/DesktopLetterboxMessage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml index 1242c18c8f..841e4a631f 100644 --- a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -22,7 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 - property real headerGlyphMargin: -13 + property real headerGlyphMargin: -10 property bool isDesktop: false FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } From e9f268ff26fe9cde21b0031038f95e7b4ecd7706 Mon Sep 17 00:00:00 2001 From: mukulHF Date: Mon, 7 Aug 2017 10:01:50 -0700 Subject: [PATCH 10/15] Update LetterboxMessage.qml --- interface/resources/qml/hifi/LetterboxMessage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index 6e091e7239..565882ea75 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -22,7 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 - property real headerGlyphMargin: -13 + property real headerGlyphMargin: -10 FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } visible: false From 3ca2bc057159f45307b9db47e7bb11eb352b8fa6 Mon Sep 17 00:00:00 2001 From: mukulHF Date: Mon, 7 Aug 2017 11:35:27 -0700 Subject: [PATCH 11/15] Update DesktopLetterboxMessage.qml --- interface/resources/qml/hifi/DesktopLetterboxMessage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml index 841e4a631f..bafa518eb9 100644 --- a/interface/resources/qml/hifi/DesktopLetterboxMessage.qml +++ b/interface/resources/qml/hifi/DesktopLetterboxMessage.qml @@ -22,7 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 - property real headerGlyphMargin: -10 + property real headerGlyphMargin: -15 property bool isDesktop: false FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } From cf7b2ba5478de578b612eaea3c26b5c5dadf350c Mon Sep 17 00:00:00 2001 From: mukulHF Date: Mon, 7 Aug 2017 11:35:42 -0700 Subject: [PATCH 12/15] Update LetterboxMessage.qml --- interface/resources/qml/hifi/LetterboxMessage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/LetterboxMessage.qml b/interface/resources/qml/hifi/LetterboxMessage.qml index 565882ea75..6f41154d4d 100644 --- a/interface/resources/qml/hifi/LetterboxMessage.qml +++ b/interface/resources/qml/hifi/LetterboxMessage.qml @@ -22,7 +22,7 @@ Item { property real headerTextPixelSize: 22 property real popupTextPixelSize: 16 property real headerTextMargin: -5 - property real headerGlyphMargin: -10 + property real headerGlyphMargin: -15 FontLoader { id: ralewayRegular; source: "../../fonts/Raleway-Regular.ttf"; } FontLoader { id: ralewaySemiBold; source: "../../fonts/Raleway-SemiBold.ttf"; } visible: false From fadc19d8bbb4983fe308a9b7684d135fbc3a7fc5 Mon Sep 17 00:00:00 2001 From: mukulHF Date: Mon, 7 Aug 2017 11:36:37 -0700 Subject: [PATCH 13/15] Update RunningScripts.qml --- interface/resources/qml/hifi/dialogs/RunningScripts.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/dialogs/RunningScripts.qml b/interface/resources/qml/hifi/dialogs/RunningScripts.qml index 4e598ca1be..952cc03733 100644 --- a/interface/resources/qml/hifi/dialogs/RunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/RunningScripts.qml @@ -58,7 +58,7 @@ ScrollingWindow { popupRadius: 0 headerGlyphSize: 20 headerTextMargin: 2 - headerGlyphMargin: 0 + headerGlyphMargin: -3 } } } From 780644fa380850bdeab269426555aab3207e1c8c Mon Sep 17 00:00:00 2001 From: mukulHF Date: Mon, 7 Aug 2017 11:37:27 -0700 Subject: [PATCH 14/15] Update TabletRunningScripts.qml --- interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index dda8e6c596..b79be4436d 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -47,7 +47,7 @@ Rectangle { letterBoxMessage.popupRadius = 0; letterBoxMessage.headerGlyphSize = 20 letterBoxMessage.headerTextMargin = 2 - letterBoxMessage.headerGlyphMargin = 0 + letterBoxMessage.headerGlyphMargin = -3 } Timer { From 005c5a92785bf844b0373fba2d2c219cba59dcaa Mon Sep 17 00:00:00 2001 From: druiz17 Date: Thu, 10 Aug 2017 12:26:57 -0700 Subject: [PATCH 15/15] Update TabletRunningScripts.qml --- interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml index b79be4436d..5677cc92a1 100644 --- a/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml +++ b/interface/resources/qml/hifi/dialogs/TabletRunningScripts.qml @@ -119,7 +119,6 @@ Rectangle { } function reloadScript(script) { - console.log(script); console.log("Reload script " + script); scripts.stopScript(script, true); }