mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 13:11:43 +02:00
Support toolbar API
This commit is contained in:
parent
5bc8b53d1b
commit
ec615caa80
36 changed files with 870 additions and 381 deletions
|
@ -18,7 +18,7 @@ import "controls-uit" as HifiControls
|
||||||
import "windows"
|
import "windows"
|
||||||
import "dialogs"
|
import "dialogs"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
objectName: "AssetServer"
|
objectName: "AssetServer"
|
||||||
title: "Asset Browser"
|
title: "Asset Browser"
|
||||||
|
|
|
@ -6,7 +6,7 @@ import "controls-uit"
|
||||||
import "styles-uit"
|
import "styles-uit"
|
||||||
import "windows"
|
import "windows"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
title: "Browser"
|
title: "Browser"
|
||||||
|
|
|
@ -14,7 +14,7 @@ import Hifi 1.0 as Hifi
|
||||||
import "controls-uit"
|
import "controls-uit"
|
||||||
import "windows" as Windows
|
import "windows" as Windows
|
||||||
|
|
||||||
Windows.Window {
|
Windows.ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
width: 800
|
width: 800
|
||||||
height: 800
|
height: 800
|
||||||
|
|
|
@ -14,7 +14,7 @@ import "controls"
|
||||||
import "styles"
|
import "styles"
|
||||||
import "windows"
|
import "windows"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
objectName: "LoginDialog"
|
objectName: "LoginDialog"
|
||||||
|
|
|
@ -17,7 +17,7 @@ import "windows" as Windows
|
||||||
import "controls-uit" as Controls
|
import "controls-uit" as Controls
|
||||||
import "styles-uit"
|
import "styles-uit"
|
||||||
|
|
||||||
Windows.Window {
|
Windows.ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
title: "WebWindow"
|
title: "WebWindow"
|
||||||
|
|
|
@ -19,7 +19,7 @@ import "windows"
|
||||||
import "controls-uit"
|
import "controls-uit"
|
||||||
import "styles-uit"
|
import "styles-uit"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: toolWindow
|
id: toolWindow
|
||||||
resizable: true
|
resizable: true
|
||||||
objectName: "ToolWindow"
|
objectName: "ToolWindow"
|
||||||
|
|
|
@ -7,7 +7,7 @@ import "controls-uit"
|
||||||
import "styles-uit"
|
import "styles-uit"
|
||||||
import "windows"
|
import "windows"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
objectName: "UpdateDialog"
|
objectName: "UpdateDialog"
|
||||||
|
|
|
@ -16,7 +16,7 @@ import "../styles-uit"
|
||||||
import "../windows"
|
import "../windows"
|
||||||
import "preferences"
|
import "preferences"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
title: "Preferences"
|
title: "Preferences"
|
||||||
resizable: true
|
resizable: true
|
||||||
|
|
|
@ -23,15 +23,10 @@ Windows.Window {
|
||||||
resizable: true
|
resizable: true
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
|
|
||||||
Item {
|
Controls.WebView {
|
||||||
width: pane.contentWidth
|
id: webview
|
||||||
implicitHeight: pane.scrollHeight
|
anchors.fill: parent
|
||||||
|
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
||||||
Controls.WebView {
|
focus: true
|
||||||
id: webview
|
|
||||||
anchors.fill: parent
|
|
||||||
url: "https://metaverse.highfidelity.com/marketplace?category=avatars"
|
|
||||||
focus: true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,12 @@
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtWebEngine 1.1;
|
import QtWebEngine 1.1;
|
||||||
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
import "../desktop"
|
import "../desktop"
|
||||||
import ".."
|
import ".."
|
||||||
import "."
|
import "."
|
||||||
|
import "./toolbars"
|
||||||
|
|
||||||
Desktop {
|
Desktop {
|
||||||
id: desktop
|
id: desktop
|
||||||
|
@ -20,13 +22,6 @@ Desktop {
|
||||||
acceptedButtons: Qt.NoButton
|
acceptedButtons: Qt.NoButton
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
WebEngine.settings.javascriptCanOpenWindows = true;
|
|
||||||
WebEngine.settings.javascriptCanAccessClipboard = false;
|
|
||||||
WebEngine.settings.spatialNavigationEnabled = false;
|
|
||||||
WebEngine.settings.localContentCanAccessRemoteUrls = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// The tool window, one instance
|
// The tool window, one instance
|
||||||
property alias toolWindow: toolWindow
|
property alias toolWindow: toolWindow
|
||||||
ToolWindow { id: toolWindow }
|
ToolWindow { id: toolWindow }
|
||||||
|
@ -49,11 +44,40 @@ Desktop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property var toolbars: ({})
|
||||||
|
Component { id: toolbarBuilder; Toolbar { } }
|
||||||
|
|
||||||
ToggleHudButton {
|
Component.onCompleted: {
|
||||||
anchors.bottom: parent.bottom
|
WebEngine.settings.javascriptCanOpenWindows = true;
|
||||||
anchors.bottomMargin: 32
|
WebEngine.settings.javascriptCanAccessClipboard = false;
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
WebEngine.settings.spatialNavigationEnabled = false;
|
||||||
|
WebEngine.settings.localContentCanAccessRemoteUrls = true;
|
||||||
|
|
||||||
|
var sysToolbar = desktop.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
|
//toolbars[sysToolbar.objectName] = sysToolbar
|
||||||
|
var toggleHudButton = sysToolbar.addButton({
|
||||||
|
imageURL: "../../../icons/hud-01.svg",
|
||||||
|
visible: true,
|
||||||
|
|
||||||
|
});
|
||||||
|
toggleHudButton.yOffset = Qt.binding(function(){
|
||||||
|
return desktop.pinned ? 50 : 0
|
||||||
|
});
|
||||||
|
toggleHudButton.clicked.connect(function(){
|
||||||
|
console.log("Clicked on hud button")
|
||||||
|
var overlayMenuItem = "Overlays"
|
||||||
|
MenuInterface.setIsOptionChecked(overlayMenuItem, !MenuInterface.isOptionChecked(overlayMenuItem));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create or fetch a toolbar with the given name
|
||||||
|
function getToolbar(name) {
|
||||||
|
var result = toolbars[name];
|
||||||
|
if (!result) {
|
||||||
|
result = toolbars[name] = toolbarBuilder.createObject(desktop, {});
|
||||||
|
result.objectName = name;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
import QtQuick 2.5
|
|
||||||
import QtQuick.Controls 1.4
|
|
||||||
|
|
||||||
import "../windows"
|
|
||||||
|
|
||||||
Window {
|
|
||||||
//frame: HiddenFrame {}
|
|
||||||
hideBackground: true
|
|
||||||
resizable: false
|
|
||||||
destroyOnCloseButton: false
|
|
||||||
destroyOnHidden: false
|
|
||||||
closable: false
|
|
||||||
shown: true
|
|
||||||
pinned: true
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
clip: true
|
|
||||||
visible: true
|
|
||||||
// Disable this window from being able to call 'desktop.raise() and desktop.showDesktop'
|
|
||||||
activator: Item {}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: 50
|
|
||||||
height: 50
|
|
||||||
Image {
|
|
||||||
y: desktop.pinned ? -50 : 0
|
|
||||||
id: hudToggleImage
|
|
||||||
source: "../../icons/hud-01.svg"
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
readonly property string overlayMenuItem: "Overlays"
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: MenuInterface.setIsOptionChecked(overlayMenuItem, !MenuInterface.isOptionChecked(overlayMenuItem));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ import "../../controls-uit" as HifiControls
|
||||||
import "../../windows"
|
import "../../windows"
|
||||||
import "attachments"
|
import "attachments"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
title: "Attachments"
|
title: "Attachments"
|
||||||
objectName: "AttachmentsDialog"
|
objectName: "AttachmentsDialog"
|
||||||
|
|
|
@ -11,7 +11,7 @@ import "../../styles-uit"
|
||||||
import "../../controls-uit" as HifiControls
|
import "../../controls-uit" as HifiControls
|
||||||
import "../../windows"
|
import "../../windows"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
resizable: true
|
resizable: true
|
||||||
width: 600
|
width: 600
|
||||||
|
|
|
@ -17,7 +17,7 @@ import "../../styles-uit"
|
||||||
import "../../controls-uit" as HifiControls
|
import "../../controls-uit" as HifiControls
|
||||||
import "../../windows"
|
import "../../windows"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
objectName: "RunningScripts"
|
objectName: "RunningScripts"
|
||||||
title: "Running Scripts"
|
title: "Running Scripts"
|
||||||
|
|
|
@ -7,7 +7,7 @@ import "../../windows"
|
||||||
import "../../js/Utils.js" as Utils
|
import "../../js/Utils.js" as Utils
|
||||||
import "../models"
|
import "../models"
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: root
|
id: root
|
||||||
resizable: true
|
resizable: true
|
||||||
width: 516
|
width: 516
|
||||||
|
|
117
interface/resources/qml/hifi/toolbars/Toolbar.qml
Normal file
117
interface/resources/qml/hifi/toolbars/Toolbar.qml
Normal file
|
@ -0,0 +1,117 @@
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
import Qt.labs.settings 1.0
|
||||||
|
|
||||||
|
import "../../windows"
|
||||||
|
import "."
|
||||||
|
|
||||||
|
Window {
|
||||||
|
id: window
|
||||||
|
frame: ToolFrame { }
|
||||||
|
hideBackground: true
|
||||||
|
resizable: false
|
||||||
|
destroyOnCloseButton: false
|
||||||
|
destroyOnHidden: false
|
||||||
|
closable: false
|
||||||
|
shown: true
|
||||||
|
pinned: true
|
||||||
|
width: content.width
|
||||||
|
height: content.height
|
||||||
|
visible: true
|
||||||
|
// Disable this window from being able to call 'desktop.raise() and desktop.showDesktop'
|
||||||
|
activator: Item {}
|
||||||
|
property bool horizontal: true
|
||||||
|
property real buttonSize: 50;
|
||||||
|
property var buttons: []
|
||||||
|
property var container: horizontal ? row : column
|
||||||
|
|
||||||
|
Settings {
|
||||||
|
category: "toolbar/" + window.objectName
|
||||||
|
property alias x: window.x
|
||||||
|
property alias y: window.y
|
||||||
|
}
|
||||||
|
|
||||||
|
onHorizontalChanged: {
|
||||||
|
var oldParent = horizontal ? column : row;
|
||||||
|
var newParent = horizontal ? row : column;
|
||||||
|
var move = [];
|
||||||
|
|
||||||
|
var i;
|
||||||
|
for (i in oldParent.children) {
|
||||||
|
var child = oldParent.children[i];
|
||||||
|
if (child.spacer) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
move.push(oldParent.children[i]);
|
||||||
|
}
|
||||||
|
for (i in move) {
|
||||||
|
move[i].parent = newParent;
|
||||||
|
if (horizontal) {
|
||||||
|
move[i].y = 0
|
||||||
|
} else {
|
||||||
|
move[i].x = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fixSpacers();
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: content
|
||||||
|
implicitHeight: horizontal ? row.height : column.height
|
||||||
|
implicitWidth: horizontal ? row.width : column.width
|
||||||
|
Row {
|
||||||
|
id: row
|
||||||
|
spacing: 6
|
||||||
|
visible: window.horizontal
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: rowSpacer1; width: 1; height: row.height }
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: rowSpacer2; width: 1; height: row.height }
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: rowSpacer3; width: 1; height: row.height }
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: rowSpacer4; width: 1; height: row.height }
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: column
|
||||||
|
spacing: 6
|
||||||
|
visible: !window.horizontal
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: colSpacer1; width: column.width; height: 1 }
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: colSpacer2; width: column.width; height: 1 }
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: colSpacer3; width: column.width; height: 1 }
|
||||||
|
Rectangle{ readonly property bool spacer: true; id: colSpacer4; width: column.width; height: 1 }
|
||||||
|
}
|
||||||
|
|
||||||
|
Component { id: toolbarButtonBuilder; ToolbarButton { } }
|
||||||
|
}
|
||||||
|
|
||||||
|
function addButton(properties) {
|
||||||
|
properties = properties || {}
|
||||||
|
|
||||||
|
// If a name is specified, then check if there's an existing button with that name
|
||||||
|
// and return it if so. This will allow multiple clients to listen to a single button,
|
||||||
|
// and allow scripts to be idempotent so they don't duplicate buttons if they're reloaded
|
||||||
|
if (properties.objectName) {
|
||||||
|
for (var i in buttons) {
|
||||||
|
var child = buttons[i];
|
||||||
|
if (child.objectName === properties.objectName) {
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
properties.toolbar = this;
|
||||||
|
var result = toolbarButtonBuilder.createObject(container, properties);
|
||||||
|
buttons.push(result);
|
||||||
|
fixSpacers();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
function fixSpacers() {
|
||||||
|
colSpacer3.parent = null
|
||||||
|
colSpacer4.parent = null
|
||||||
|
rowSpacer3.parent = null
|
||||||
|
rowSpacer4.parent = null
|
||||||
|
colSpacer3.parent = column
|
||||||
|
colSpacer4.parent = column
|
||||||
|
rowSpacer3.parent = row
|
||||||
|
rowSpacer4.parent = row
|
||||||
|
}
|
||||||
|
}
|
39
interface/resources/qml/hifi/toolbars/ToolbarButton.qml
Normal file
39
interface/resources/qml/hifi/toolbars/ToolbarButton.qml
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
import QtQuick 2.5
|
||||||
|
import QtQuick.Controls 1.4
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: button
|
||||||
|
property alias imageURL: image.source
|
||||||
|
property alias alpha: button.opacity
|
||||||
|
property var subImage;
|
||||||
|
property int yOffset: 0
|
||||||
|
property var toolbar;
|
||||||
|
property real size: 50 // toolbar ? toolbar.buttonSize : 50
|
||||||
|
width: size; height: size
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (subImage) {
|
||||||
|
if (subImage.y) {
|
||||||
|
yOffset = subImage.y;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signal clicked()
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: image
|
||||||
|
y: -button.yOffset;
|
||||||
|
width: parent.width
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: {
|
||||||
|
console.log("Clicked on button " + image.source + " named " + button.objectName)
|
||||||
|
button.clicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ Item {
|
||||||
border.width: 3
|
border.width: 3
|
||||||
border.color: hifi.colors.white50
|
border.color: hifi.colors.white50
|
||||||
radius: hifi.dimensions.borderRadius
|
radius: hifi.dimensions.borderRadius
|
||||||
visible: window ? !pane.visible : false
|
visible: window ? !window.content.visible : false
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import QtQuick 2.5
|
||||||
|
|
||||||
import "."
|
import "."
|
||||||
|
|
||||||
Window {
|
ScrollingWindow {
|
||||||
id: window
|
id: window
|
||||||
modality: Qt.ApplicationModal
|
modality: Qt.ApplicationModal
|
||||||
destroyOnCloseButton: true
|
destroyOnCloseButton: true
|
||||||
|
|
157
interface/resources/qml/windows/ScrollingWindow.qml
Normal file
157
interface/resources/qml/windows/ScrollingWindow.qml
Normal file
|
@ -0,0 +1,157 @@
|
||||||
|
//
|
||||||
|
// Window.qml
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 12 Jan 2016
|
||||||
|
// Copyright 2016 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 QtQuick.Controls.Styles 1.4
|
||||||
|
import QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
import "."
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
// FIXME how do I set the initial position of a window without
|
||||||
|
// overriding places where the a individual client of the window
|
||||||
|
// might be setting the position with a Settings{} element?
|
||||||
|
|
||||||
|
// FIXME how to I enable dragging without allowing the window to lay outside
|
||||||
|
// of the desktop? How do I ensure when the desktop resizes all the windows
|
||||||
|
// are still at least partially visible?
|
||||||
|
Window {
|
||||||
|
id: window
|
||||||
|
HifiConstants { id: hifi }
|
||||||
|
children: [ swallower, frame, pane, activator ]
|
||||||
|
|
||||||
|
property var footer: Item { } // Optional static footer at the bottom of the dialog.
|
||||||
|
|
||||||
|
// Scrollable window content.
|
||||||
|
// FIXME this should not define any visual content in this type. The base window
|
||||||
|
// type should only consist of logic sized areas, with nothing drawn (although the
|
||||||
|
// default value for the frame property does include visual decorations)
|
||||||
|
property var pane: Item {
|
||||||
|
property bool isScrolling: scrollView.height < scrollView.contentItem.height
|
||||||
|
property int contentWidth: scrollView.width - (isScrolling ? 10 : 0)
|
||||||
|
property int scrollHeight: scrollView.height
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: isScrolling ? 11 : 0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: contentBackground
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: parent.isScrolling ? 11 : 0
|
||||||
|
color: hifi.colors.baseGray
|
||||||
|
visible: !window.hideBackground && modality != Qt.ApplicationModal
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
LinearGradient {
|
||||||
|
visible: !window.hideBackground && gradientsSupported && modality != Qt.ApplicationModal
|
||||||
|
anchors.top: contentBackground.bottom
|
||||||
|
anchors.left: contentBackground.left
|
||||||
|
width: contentBackground.width - 1
|
||||||
|
height: 4
|
||||||
|
start: Qt.point(0, 0)
|
||||||
|
end: Qt.point(0, 4)
|
||||||
|
gradient: Gradient {
|
||||||
|
GradientStop { position: 0.0; color: hifi.colors.darkGray }
|
||||||
|
GradientStop { position: 1.0; color: hifi.colors.darkGray0 }
|
||||||
|
}
|
||||||
|
cached: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ScrollView {
|
||||||
|
id: scrollView
|
||||||
|
contentItem: content
|
||||||
|
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
|
||||||
|
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.rightMargin: parent.isScrolling ? 1 : 0
|
||||||
|
anchors.bottomMargin: footer.height > 0 ? footerPane.height : 0
|
||||||
|
|
||||||
|
style: ScrollViewStyle {
|
||||||
|
|
||||||
|
padding.right: -7 // Move to right away from content.
|
||||||
|
|
||||||
|
handle: Item {
|
||||||
|
implicitWidth: 8
|
||||||
|
Rectangle {
|
||||||
|
radius: 4
|
||||||
|
color: hifi.colors.white30
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
leftMargin: 2 // Finesse size and position.
|
||||||
|
topMargin: 1
|
||||||
|
bottomMargin: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
scrollBarBackground: Item {
|
||||||
|
implicitWidth: 10
|
||||||
|
Rectangle {
|
||||||
|
color: hifi.colors.darkGray30
|
||||||
|
radius: 4
|
||||||
|
anchors {
|
||||||
|
fill: parent
|
||||||
|
topMargin: -1 // Finesse size
|
||||||
|
bottomMargin: -2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
incrementControl: Item {
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
|
decrementControl: Item {
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
// Optional non-scrolling footer.
|
||||||
|
id: footerPane
|
||||||
|
anchors {
|
||||||
|
left: parent.left
|
||||||
|
bottom: parent.bottom
|
||||||
|
}
|
||||||
|
width: parent.contentWidth
|
||||||
|
height: footer.height + 2 * hifi.dimensions.contentSpacing.y + 3
|
||||||
|
color: hifi.colors.baseGray
|
||||||
|
visible: footer.height > 0
|
||||||
|
|
||||||
|
Item {
|
||||||
|
// Horizontal rule.
|
||||||
|
anchors.fill: parent
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
y: 1 // Stop displaying content just above horizontal rule/=.
|
||||||
|
color: hifi.colors.baseGrayShadow
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: parent.width
|
||||||
|
height: 1
|
||||||
|
y: 2
|
||||||
|
color: hifi.colors.baseGrayHighlight
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 3 // Horizontal rule.
|
||||||
|
children: [ footer ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
49
interface/resources/qml/windows/ToolFrame.qml
Normal file
49
interface/resources/qml/windows/ToolFrame.qml
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
//
|
||||||
|
// DefaultFrame.qml
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 12 Jan 2016
|
||||||
|
// Copyright 2016 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 QtGraphicalEffects 1.0
|
||||||
|
|
||||||
|
import "."
|
||||||
|
import "../styles-uit"
|
||||||
|
|
||||||
|
Frame {
|
||||||
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
// Dialog frame
|
||||||
|
id: frameContent
|
||||||
|
readonly property int frameMargin: 6
|
||||||
|
readonly property int frameMarginLeft: frameMargin
|
||||||
|
readonly property int frameMarginRight: frameMargin
|
||||||
|
readonly property int frameMarginTop: frameMargin
|
||||||
|
readonly property int frameMarginBottom: frameMargin
|
||||||
|
anchors {
|
||||||
|
topMargin: -frameMargin
|
||||||
|
leftMargin: -frameMargin
|
||||||
|
rightMargin: -frameMargin
|
||||||
|
bottomMargin: -frameMargin
|
||||||
|
}
|
||||||
|
anchors.fill: parent
|
||||||
|
color: hifi.colors.baseGrayHighlight40
|
||||||
|
border {
|
||||||
|
width: hifi.dimensions.borderWidth
|
||||||
|
color: hifi.colors.faintGray50
|
||||||
|
}
|
||||||
|
radius: hifi.dimensions.borderRadius / 2
|
||||||
|
|
||||||
|
// Enable dragging of the window
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
drag.target: window
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ Fadable {
|
||||||
implicitHeight: content ? content.height : 0
|
implicitHeight: content ? content.height : 0
|
||||||
implicitWidth: content ? content.width : 0
|
implicitWidth: content ? content.width : 0
|
||||||
x: desktop.invalid_position; y: desktop.invalid_position;
|
x: desktop.invalid_position; y: desktop.invalid_position;
|
||||||
children: [ swallower, frame, pane, activator ]
|
children: [ swallower, frame, content, activator ]
|
||||||
|
|
||||||
//
|
//
|
||||||
// Custom properties
|
// Custom properties
|
||||||
|
@ -106,10 +106,10 @@ Fadable {
|
||||||
// in the window and have a higher Z-order than the content, but follow
|
// in the window and have a higher Z-order than the content, but follow
|
||||||
// the position and size of frame decoration
|
// the position and size of frame decoration
|
||||||
property var activator: MouseArea {
|
property var activator: MouseArea {
|
||||||
width: frame.decoration.width
|
width: frame.decoration ? frame.decoration.width : window.width
|
||||||
height: frame.decoration.height
|
height: frame.decoration ? frame.decoration.height : window.height
|
||||||
x: frame.decoration.anchors.leftMargin
|
x: frame.decoration ? frame.decoration.anchors.leftMargin : 0
|
||||||
y: frame.decoration.anchors.topMargin
|
y: frame.decoration ? frame.decoration.anchors.topMargin : 0
|
||||||
propagateComposedEvents: true
|
propagateComposedEvents: true
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
enabled: window.visible
|
enabled: window.visible
|
||||||
|
@ -124,10 +124,10 @@ Fadable {
|
||||||
// to prevent things like mouse wheel events from reaching the application and changing
|
// to prevent things like mouse wheel events from reaching the application and changing
|
||||||
// the camera if the user is scrolling through a list and gets to the end.
|
// the camera if the user is scrolling through a list and gets to the end.
|
||||||
property var swallower: MouseArea {
|
property var swallower: MouseArea {
|
||||||
width: frame.decoration.width
|
width: frame.decoration ? frame.decoration.width : window.width
|
||||||
height: frame.decoration.height
|
height: frame.decoration ? frame.decoration.height : window.height
|
||||||
x: frame.decoration.anchors.leftMargin
|
x: frame.decoration ? frame.decoration.anchors.leftMargin : 0
|
||||||
y: frame.decoration.anchors.topMargin
|
y: frame.decoration ? frame.decoration.anchors.topMargin : 0
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
enabled: window.visible
|
enabled: window.visible
|
||||||
|
@ -140,133 +140,11 @@ Fadable {
|
||||||
|
|
||||||
// Default to a standard frame. Can be overriden to provide custom
|
// Default to a standard frame. Can be overriden to provide custom
|
||||||
// frame styles, like a full desktop frame to simulate a modal window
|
// frame styles, like a full desktop frame to simulate a modal window
|
||||||
property var frame: DefaultFrame { }
|
property var frame: DefaultFrame {
|
||||||
|
//window: window
|
||||||
// Scrollable window content.
|
|
||||||
// FIXME this should not define any visual content in this type. The base window
|
|
||||||
// type should only consist of logic sized areas, with nothing drawn (although the
|
|
||||||
// default value for the frame property does include visual decorations)
|
|
||||||
property var pane: Item {
|
|
||||||
property bool isScrolling: scrollView.height < scrollView.contentItem.height
|
|
||||||
property int contentWidth: scrollView.width - (isScrolling ? 10 : 0)
|
|
||||||
property int scrollHeight: scrollView.height
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.rightMargin: isScrolling ? 11 : 0
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: contentBackground
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.rightMargin: parent.isScrolling ? 11 : 0
|
|
||||||
color: hifi.colors.baseGray
|
|
||||||
visible: !window.hideBackground && modality != Qt.ApplicationModal
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
LinearGradient {
|
|
||||||
visible: !window.hideBackground && gradientsSupported && modality != Qt.ApplicationModal
|
|
||||||
anchors.top: contentBackground.bottom
|
|
||||||
anchors.left: contentBackground.left
|
|
||||||
width: contentBackground.width - 1
|
|
||||||
height: 4
|
|
||||||
start: Qt.point(0, 0)
|
|
||||||
end: Qt.point(0, 4)
|
|
||||||
gradient: Gradient {
|
|
||||||
GradientStop { position: 0.0; color: hifi.colors.darkGray }
|
|
||||||
GradientStop { position: 1.0; color: hifi.colors.darkGray0 }
|
|
||||||
}
|
|
||||||
cached: true
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollView {
|
|
||||||
id: scrollView
|
|
||||||
contentItem: content
|
|
||||||
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
|
|
||||||
verticalScrollBarPolicy: Qt.ScrollBarAsNeeded
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.rightMargin: parent.isScrolling ? 1 : 0
|
|
||||||
anchors.bottomMargin: footer.height > 0 ? footerPane.height : 0
|
|
||||||
|
|
||||||
style: ScrollViewStyle {
|
|
||||||
|
|
||||||
padding.right: -7 // Move to right away from content.
|
|
||||||
|
|
||||||
handle: Item {
|
|
||||||
implicitWidth: 8
|
|
||||||
Rectangle {
|
|
||||||
radius: 4
|
|
||||||
color: hifi.colors.white30
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
leftMargin: 2 // Finesse size and position.
|
|
||||||
topMargin: 1
|
|
||||||
bottomMargin: 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
scrollBarBackground: Item {
|
|
||||||
implicitWidth: 10
|
|
||||||
Rectangle {
|
|
||||||
color: hifi.colors.darkGray30
|
|
||||||
radius: 4
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
topMargin: -1 // Finesse size
|
|
||||||
bottomMargin: -2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
incrementControl: Item {
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
|
|
||||||
decrementControl: Item {
|
|
||||||
visible: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
// Optional non-scrolling footer.
|
|
||||||
id: footerPane
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
width: parent.contentWidth
|
|
||||||
height: footer.height + 2 * hifi.dimensions.contentSpacing.y + 3
|
|
||||||
color: hifi.colors.baseGray
|
|
||||||
visible: footer.height > 0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
// Horizontal rule.
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
y: 1 // Stop displaying content just above horizontal rule/=.
|
|
||||||
color: hifi.colors.baseGrayShadow
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: parent.width
|
|
||||||
height: 1
|
|
||||||
y: 2
|
|
||||||
color: hifi.colors.baseGrayHighlight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.topMargin: 3 // Horizontal rule.
|
|
||||||
children: [ footer ]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Handlers
|
// Handlers
|
||||||
//
|
//
|
||||||
|
|
|
@ -133,6 +133,7 @@
|
||||||
#include "scripting/WebWindowClass.h"
|
#include "scripting/WebWindowClass.h"
|
||||||
#include "scripting/WindowScriptingInterface.h"
|
#include "scripting/WindowScriptingInterface.h"
|
||||||
#include "scripting/ControllerScriptingInterface.h"
|
#include "scripting/ControllerScriptingInterface.h"
|
||||||
|
#include "scripting/ToolbarScriptingInterface.h"
|
||||||
#include "scripting/RatesScriptingInterface.h"
|
#include "scripting/RatesScriptingInterface.h"
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
#include "SpeechRecognizer.h"
|
#include "SpeechRecognizer.h"
|
||||||
|
@ -437,6 +438,7 @@ bool setupEssentials(int& argc, char** argv) {
|
||||||
DependencyManager::set<WindowScriptingInterface>();
|
DependencyManager::set<WindowScriptingInterface>();
|
||||||
DependencyManager::set<HMDScriptingInterface>();
|
DependencyManager::set<HMDScriptingInterface>();
|
||||||
DependencyManager::set<ResourceScriptingInterface>();
|
DependencyManager::set<ResourceScriptingInterface>();
|
||||||
|
DependencyManager::set<ToolbarScriptingInterface>();
|
||||||
|
|
||||||
|
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
||||||
|
@ -4527,6 +4529,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri
|
||||||
RayToOverlayIntersectionResultFromScriptValue);
|
RayToOverlayIntersectionResultFromScriptValue);
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("Desktop", DependencyManager::get<DesktopScriptingInterface>().data());
|
scriptEngine->registerGlobalObject("Desktop", DependencyManager::get<DesktopScriptingInterface>().data());
|
||||||
|
scriptEngine->registerGlobalObject("Toolbars", DependencyManager::get<ToolbarScriptingInterface>().data());
|
||||||
|
|
||||||
scriptEngine->registerGlobalObject("Window", DependencyManager::get<WindowScriptingInterface>().data());
|
scriptEngine->registerGlobalObject("Window", DependencyManager::get<WindowScriptingInterface>().data());
|
||||||
scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,
|
scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,
|
||||||
|
|
124
interface/src/scripting/ToolbarScriptingInterface.cpp
Normal file
124
interface/src/scripting/ToolbarScriptingInterface.cpp
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 2016-06-16
|
||||||
|
// Copyright 2013-2016 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
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "ToolbarScriptingInterface.h"
|
||||||
|
|
||||||
|
#include <OffscreenUi.h>
|
||||||
|
|
||||||
|
class QmlWrapper : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
QmlWrapper(QObject* qmlObject, QObject* parent = nullptr)
|
||||||
|
: QObject(parent), _qmlObject(qmlObject) {
|
||||||
|
|
||||||
|
const QMetaObject *metaobject = qmlObject->metaObject();
|
||||||
|
int count = metaobject->propertyCount();
|
||||||
|
qDebug() << "Scanning properties for " << qmlObject;
|
||||||
|
for (int i = 0; i < count; ++i) {
|
||||||
|
QMetaProperty metaproperty = metaobject->property(i);
|
||||||
|
const char *name = metaproperty.name();
|
||||||
|
qDebug() << "Property " << name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_INVOKABLE void writeProperty(QString propertyName, QVariant propertyValue) {
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
offscreenUi->executeOnUiThread([=] {
|
||||||
|
_qmlObject->setProperty(propertyName.toStdString().c_str(), propertyValue);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_INVOKABLE void writeProperties(QVariant propertyMap) {
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
offscreenUi->executeOnUiThread([=] {
|
||||||
|
QVariantMap map = propertyMap.toMap();
|
||||||
|
for (const QString& key : map.keys()) {
|
||||||
|
_qmlObject->setProperty(key.toStdString().c_str(), map[key]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_INVOKABLE QVariant readProperty(const QString& propertyName) {
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
return offscreenUi->returnFromUiThread([&]()->QVariant {
|
||||||
|
return _qmlObject->property(propertyName.toStdString().c_str());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Q_INVOKABLE QVariant readProperties(const QVariant& propertyList) {
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
return offscreenUi->returnFromUiThread([&]()->QVariant {
|
||||||
|
QVariantMap result;
|
||||||
|
for (const QVariant& property : propertyList.toList()) {
|
||||||
|
QString propertyString = property.toString();
|
||||||
|
result.insert(propertyString, _qmlObject->property(propertyString.toStdString().c_str()));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
QObject* _qmlObject{ nullptr };
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
class ToolbarButtonProxy : public QmlWrapper {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ToolbarButtonProxy(QObject* qmlObject, QObject* parent = nullptr) : QmlWrapper(qmlObject, parent) {
|
||||||
|
connect(qmlObject, SIGNAL(clicked()), this, SIGNAL(clicked()));
|
||||||
|
}
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void clicked();
|
||||||
|
};
|
||||||
|
|
||||||
|
class ToolbarProxy : public QmlWrapper {
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ToolbarProxy(QObject* qmlObject, QObject* parent = nullptr) : QmlWrapper(qmlObject, parent) { }
|
||||||
|
|
||||||
|
Q_INVOKABLE QObject* addButton(const QVariant& properties) {
|
||||||
|
QVariant resultVar;
|
||||||
|
bool invokeResult = QMetaObject::invokeMethod(_qmlObject, "addButton", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QVariant, resultVar), Q_ARG(QVariant, properties));
|
||||||
|
if (!invokeResult) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
QObject* rawButton = qvariant_cast<QObject *>(resultVar);
|
||||||
|
if (!rawButton) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ToolbarButtonProxy(rawButton, this);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
QObject* ToolbarScriptingInterface::getToolbar(const QString& toolbarId) {
|
||||||
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
auto desktop = offscreenUi->getDesktop();
|
||||||
|
QVariant resultVar;
|
||||||
|
bool invokeResult = QMetaObject::invokeMethod(desktop, "getToolbar", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QVariant, resultVar), Q_ARG(QVariant, toolbarId));
|
||||||
|
if (!invokeResult) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
QObject* rawToolbar = qvariant_cast<QObject *>(resultVar);
|
||||||
|
if (!rawToolbar) {
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ToolbarProxy(rawToolbar);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#include "ToolbarScriptingInterface.moc"
|
26
interface/src/scripting/ToolbarScriptingInterface.h
Normal file
26
interface/src/scripting/ToolbarScriptingInterface.h
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
//
|
||||||
|
// Created by Bradley Austin Davis on 2016-06-16
|
||||||
|
// Copyright 2013-2016 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
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_ToolbarScriptingInterface_h
|
||||||
|
#define hifi_ToolbarScriptingInterface_h
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
|
#include <DependencyManager.h>
|
||||||
|
|
||||||
|
class ToolbarProxy;
|
||||||
|
|
||||||
|
class ToolbarScriptingInterface : public QObject, public Dependency {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
Q_INVOKABLE QObject* getToolbar(const QString& toolbarId);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // hifi_ToolbarScriptingInterface_h
|
|
@ -12,9 +12,10 @@
|
||||||
Script.load("system/progress.js");
|
Script.load("system/progress.js");
|
||||||
Script.load("system/away.js");
|
Script.load("system/away.js");
|
||||||
Script.load("system/users.js");
|
Script.load("system/users.js");
|
||||||
Script.load("system/examples.js");
|
Script.load("system/mute.js");
|
||||||
Script.load("system/goto.js");
|
Script.load("system/goto.js");
|
||||||
Script.load("system/hmd.js");
|
Script.load("system/hmd.js");
|
||||||
|
Script.load("system/examples.js");
|
||||||
Script.load("system/edit.js");
|
Script.load("system/edit.js");
|
||||||
Script.load("system/selectAudioDevice.js");
|
Script.load("system/selectAudioDevice.js");
|
||||||
Script.load("system/notifications.js");
|
Script.load("system/notifications.js");
|
||||||
|
|
118
scripts/developer/tests/toolbarTest.js
Normal file
118
scripts/developer/tests/toolbarTest.js
Normal file
|
@ -0,0 +1,118 @@
|
||||||
|
var isActive = false;
|
||||||
|
|
||||||
|
var toolBar = (function() {
|
||||||
|
var that = {},
|
||||||
|
toolBar,
|
||||||
|
activeButton,
|
||||||
|
newModelButton,
|
||||||
|
newCubeButton,
|
||||||
|
newSphereButton,
|
||||||
|
newLightButton,
|
||||||
|
newTextButton,
|
||||||
|
newWebButton,
|
||||||
|
newZoneButton,
|
||||||
|
newParticleButton
|
||||||
|
|
||||||
|
var toolIconUrl = Script.resolvePath("assets/images/tools/");
|
||||||
|
|
||||||
|
function initialize() {
|
||||||
|
print("Toolbars: " + Toolbars);
|
||||||
|
toolBar = Toolbars.getToolbar("highfidelity.edit.toolbar");
|
||||||
|
print("Toolbar: " + toolBar);
|
||||||
|
activeButton = toolBar.addButton({
|
||||||
|
objectName: "activeButton",
|
||||||
|
imageURL: toolIconUrl + "edit-01.svg",
|
||||||
|
visible: true,
|
||||||
|
alpha: 0.9,
|
||||||
|
});
|
||||||
|
|
||||||
|
print("Button " + activeButton);
|
||||||
|
print("Button signal " + activeButton.clicked);
|
||||||
|
activeButton.clicked.connect(function(){
|
||||||
|
print("Clicked on button " + isActive);
|
||||||
|
that.setActive(!isActive);
|
||||||
|
});
|
||||||
|
|
||||||
|
newModelButton = toolBar.addButton({
|
||||||
|
objectName: "newModelButton",
|
||||||
|
imageURL: toolIconUrl + "model-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newCubeButton = toolBar.addButton({
|
||||||
|
objectName: "newCubeButton",
|
||||||
|
imageURL: toolIconUrl + "cube-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newSphereButton = toolBar.addButton({
|
||||||
|
objectName: "newSphereButton",
|
||||||
|
imageURL: toolIconUrl + "sphere-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newLightButton = toolBar.addButton({
|
||||||
|
objectName: "newLightButton",
|
||||||
|
imageURL: toolIconUrl + "light-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newTextButton = toolBar.addButton({
|
||||||
|
objectName: "newTextButton",
|
||||||
|
imageURL: toolIconUrl + "text-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newWebButton = toolBar.addButton({
|
||||||
|
objectName: "newWebButton",
|
||||||
|
imageURL: toolIconUrl + "web-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newZoneButton = toolBar.addButton({
|
||||||
|
objectName: "newZoneButton",
|
||||||
|
imageURL: toolIconUrl + "zone-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
newParticleButton = toolBar.addButton({
|
||||||
|
objectName: "newParticleButton",
|
||||||
|
imageURL: toolIconUrl + "particle-01.svg",
|
||||||
|
alpha: 0.9,
|
||||||
|
visible: false
|
||||||
|
});
|
||||||
|
|
||||||
|
that.setActive(false);
|
||||||
|
newModelButton.clicked();
|
||||||
|
}
|
||||||
|
|
||||||
|
that.setActive = function(active) {
|
||||||
|
if (active != isActive) {
|
||||||
|
isActive = active;
|
||||||
|
that.showTools(isActive);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sets visibility of tool buttons, excluding the power button
|
||||||
|
that.showTools = function(doShow) {
|
||||||
|
newModelButton.writeProperty('visible', doShow);
|
||||||
|
newCubeButton.writeProperty('visible', doShow);
|
||||||
|
newSphereButton.writeProperty('visible', doShow);
|
||||||
|
newLightButton.writeProperty('visible', doShow);
|
||||||
|
newTextButton.writeProperty('visible', doShow);
|
||||||
|
newWebButton.writeProperty('visible', doShow);
|
||||||
|
newZoneButton.writeProperty('visible', doShow);
|
||||||
|
newModelButton.writeProperty('visible', doShow);
|
||||||
|
newParticleButton.writeProperty('visible', doShow);
|
||||||
|
};
|
||||||
|
|
||||||
|
initialize();
|
||||||
|
return that;
|
||||||
|
}());
|
13
scripts/system/assets/images/tools/microphone.svg
Normal file
13
scripts/system/assets/images/tools/microphone.svg
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<svg width="50" height="50.1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
<metadata id="metadata27">image/svg+xml</metadata>
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<g id="g3" opacity="0.9">
|
||||||
|
<path id="path5" d="m50,46c0,2.2 -1.8,4 -4,4l-42,0c-2.2,0 -4,-1.8 -4,-4l0,-42c0,-2.2 1.8,-4 4,-4l42,0c2.2,0 4,1.8 4,4l0,42z" fill="#1E1E1E"/>
|
||||||
|
</g>
|
||||||
|
<text xml:space="preserve" text-anchor="middle" font-family="Sans" font-size="11px" id="svg_5" y="42.610549" x="25.949214" stroke="#cbcbcb" fill="#cbcbcb">Mute</text>
|
||||||
|
<ellipse ry="6.644531" rx="0.632813" id="svg_6" cy="15.716017" cx="25.316401" stroke-width="5" stroke="#cbcbcb" fill="#1E1E1E"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 702 B |
|
@ -9,10 +9,6 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
Script.include([
|
|
||||||
"libraries/toolBars.js",
|
|
||||||
]);
|
|
||||||
|
|
||||||
var toolIconUrl = Script.resolvePath("assets/images/tools/");
|
var toolIconUrl = Script.resolvePath("assets/images/tools/");
|
||||||
|
|
||||||
var EXAMPLES_URL = "https://metaverse.highfidelity.com/examples";
|
var EXAMPLES_URL = "https://metaverse.highfidelity.com/examples";
|
||||||
|
@ -52,87 +48,21 @@ function toggleExamples() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var toolBar = (function() {
|
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
var that = {},
|
|
||||||
toolBar,
|
|
||||||
browseExamplesButton;
|
|
||||||
|
|
||||||
function initialize() {
|
var browseExamplesButton = toolBar.addButton({
|
||||||
toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.examples.toolbar", function(windowDimensions, toolbar) {
|
imageURL: toolIconUrl + "examples-01.svg",
|
||||||
return {
|
objectName: "examples",
|
||||||
x: (windowDimensions.x / 2) + (Tool.IMAGE_WIDTH * 2),
|
yOffset: 50,
|
||||||
y: windowDimensions.y
|
alpha: 0.9,
|
||||||
};
|
});
|
||||||
}, {
|
|
||||||
x: -toolWidth / 2,
|
|
||||||
y: -TOOLBAR_MARGIN_Y - toolHeight
|
|
||||||
});
|
|
||||||
browseExamplesButton = toolBar.addTool({
|
|
||||||
imageURL: toolIconUrl + "examples-01.svg",
|
|
||||||
subImage: {
|
|
||||||
x: 0,
|
|
||||||
y: Tool.IMAGE_WIDTH,
|
|
||||||
width: Tool.IMAGE_WIDTH,
|
|
||||||
height: Tool.IMAGE_HEIGHT
|
|
||||||
},
|
|
||||||
width: toolWidth,
|
|
||||||
height: toolHeight,
|
|
||||||
alpha: 0.9,
|
|
||||||
visible: true,
|
|
||||||
showButtonDown: true
|
|
||||||
});
|
|
||||||
|
|
||||||
toolBar.showTool(browseExamplesButton, true);
|
var browseExamplesButtonDown = false;
|
||||||
}
|
|
||||||
|
|
||||||
var browseExamplesButtonDown = false;
|
browseExamplesButton.clicked.connect(function(){
|
||||||
that.mousePressEvent = function(event) {
|
toggleExamples();
|
||||||
var clickedOverlay,
|
});
|
||||||
url,
|
|
||||||
file;
|
|
||||||
|
|
||||||
if (!event.isLeftButton) {
|
Script.scriptEnding.connect(function () {
|
||||||
// if another mouse button than left is pressed ignore it
|
browseExamplesButton.clicked.disconnect();
|
||||||
return false;
|
});
|
||||||
}
|
|
||||||
|
|
||||||
clickedOverlay = Overlays.getOverlayAtPoint({
|
|
||||||
x: event.x,
|
|
||||||
y: event.y
|
|
||||||
});
|
|
||||||
|
|
||||||
if (browseExamplesButton === toolBar.clicked(clickedOverlay)) {
|
|
||||||
toggleExamples();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
that.mouseReleaseEvent = function(event) {
|
|
||||||
var handled = false;
|
|
||||||
|
|
||||||
|
|
||||||
if (browseExamplesButtonDown) {
|
|
||||||
var clickedOverlay = Overlays.getOverlayAtPoint({
|
|
||||||
x: event.x,
|
|
||||||
y: event.y
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
newModelButtonDown = false;
|
|
||||||
browseExamplesButtonDown = false;
|
|
||||||
|
|
||||||
return handled;
|
|
||||||
}
|
|
||||||
|
|
||||||
that.cleanup = function() {
|
|
||||||
toolBar.cleanup();
|
|
||||||
};
|
|
||||||
|
|
||||||
initialize();
|
|
||||||
return that;
|
|
||||||
}());
|
|
||||||
|
|
||||||
Controller.mousePressEvent.connect(toolBar.mousePressEvent)
|
|
||||||
Script.scriptEnding.connect(toolBar.cleanup);
|
|
||||||
|
|
|
@ -9,39 +9,21 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
Script.include("libraries/toolBars.js");
|
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
|
|
||||||
function initialPosition(windowDimensions, toolbar) {
|
|
||||||
return {
|
var button = toolBar.addButton({
|
||||||
x: (windowDimensions.x / 2) - (Tool.IMAGE_WIDTH * 1),
|
objectName: "goto",
|
||||||
y: windowDimensions.y
|
|
||||||
};
|
|
||||||
}
|
|
||||||
var toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.goto.toolbar", initialPosition, {
|
|
||||||
x: -Tool.IMAGE_WIDTH / 2,
|
|
||||||
y: -Tool.IMAGE_HEIGHT
|
|
||||||
});
|
|
||||||
var button = toolBar.addTool({
|
|
||||||
imageURL: Script.resolvePath("assets/images/tools/directory-01.svg"),
|
imageURL: Script.resolvePath("assets/images/tools/directory-01.svg"),
|
||||||
subImage: {
|
|
||||||
x: 0,
|
|
||||||
y: Tool.IMAGE_WIDTH,
|
|
||||||
width: Tool.IMAGE_WIDTH,
|
|
||||||
height: Tool.IMAGE_HEIGHT
|
|
||||||
},
|
|
||||||
width: Tool.IMAGE_WIDTH,
|
|
||||||
height: Tool.IMAGE_HEIGHT,
|
|
||||||
alpha: 0.9,
|
|
||||||
visible: true,
|
visible: true,
|
||||||
showButtonDown: true
|
yOffset: 50,
|
||||||
|
alpha: 0.9,
|
||||||
});
|
});
|
||||||
function onMousePress (event) {
|
|
||||||
if (event.isLeftButton && button === toolBar.clicked(Overlays.getOverlayAtPoint(event))) {
|
button.clicked.connect(function(){
|
||||||
DialogsManager.toggleAddressBar();
|
DialogsManager.toggleAddressBar();
|
||||||
}
|
});
|
||||||
};
|
|
||||||
Controller.mousePressEvent.connect(onMousePress)
|
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
Controller.mousePressEvent.disconnect(onMousePress)
|
button.clicked.disconnect();
|
||||||
toolBar.cleanup();
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
Script.include("libraries/toolBars.js");
|
|
||||||
|
|
||||||
var headset; // The preferred headset. Default to the first one found in the following list.
|
var headset; // The preferred headset. Default to the first one found in the following list.
|
||||||
var displayMenuName = "Display";
|
var displayMenuName = "Display";
|
||||||
var desktopMenuItemName = "Desktop";
|
var desktopMenuItemName = "Desktop";
|
||||||
|
@ -20,38 +18,25 @@ var desktopMenuItemName = "Desktop";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function initialPosition(windowDimensions, toolbar) {
|
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
return {
|
var button;
|
||||||
x: (windowDimensions.x / 2) - (Tool.IMAGE_WIDTH * 2.5),
|
|
||||||
y: windowDimensions.y
|
if (headset) {
|
||||||
};
|
button = toolBar.addButton({
|
||||||
}
|
objectName: "hmdToggle",
|
||||||
var toolBar = new ToolBar(0, 0, ToolBar.HORIZONTAL, "highfidelity.hmd.toolbar", initialPosition, {
|
imageURL: Script.resolvePath("assets/images/tools/hmd-switch-01.svg"),
|
||||||
x: -Tool.IMAGE_WIDTH / 2,
|
visible: true,
|
||||||
y: -Tool.IMAGE_HEIGHT
|
yOffset: 50,
|
||||||
});
|
alpha: 0.9,
|
||||||
var button = toolBar.addTool({
|
});
|
||||||
imageURL: Script.resolvePath("assets/images/tools/hmd-switch-01.svg"),
|
|
||||||
subImage: {
|
button.clicked.connect(function(){
|
||||||
x: 0,
|
|
||||||
y: Tool.IMAGE_WIDTH,
|
|
||||||
width: Tool.IMAGE_WIDTH,
|
|
||||||
height: Tool.IMAGE_HEIGHT
|
|
||||||
},
|
|
||||||
width: Tool.IMAGE_WIDTH,
|
|
||||||
height: Tool.IMAGE_HEIGHT,
|
|
||||||
alpha: 0.9,
|
|
||||||
visible: true,
|
|
||||||
showButtonDown: true
|
|
||||||
});
|
|
||||||
function onMousePress (event) {
|
|
||||||
if (event.isLeftButton && button === toolBar.clicked(Overlays.getOverlayAtPoint(event))) {
|
|
||||||
var isDesktop = Menu.isOptionChecked(desktopMenuItemName);
|
var isDesktop = Menu.isOptionChecked(desktopMenuItemName);
|
||||||
Menu.setIsOptionChecked(isDesktop ? headset : desktopMenuItemName, true);
|
Menu.setIsOptionChecked(isDesktop ? headset : desktopMenuItemName, true);
|
||||||
}
|
});
|
||||||
};
|
|
||||||
Controller.mousePressEvent.connect(onMousePress)
|
Script.scriptEnding.connect(function () {
|
||||||
Script.scriptEnding.connect(function () {
|
button.clicked.disconnect();
|
||||||
Controller.mousePressEvent.disconnect(onMousePress)
|
});
|
||||||
toolBar.cleanup();
|
}
|
||||||
});
|
|
||||||
|
|
29
scripts/system/mute.js
Normal file
29
scripts/system/mute.js
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
//
|
||||||
|
// goto.js
|
||||||
|
// scripts/system/
|
||||||
|
//
|
||||||
|
// Created by Howard Stearns on 2 Jun 2016
|
||||||
|
// Copyright 2016 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
|
||||||
|
//
|
||||||
|
|
||||||
|
var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
|
|
||||||
|
|
||||||
|
var button = toolBar.addButton({
|
||||||
|
objectName: "mute",
|
||||||
|
imageURL: Script.resolvePath("assets/images/tools/microphone.svg"),
|
||||||
|
visible: true,
|
||||||
|
alpha: 0.9,
|
||||||
|
});
|
||||||
|
|
||||||
|
button.clicked.connect(function(){
|
||||||
|
var menuItem = "Mute Microphone";
|
||||||
|
Menu.setIsOptionChecked(menuItem, !Menu.isOptionChecked(menuItem));
|
||||||
|
});
|
||||||
|
|
||||||
|
Script.scriptEnding.connect(function () {
|
||||||
|
button.clicked.disconnect();
|
||||||
|
});
|
|
@ -23,11 +23,23 @@ Item {
|
||||||
function getUsername() { return "Jherico"; }
|
function getUsername() { return "Jherico"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
objectName: "GL"
|
||||||
|
property string vendor: ""
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
objectName: "ApplicationCompositor"
|
objectName: "ApplicationCompositor"
|
||||||
property bool reticleOverDesktop: true
|
property bool reticleOverDesktop: true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
objectName: "Controller"
|
||||||
|
function getRecommendedOverlayRect() {
|
||||||
|
return Qt.rect(0, 0, 1920, 1080);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
objectName: "Preferences"
|
objectName: "Preferences"
|
||||||
// List of categories obtained by logging categories as they are added in Interface in Preferences::addPreference().
|
// List of categories obtained by logging categories as they are added in Interface in Preferences::addPreference().
|
||||||
|
|
|
@ -25,35 +25,67 @@ ApplicationWindow {
|
||||||
|
|
||||||
property var tabs: [];
|
property var tabs: [];
|
||||||
property var urls: [];
|
property var urls: [];
|
||||||
|
property var toolbar;
|
||||||
|
property var lastButton;
|
||||||
|
|
||||||
// Window visibility
|
// Window visibility
|
||||||
|
|
||||||
Button {
|
|
||||||
text: "restore all"
|
|
||||||
onClicked: {
|
|
||||||
for (var i = 0; i < desktop.windows.length; ++i) {
|
|
||||||
desktop.windows[i].shown = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Button {
|
|
||||||
text: "toggle blue visible"
|
|
||||||
onClicked: {
|
|
||||||
blue.shown = !blue.shown
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Button {
|
|
||||||
text: "toggle blue enabled"
|
|
||||||
onClicked: {
|
|
||||||
blue.enabled = !blue.enabled
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "toggle desktop"
|
text: "toggle desktop"
|
||||||
onClicked: desktop.togglePinned()
|
onClicked: desktop.togglePinned()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Create Toolbar"
|
||||||
|
onClicked: testButtons.toolbar = desktop.getToolbar("com.highfidelity.interface.toolbar.system");
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Toggle Toolbar Direction"
|
||||||
|
onClicked: testButtons.toolbar.horizontal = !testButtons.toolbar.horizontal
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
readonly property var icons: [
|
||||||
|
"edit-01.svg",
|
||||||
|
"model-01.svg",
|
||||||
|
"cube-01.svg",
|
||||||
|
"sphere-01.svg",
|
||||||
|
"light-01.svg",
|
||||||
|
"text-01.svg",
|
||||||
|
"web-01.svg",
|
||||||
|
"zone-01.svg",
|
||||||
|
"particle-01.svg",
|
||||||
|
]
|
||||||
|
property int iconIndex: 0
|
||||||
|
readonly property string toolIconUrl: "file:///C:/Users/bdavi/git/hifi/scripts/system/assets/images/tools/"
|
||||||
|
text: "Create Button"
|
||||||
|
onClicked: {
|
||||||
|
var name = icons[iconIndex];
|
||||||
|
var url = toolIconUrl + name;
|
||||||
|
iconIndex = (iconIndex + 1) % icons.length;
|
||||||
|
var button = testButtons.lastButton = testButtons.toolbar.addButton({
|
||||||
|
imageURL: url,
|
||||||
|
objectName: name,
|
||||||
|
subImage: {
|
||||||
|
y: 50,
|
||||||
|
},
|
||||||
|
alpha: 0.9
|
||||||
|
});
|
||||||
|
|
||||||
|
button.clicked.connect(function(){
|
||||||
|
console.log("Clicked on button " + button.imageURL + " alpha " + button.alpha)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
text: "Toggle Button Visible"
|
||||||
|
onClicked: testButtons.lastButton.visible = !testButtons.lastButton.visible
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Error alerts
|
// Error alerts
|
||||||
/*
|
/*
|
||||||
Button {
|
Button {
|
||||||
|
@ -106,7 +138,7 @@ ApplicationWindow {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Browser
|
// Browser
|
||||||
|
/*
|
||||||
Button {
|
Button {
|
||||||
text: "Open Browser"
|
text: "Open Browser"
|
||||||
onClicked: builder.createObject(desktop);
|
onClicked: builder.createObject(desktop);
|
||||||
|
@ -114,8 +146,11 @@ ApplicationWindow {
|
||||||
Browser {}
|
Browser {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
// file dialog
|
// file dialog
|
||||||
|
/*
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
text: "Open Directory"
|
text: "Open Directory"
|
||||||
|
@ -153,7 +188,6 @@ ApplicationWindow {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// tabs
|
// tabs
|
||||||
|
@ -306,6 +340,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
Window {
|
Window {
|
||||||
id: blue
|
id: blue
|
||||||
closable: true
|
closable: true
|
||||||
|
@ -350,6 +385,8 @@ ApplicationWindow {
|
||||||
height: green.height;
|
height: green.height;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Window {
|
Window {
|
||||||
id: yellow
|
id: yellow
|
||||||
|
@ -379,3 +416,7 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,7 @@ DISTFILES += \
|
||||||
../../interface/resources/qml/styles-uit/*.qml \
|
../../interface/resources/qml/styles-uit/*.qml \
|
||||||
../../interface/resources/qml/windows/*.qml \
|
../../interface/resources/qml/windows/*.qml \
|
||||||
../../interface/resources/qml/hifi/*.qml \
|
../../interface/resources/qml/hifi/*.qml \
|
||||||
|
../../interface/resources/qml/hifi/toolbars/*.qml \
|
||||||
../../interface/resources/qml/hifi/dialogs/*.qml \
|
../../interface/resources/qml/hifi/dialogs/*.qml \
|
||||||
../../interface/resources/qml/hifi/dialogs/preferences/*.qml \
|
../../interface/resources/qml/hifi/dialogs/preferences/*.qml \
|
||||||
../../interface/resources/qml/hifi/overlays/*.qml
|
../../interface/resources/qml/hifi/overlays/*.qml
|
||||||
|
|
|
@ -86,9 +86,11 @@ int main(int argc, char *argv[]) {
|
||||||
setChild(engine, "offscreenFlags");
|
setChild(engine, "offscreenFlags");
|
||||||
setChild(engine, "Account");
|
setChild(engine, "Account");
|
||||||
setChild(engine, "ApplicationCompositor");
|
setChild(engine, "ApplicationCompositor");
|
||||||
|
setChild(engine, "Controller");
|
||||||
setChild(engine, "Desktop");
|
setChild(engine, "Desktop");
|
||||||
setChild(engine, "ScriptDiscoveryService");
|
setChild(engine, "ScriptDiscoveryService");
|
||||||
setChild(engine, "HMD");
|
setChild(engine, "HMD");
|
||||||
|
setChild(engine, "GL");
|
||||||
setChild(engine, "MenuHelper");
|
setChild(engine, "MenuHelper");
|
||||||
setChild(engine, "Preferences");
|
setChild(engine, "Preferences");
|
||||||
setChild(engine, "urlHandler");
|
setChild(engine, "urlHandler");
|
||||||
|
@ -101,3 +103,4 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "main.moc"
|
#include "main.moc"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue