From ff55644fe859a72da6e16e5b15d92f1e5da171b8 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Thu, 30 Jun 2016 16:24:11 -0700 Subject: [PATCH 1/6] stateful hud toolbar buttons --- interface/resources/qml/AddressBarDialog.qml | 1 + .../DialogsManagerScriptingInterface.cpp | 2 ++ .../DialogsManagerScriptingInterface.h | 1 + interface/src/ui/AddressBarDialog.cpp | 4 ++++ interface/src/ui/AddressBarDialog.h | 1 + interface/src/ui/DialogsManager.h | 2 ++ scripts/system/examples.js | 18 +++++++++++------- scripts/system/goto.js | 16 +++++++++++----- scripts/system/hmd.js | 19 ++++++++++++------- scripts/system/mute.js | 19 ++++++++++++++----- 10 files changed, 59 insertions(+), 24 deletions(-) diff --git a/interface/resources/qml/AddressBarDialog.qml b/interface/resources/qml/AddressBarDialog.qml index a48804faba..dc060b70e1 100644 --- a/interface/resources/qml/AddressBarDialog.qml +++ b/interface/resources/qml/AddressBarDialog.qml @@ -30,6 +30,7 @@ Window { width: addressBarDialog.implicitWidth height: addressBarDialog.implicitHeight + onShownChanged: addressBarDialog.observeShownChanged(shown); Component.onCompleted: { root.parentChanged.connect(center); center(); diff --git a/interface/src/scripting/DialogsManagerScriptingInterface.cpp b/interface/src/scripting/DialogsManagerScriptingInterface.cpp index 80a8b4ac7c..cbca7ff4ff 100644 --- a/interface/src/scripting/DialogsManagerScriptingInterface.cpp +++ b/interface/src/scripting/DialogsManagerScriptingInterface.cpp @@ -18,6 +18,8 @@ DialogsManagerScriptingInterface::DialogsManagerScriptingInterface() { connect(DependencyManager::get().data(), &DialogsManager::addressBarToggled, this, &DialogsManagerScriptingInterface::addressBarToggled); + connect(DependencyManager::get().data(), &DialogsManager::addressBarShown, + this, &DialogsManagerScriptingInterface::addressBarShown); } void DialogsManagerScriptingInterface::toggleAddressBar() { diff --git a/interface/src/scripting/DialogsManagerScriptingInterface.h b/interface/src/scripting/DialogsManagerScriptingInterface.h index ef44e20d61..075b89f0e5 100644 --- a/interface/src/scripting/DialogsManagerScriptingInterface.h +++ b/interface/src/scripting/DialogsManagerScriptingInterface.h @@ -24,6 +24,7 @@ public slots: signals: void addressBarToggled(); + void addressBarShown(bool visible); }; #endif diff --git a/interface/src/ui/AddressBarDialog.cpp b/interface/src/ui/AddressBarDialog.cpp index ba0cf18d32..6fb437e312 100644 --- a/interface/src/ui/AddressBarDialog.cpp +++ b/interface/src/ui/AddressBarDialog.cpp @@ -16,6 +16,7 @@ #include "DependencyManager.h" #include "AddressManager.h" +#include "DialogsManager.h" HIFI_QML_DEF(AddressBarDialog) @@ -74,3 +75,6 @@ void AddressBarDialog::displayAddressNotFoundMessage() { OffscreenUi::critical("", "There is no address information for that user or place"); } +void AddressBarDialog::observeShownChanged(bool visible) { + DependencyManager::get()->emitAddressBarShown(visible); +} diff --git a/interface/src/ui/AddressBarDialog.h b/interface/src/ui/AddressBarDialog.h index b2751860cc..bbce52c67c 100644 --- a/interface/src/ui/AddressBarDialog.h +++ b/interface/src/ui/AddressBarDialog.h @@ -38,6 +38,7 @@ protected: Q_INVOKABLE void loadHome(); Q_INVOKABLE void loadBack(); Q_INVOKABLE void loadForward(); + Q_INVOKABLE void observeShownChanged(bool visible); bool _backEnabled; bool _forwardEnabled; diff --git a/interface/src/ui/DialogsManager.h b/interface/src/ui/DialogsManager.h index b8fa22ec83..c48c6df0e6 100644 --- a/interface/src/ui/DialogsManager.h +++ b/interface/src/ui/DialogsManager.h @@ -40,6 +40,7 @@ public: QPointer getHMDToolsDialog() const { return _hmdToolsDialog; } QPointer getLodToolsDialog() const { return _lodToolsDialog; } QPointer getOctreeStatsDialog() const { return _octreeStatsDialog; } + void emitAddressBarShown(bool visible) { emit addressBarShown(visible); } public slots: void toggleAddressBar(); @@ -60,6 +61,7 @@ public slots: signals: void addressBarToggled(); + void addressBarShown(bool visible); private slots: void hmdToolsClosed(); diff --git a/scripts/system/examples.js b/scripts/system/examples.js index a948f9e563..4d838bc8af 100644 --- a/scripts/system/examples.js +++ b/scripts/system/examples.js @@ -55,16 +55,20 @@ var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var browseExamplesButton = toolBar.addButton({ imageURL: toolIconUrl + "examples-01.svg", objectName: "examples", - yOffset: 50, - alpha: 0.9, + buttonState: 1, + alpha: 0.9 }); -var browseExamplesButtonDown = false; - -browseExamplesButton.clicked.connect(function(){ +function onExamplesWindowVisibilityChanged() { + browseExamplesButton.writeProperty('buttonState', examplesWindow.visible ? 0 : 1); +} +function onClick() { toggleExamples(); -}); +} +browseExamplesButton.clicked.connect(onClick); +examplesWindow.visibleChanged.connect(onExamplesWindowVisibilityChanged); Script.scriptEnding.connect(function () { - browseExamplesButton.clicked.disconnect(); + browseExamplesButton.clicked.disconnect(onClick); + examplesWindow.visibleChanged.disconnect(onExamplesWindowVisibilityChanged); }); diff --git a/scripts/system/goto.js b/scripts/system/goto.js index a2ade02a78..4650e72dad 100644 --- a/scripts/system/goto.js +++ b/scripts/system/goto.js @@ -16,14 +16,20 @@ var button = toolBar.addButton({ objectName: "goto", imageURL: Script.resolvePath("assets/images/tools/directory-01.svg"), visible: true, - yOffset: 50, + buttonState: 1, alpha: 0.9, }); - -button.clicked.connect(function(){ + +function onAddressBarShown(visible) { + button.writeProperty('buttonState', visible ? 0 : 1); +} +function onClicked(){ DialogsManager.toggleAddressBar(); -}); +} +button.clicked.connect(onClicked); +DialogsManager.addressBarShown.connect(onAddressBarShown); Script.scriptEnding.connect(function () { - button.clicked.disconnect(); + button.clicked.disconnect(onClicked); + DialogsManager.addressBarShown.disconnect(onAddressBarShown); }); diff --git a/scripts/system/hmd.js b/scripts/system/hmd.js index 2965c0d254..0d6a273975 100644 --- a/scripts/system/hmd.js +++ b/scripts/system/hmd.js @@ -20,23 +20,28 @@ var desktopMenuItemName = "Desktop"; var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var button; - +function onHmdChanged(isHmd) { + button.writeProperty('buttonState', isHmd ? 0 : 1); +} +function onClicked(){ + var isDesktop = Menu.isOptionChecked(desktopMenuItemName); + Menu.setIsOptionChecked(isDesktop ? headset : desktopMenuItemName, true); +} if (headset) { button = toolBar.addButton({ objectName: "hmdToggle", imageURL: Script.resolvePath("assets/images/tools/hmd-switch-01.svg"), visible: true, - yOffset: 50, alpha: 0.9, }); + onHmdChanged(HMD.active); - button.clicked.connect(function(){ - var isDesktop = Menu.isOptionChecked(desktopMenuItemName); - Menu.setIsOptionChecked(isDesktop ? headset : desktopMenuItemName, true); - }); + button.clicked.connect(onClicked); + HMD.displayModeChanged.connect(onHmdChanged); Script.scriptEnding.connect(function () { - button.clicked.disconnect(); + button.clicked.disconnect(onClicked); + HMD.displayModeChanged.disconnect(onHmdChanged); }); } diff --git a/scripts/system/mute.js b/scripts/system/mute.js index f66b6852ea..f91ecbafae 100644 --- a/scripts/system/mute.js +++ b/scripts/system/mute.js @@ -14,16 +14,25 @@ var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var button = toolBar.addButton({ objectName: "mute", - imageURL: Script.resolvePath("assets/images/tools/microphone.svg"), + imageURL: Script.resolvePath("assets/images/tools/mic-01.svg"), visible: true, alpha: 0.9, }); - -button.clicked.connect(function(){ + +function onMuteToggled() { + // We could just toggle state, but we're less likely to get out of wack if we read the AudioDevice. + // muted => "on" button state => buttonState 1 + button.writeProperty('buttonState', AudioDevice.getMuted() ? 1 : 0); +} +onMuteToggled(); +function onClicked(){ var menuItem = "Mute Microphone"; Menu.setIsOptionChecked(menuItem, !Menu.isOptionChecked(menuItem)); -}); +} +button.clicked.connect(onClicked); +AudioDevice.muteToggled.connect(onMuteToggled); Script.scriptEnding.connect(function () { - button.clicked.disconnect(); + button.clicked.disconnect(onClicked); + AudioDevice.muteToggled.disconnect(onMuteToggled); }); From f03f5f3e683a807c989a569272d080c843021362 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Thu, 30 Jun 2016 16:47:10 -0700 Subject: [PATCH 2/6] new icons --- interface/resources/icons/hud-01.svg | 105 ----- interface/resources/icons/hud.svg | 258 ++++++++++++ interface/resources/qml/hifi/Desktop.qml | 2 +- .../assets/images/tools/directory-01.svg | 194 ---------- .../system/assets/images/tools/directory.svg | 366 ++++++++++++++++++ .../system/assets/images/tools/edit-01.svg | 94 ----- scripts/system/assets/images/tools/edit.svg | 234 +++++++++++ .../assets/images/tools/examples-01.svg | 306 --------------- .../assets/images/tools/hmd-switch-01.svg | 124 ------ scripts/system/assets/images/tools/market.svg | 258 ++++++++++++ scripts/system/assets/images/tools/mic.svg | 164 ++++++++ scripts/system/assets/images/tools/switch.svg | 230 +++++++++++ scripts/system/edit.js | 2 +- scripts/system/examples.js | 2 +- scripts/system/goto.js | 2 +- scripts/system/hmd.js | 2 +- scripts/system/mute.js | 2 +- 17 files changed, 1516 insertions(+), 829 deletions(-) delete mode 100644 interface/resources/icons/hud-01.svg create mode 100644 interface/resources/icons/hud.svg delete mode 100644 scripts/system/assets/images/tools/directory-01.svg create mode 100644 scripts/system/assets/images/tools/directory.svg delete mode 100644 scripts/system/assets/images/tools/edit-01.svg create mode 100644 scripts/system/assets/images/tools/edit.svg delete mode 100644 scripts/system/assets/images/tools/examples-01.svg delete mode 100644 scripts/system/assets/images/tools/hmd-switch-01.svg create mode 100644 scripts/system/assets/images/tools/market.svg create mode 100644 scripts/system/assets/images/tools/mic.svg create mode 100644 scripts/system/assets/images/tools/switch.svg diff --git a/interface/resources/icons/hud-01.svg b/interface/resources/icons/hud-01.svg deleted file mode 100644 index 4929389268..0000000000 --- a/interface/resources/icons/hud-01.svg +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/interface/resources/icons/hud.svg b/interface/resources/icons/hud.svg new file mode 100644 index 0000000000..9e77aa6040 --- /dev/null +++ b/interface/resources/icons/hud.svg @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/interface/resources/qml/hifi/Desktop.qml b/interface/resources/qml/hifi/Desktop.qml index 169542c0f0..7a7a6b63df 100644 --- a/interface/resources/qml/hifi/Desktop.qml +++ b/interface/resources/qml/hifi/Desktop.qml @@ -56,7 +56,7 @@ OriginalDesktop.Desktop { var sysToolbar = desktop.getToolbar("com.highfidelity.interface.toolbar.system"); var toggleHudButton = sysToolbar.addButton({ objectName: "hudToggle", - imageURL: "../../../icons/hud-01.svg", + imageURL: "../../../icons/hud.svg", visible: true, pinned: true, }); diff --git a/scripts/system/assets/images/tools/directory-01.svg b/scripts/system/assets/images/tools/directory-01.svg deleted file mode 100644 index d038611d69..0000000000 --- a/scripts/system/assets/images/tools/directory-01.svg +++ /dev/null @@ -1,194 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/system/assets/images/tools/directory.svg b/scripts/system/assets/images/tools/directory.svg new file mode 100644 index 0000000000..912243c52e --- /dev/null +++ b/scripts/system/assets/images/tools/directory.svg @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/edit-01.svg b/scripts/system/assets/images/tools/edit-01.svg deleted file mode 100644 index c661c6f678..0000000000 --- a/scripts/system/assets/images/tools/edit-01.svg +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/system/assets/images/tools/edit.svg b/scripts/system/assets/images/tools/edit.svg new file mode 100644 index 0000000000..13389a2b14 --- /dev/null +++ b/scripts/system/assets/images/tools/edit.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/examples-01.svg b/scripts/system/assets/images/tools/examples-01.svg deleted file mode 100644 index ec4758dcde..0000000000 --- a/scripts/system/assets/images/tools/examples-01.svg +++ /dev/null @@ -1,306 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/system/assets/images/tools/hmd-switch-01.svg b/scripts/system/assets/images/tools/hmd-switch-01.svg deleted file mode 100644 index 31389d355c..0000000000 --- a/scripts/system/assets/images/tools/hmd-switch-01.svg +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/system/assets/images/tools/market.svg b/scripts/system/assets/images/tools/market.svg new file mode 100644 index 0000000000..fa4a3d7256 --- /dev/null +++ b/scripts/system/assets/images/tools/market.svg @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/assets/images/tools/mic.svg b/scripts/system/assets/images/tools/mic.svg new file mode 100644 index 0000000000..f3afccca70 --- /dev/null +++ b/scripts/system/assets/images/tools/mic.svg @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + MUTE + + + + + + + + + + + + MUTE + + UNMUTE + + + + + + + + + + + + + + + + + + UNMUTE + + diff --git a/scripts/system/assets/images/tools/switch.svg b/scripts/system/assets/images/tools/switch.svg new file mode 100644 index 0000000000..23655d747d --- /dev/null +++ b/scripts/system/assets/images/tools/switch.svg @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/system/edit.js b/scripts/system/edit.js index 9d5585e353..6810bae590 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -192,7 +192,7 @@ var toolBar = (function() { }); activeButton = toolBar.addTool({ - imageURL: toolIconUrl + "edit-01.svg", + imageURL: toolIconUrl + "edit.svg", subImage: { x: 0, y: Tool.IMAGE_WIDTH, diff --git a/scripts/system/examples.js b/scripts/system/examples.js index 4d838bc8af..0ec2644f9c 100644 --- a/scripts/system/examples.js +++ b/scripts/system/examples.js @@ -53,7 +53,7 @@ function toggleExamples() { var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var browseExamplesButton = toolBar.addButton({ - imageURL: toolIconUrl + "examples-01.svg", + imageURL: toolIconUrl + "market.svg", objectName: "examples", buttonState: 1, alpha: 0.9 diff --git a/scripts/system/goto.js b/scripts/system/goto.js index 4650e72dad..24c402ab85 100644 --- a/scripts/system/goto.js +++ b/scripts/system/goto.js @@ -14,7 +14,7 @@ var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var button = toolBar.addButton({ objectName: "goto", - imageURL: Script.resolvePath("assets/images/tools/directory-01.svg"), + imageURL: Script.resolvePath("assets/images/tools/directory.svg"), visible: true, buttonState: 1, alpha: 0.9, diff --git a/scripts/system/hmd.js b/scripts/system/hmd.js index 0d6a273975..305557b60c 100644 --- a/scripts/system/hmd.js +++ b/scripts/system/hmd.js @@ -30,7 +30,7 @@ function onClicked(){ if (headset) { button = toolBar.addButton({ objectName: "hmdToggle", - imageURL: Script.resolvePath("assets/images/tools/hmd-switch-01.svg"), + imageURL: Script.resolvePath("assets/images/tools/switch.svg"), visible: true, alpha: 0.9, }); diff --git a/scripts/system/mute.js b/scripts/system/mute.js index f91ecbafae..cd29e8faae 100644 --- a/scripts/system/mute.js +++ b/scripts/system/mute.js @@ -14,7 +14,7 @@ var toolBar = Toolbars.getToolbar("com.highfidelity.interface.toolbar.system"); var button = toolBar.addButton({ objectName: "mute", - imageURL: Script.resolvePath("assets/images/tools/mic-01.svg"), + imageURL: Script.resolvePath("assets/images/tools/mic.svg"), visible: true, alpha: 0.9, }); From 804a187a7b81928a386b29270d9b1d7fe0af86f7 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 1 Jul 2016 10:17:17 -0700 Subject: [PATCH 3/6] Mute changes. --- scripts/system/assets/images/tools/mic.svg | 121 +++++++++++------- .../system/assets/images/tools/microphone.svg | 13 -- scripts/system/mute.js | 7 +- 3 files changed, 80 insertions(+), 61 deletions(-) delete mode 100644 scripts/system/assets/images/tools/microphone.svg diff --git a/scripts/system/assets/images/tools/mic.svg b/scripts/system/assets/images/tools/mic.svg index f3afccca70..126bb539fc 100644 --- a/scripts/system/assets/images/tools/mic.svg +++ b/scripts/system/assets/images/tools/mic.svg @@ -10,12 +10,7 @@ .st4{filter:url(#Adobe_OpacityMaskFilter_1_);} .st5{mask:url(#SVGID_2_);} .st6{fill:#1E1E1E;} - .st7{fill:none;stroke:#75FF48;stroke-width:0.25;stroke-miterlimit:10;} - .st8{fill:none;} - .st9{fill:#FFFFFF;} - .st10{font-family:'Raleway-Bold';} - .st11{font-size:9px;} - .st12{fill:#333333;} + .st7{fill:#FFFFFF;} @@ -95,9 +90,7 @@ fIzDR8cN4+ibinDd+4E+1lB91Xov/9k=" transform="matrix(1 0 0 1 -2 148)"> - - - + @@ -106,59 +99,97 @@ fIzDR8cN4+ibinDd+4E+1lB91Xov/9k=" transform="matrix(1 0 0 1 -2 148)"> - - MUTE - - - - - + + + + + + + + + - - - - - + + + + + - - MUTE - - UNMUTE + h-2.3l0-1.8C28.9,78.5,31,76.3,31,73.7z"/> + + + + + + + + + + + + + + - - + + c0.4-0.4,0.4-1.1,0-1.5L26.5,13.9z"/> - - + + h-2.3l0-1.8C28.8,28.6,30.9,26.5,30.9,23.8z"/> - - + + c0.4,0.4,1.1,0.4,1.5,0c0.4-0.4,0.4-1.1,0-1.5L26.5,163.8z"/> - - + + h-2.3l0-1.8C28.8,178.6,30.9,176.4,30.9,173.7z"/> + + + + + + + + - - UNMUTE diff --git a/scripts/system/assets/images/tools/microphone.svg b/scripts/system/assets/images/tools/microphone.svg deleted file mode 100644 index bd5e8afac7..0000000000 --- a/scripts/system/assets/images/tools/microphone.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - image/svg+xml - - - Layer 1 - - - - Mute - - - \ No newline at end of file diff --git a/scripts/system/mute.js b/scripts/system/mute.js index cd29e8faae..1a575efa01 100644 --- a/scripts/system/mute.js +++ b/scripts/system/mute.js @@ -16,13 +16,14 @@ var button = toolBar.addButton({ objectName: "mute", imageURL: Script.resolvePath("assets/images/tools/mic.svg"), visible: true, - alpha: 0.9, + buttonState: 1, + alpha: 0.9 }); function onMuteToggled() { // We could just toggle state, but we're less likely to get out of wack if we read the AudioDevice. - // muted => "on" button state => buttonState 1 - button.writeProperty('buttonState', AudioDevice.getMuted() ? 1 : 0); + // muted => button "on" state => 1. go figure. + button.writeProperty('buttonState', AudioDevice.getMuted() ? 0 : 1); } onMuteToggled(); function onClicked(){ From 43c7fd1e27093ca5577c542919b439d14d6373cf Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 1 Jul 2016 10:34:13 -0700 Subject: [PATCH 4/6] New art. --- interface/resources/icons/hud.svg | 309 ++++--------- .../system/assets/images/tools/directory.svg | 427 +++++++----------- scripts/system/assets/images/tools/edit.svg | 243 +++------- scripts/system/assets/images/tools/market.svg | 249 +++------- scripts/system/assets/images/tools/mic.svg | 221 ++++----- scripts/system/assets/images/tools/switch.svg | 295 +++++------- 6 files changed, 583 insertions(+), 1161 deletions(-) diff --git a/interface/resources/icons/hud.svg b/interface/resources/icons/hud.svg index 9e77aa6040..acfd21b909 100644 --- a/interface/resources/icons/hud.svg +++ b/interface/resources/icons/hud.svg @@ -3,140 +3,29 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -144,115 +33,113 @@ vaK3kSYV8RW8iTCviK3kSYV8RW8iTCiPaa0X/wAJMKhq3ZXV/pkbI0eRJfe0h26v/9k=" transform= - - + + - - + - - - + + + - - + + - - + - - - + + + - - + + - - + - - + + + + + + + + + + + + - - - - - - - - - - - - + c-0.4-0.2-0.7-0.4-0.9-0.7c-0.2-0.3-0.4-0.6-0.5-1c-0.1-0.4-0.2-0.8-0.2-1.2v-3.4h1.3v3.4c0,0.3,0,0.5,0.1,0.8 + c0.1,0.3,0.1,0.5,0.3,0.7c0.1,0.2,0.3,0.4,0.5,0.5C25,191.7,25.3,191.8,25.6,191.8z"/> + diff --git a/scripts/system/assets/images/tools/directory.svg b/scripts/system/assets/images/tools/directory.svg index 912243c52e..09f3c14bf0 100644 --- a/scripts/system/assets/images/tools/directory.svg +++ b/scripts/system/assets/images/tools/directory.svg @@ -3,364 +3,253 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - + + + c-0.2-0.1-0.5-0.2-0.7-0.2c-0.3,0-0.5,0.1-0.8,0.2s-0.4,0.3-0.6,0.5c-0.2,0.2-0.3,0.4-0.3,0.7C33.7,38.5,33.7,38.8,33.7,39.1z"/> - + C16.6,17.2,16.5,17.1,16.6,17z M16,18.2L16,18.2c0-0.2,0.1-0.2,0.2-0.2l3.3,0.8c0.1,0,0.1,0.1,0.1,0.2l0.1,4.7 + c0,0.1,0,0.1-0.1,0.1h-0.1l0,0h-0.1h-0.1l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.6,129.4,21.6,129.4,21.5,129.5z M24.2,130.1c0,0.1-0.1,0.1-0.1,0.1 + H24c0,0,0,0-0.1,0c0,0-0.9-0.3-1.3-0.8c-1-1.3-1.5-2.7-1.9-4l0,0v-0.1c0-0.1,0-0.1,0-0.1l0.1-0.1h0.1l1.9,0.2l1.2,0.1 + c0.1,0,0.2,0.1,0.2,0.2L24.2,130.1L24.2,130.1z M22.8,119.3l1.2,0.1c0.1,0,0.2,0.1,0.2,0.2v5c0,0,0,0.1-0.1,0.1H24l0,0 + c0,0-0.9-0.1-1.4-0.1c-0.6,0-1.2-0.1-1.7-0.2c-0.2,0-0.4-0.3-0.4-0.4c-0.1-1.2-0.1-2.3-0.2-3.1c0-0.3,0-1.4,0-1.5s0-0.1,0.1-0.1 + c0,0,0.1-0.1,0.1,0H22.8z M16.4,117.1L16.4,117.1c0.8-2.1,2.8-3.9,5-4.7l0.2-0.1c0.1,0,0.2,0,0.2,0.1s0,0.1,0,0.2l-0.1,0.2 + c-1.2,1.6-1.7,3.5-2,5.3v0.1c0,0,0,0.1-0.1,0.1h-0.1c0,0,0,0-0.1,0h-0.1c-0.4-0.1-0.7-0.2-1.1-0.3c-0.6-0.1-1.2-0.3-1.8-0.5h-0.1 + C16.4,117.3,16.3,117.2,16.4,117.1z M15.8,118.3L15.8,118.3c0-0.2,0.1-0.2,0.2-0.2l3.3,0.8c0.1,0,0.1,0.1,0.1,0.2l0.1,4.7 + c0,0.1,0,0.1-0.1,0.1h-0.1l0,0h-0.1h-0.1l0,0c-0.1,0-0.3-0.1-0.5-0.1c-1.1-0.3-1.9-0.6-2.6-1.1c-0.4-0.3-0.6-0.6-0.6-1 + C15.4,120.6,15.5,119.4,15.8,118.3z"/> - + - - - - + C18.9,188.7,18.9,189,18.9,189.3z"/> + + - + C30,174.1,30,174.1,30,173.9L30,173.9z M30.1,175.1c0.8-0.2,1.5-0.4,2.3-0.6l0.9-0.3c0.1,0,0.1,0,0.2,0.1c0,0,0.1,0.1,0,0.2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.2c0,0.1-0.1,0.1-0.1,0.1 + H24c0,0,0,0-0.1,0c0,0-0.9-0.3-1.3-0.8c-1-1.3-1.5-2.7-1.9-4l0,0v-0.1c0-0.1,0-0.1,0-0.1l0.1-0.1h0.1l1.9,0.2l1.2,0.1 + c0.1,0,0.2,0.1,0.2,0.2L24.2,180.2L24.2,180.2z M22.8,169.4l1.2,0.1c0.1,0,0.2,0.1,0.2,0.2v5c0,0,0,0.1-0.1,0.1H24l0,0 + c0,0-0.9-0.1-1.4-0.1c-0.6,0-1.2-0.1-1.7-0.2c-0.2,0-0.4-0.3-0.4-0.4c-0.1-1.2-0.1-2.3-0.2-3.1c0-0.3,0-1.4,0-1.5 + c0-0.1,0-0.1,0.1-0.1c0,0,0.1-0.1,0.1,0H22.8z M16.4,167.2L16.4,167.2c0.8-2.1,2.8-3.9,5-4.7l0.2-0.1c0.1,0,0.2,0,0.2,0.1 + c0,0.1,0,0.1,0,0.2l-0.1,0.2c-1.2,1.6-1.7,3.5-2,5.3v0.1c0,0,0,0.1-0.1,0.1h-0.1c0,0,0,0-0.1,0h-0.1c-0.4-0.1-0.7-0.2-1.1-0.3 + c-0.6-0.1-1.2-0.3-1.8-0.5h-0.1C16.4,167.4,16.3,167.3,16.4,167.2z M15.8,168.4L15.8,168.4c0-0.2,0.1-0.2,0.2-0.2l3.3,0.8 + c0.1,0,0.1,0.1,0.1,0.2l0.1,4.7c0,0.1,0,0.1-0.1,0.1h-0.1l0,0h-0.1h-0.1l0,0c-0.1,0-0.3-0.1-0.5-0.1c-1.1-0.3-1.9-0.6-2.6-1.1 + c-0.4-0.3-0.6-0.6-0.6-1C15.4,170.7,15.5,169.5,15.8,168.4z"/> - + diff --git a/scripts/system/assets/images/tools/edit.svg b/scripts/system/assets/images/tools/edit.svg index 13389a2b14..f65e0cd84d 100644 --- a/scripts/system/assets/images/tools/edit.svg +++ b/scripts/system/assets/images/tools/edit.svg @@ -3,232 +3,121 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + + c0,0,0.1,0,0.1,0c0.1-0.4,0.2-0.8,0.2-1.3C37.2,21.7,33.7,18.9,30.2,19.9z M17.5,11.5c-0.4,0-0.7-0.3-0.7-0.7 + c0-0.4,0.3-0.8,0.7-0.8c0.4,0,0.8,0.4,0.8,0.7C18.3,11.1,17.9,11.5,17.5,11.5z M27.9,13.8c0.3,0.3,0.6,0.7,1,1 + c-0.7,0.7-1.4,1.4-2.1,2.1c-0.3-0.3-0.7-0.7-1-1C26.5,15.2,27.2,14.5,27.9,13.8z"/> - - + - - + c0.2-0.1,0.4-0.3,0.6-0.4s0.3-0.4,0.4-0.7C24.2,39.8,24.2,39.5,24.2,39.2z"/> + + - - - + + + c0,0,0.1,0,0.1,0c0.1-0.4,0.2-0.8,0.2-1.3C37.2,71.7,33.8,68.9,30.3,69.9z M17.6,61.5c-0.4,0-0.7-0.3-0.7-0.7 + c0-0.4,0.3-0.8,0.7-0.8c0.4,0,0.8,0.4,0.8,0.7C18.3,61.1,18,61.5,17.6,61.5z M28,63.8c0.3,0.3,0.6,0.7,1,1 + c-0.7,0.7-1.4,1.4-2.1,2.1c-0.3-0.3-0.7-0.7-1-1C26.6,65.2,27.3,64.5,28,63.8z"/> - - + - - + c0.2-0.1,0.4-0.3,0.6-0.4s0.3-0.4,0.4-0.7C24.2,89.8,24.2,89.5,24.2,89.2z"/> + + - - - + + + c0,0,0.1,0,0.1,0c0.1-0.4,0.2-0.8,0.2-1.3C37.1,121.8,33.7,119,30.2,120z M17.5,111.5c-0.4,0-0.7-0.3-0.7-0.7 + c0-0.4,0.3-0.8,0.7-0.8c0.4,0,0.8,0.4,0.8,0.7C18.2,111.2,17.9,111.5,17.5,111.5z M27.9,113.9c0.3,0.3,0.6,0.7,1,1 + c-0.7,0.7-1.4,1.4-2.1,2.1c-0.3-0.3-0.7-0.7-1-1C26.5,115.3,27.2,114.6,27.9,113.9z"/> - - - - + + + + - - - + + + c0,0,0.1,0,0.1,0c0.1-0.4,0.2-0.8,0.2-1.3C37.1,171.9,33.7,169,30.2,170.1z M17.4,161.6c-0.4,0-0.7-0.3-0.7-0.7 + c0-0.4,0.3-0.8,0.7-0.8c0.4,0,0.8,0.4,0.8,0.7C18.2,161.2,17.8,161.6,17.4,161.6z M27.8,164c0.3,0.3,0.6,0.7,1,1 + c-0.7,0.7-1.4,1.4-2.1,2.1c-0.3-0.3-0.7-0.7-1-1C26.4,165.4,27.1,164.7,27.8,164z"/> - - - - + + + + diff --git a/scripts/system/assets/images/tools/market.svg b/scripts/system/assets/images/tools/market.svg index fa4a3d7256..0cec030933 100644 --- a/scripts/system/assets/images/tools/market.svg +++ b/scripts/system/assets/images/tools/market.svg @@ -3,158 +3,47 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + - - - + c-0.1-0.1-0.2-0.2-0.3-0.2C24,37.1,23.9,37,23.8,37h-1.5V39.1z"/> + + + - - - + c-0.1-0.2-0.1-0.4-0.2-0.6c-0.1-0.2-0.1-0.4-0.2-0.7l-0.2-0.6H32.1z"/> + + - - - + + - - - + c-0.1-0.1-0.2-0.2-0.3-0.2C24,87.1,23.9,87,23.8,87h-1.5V89.1z"/> + + + - - - + c-0.1-0.2-0.1-0.4-0.2-0.6c-0.1-0.2-0.1-0.4-0.2-0.7l-0.2-0.6H32.1z"/> + + - - - + + - - - + c-0.1-0.1-0.2-0.2-0.3-0.2c-0.1-0.1-0.2-0.1-0.3-0.1h-1.5V139.2z"/> + + + - - - + c-0.1-0.6-0.3-1.3-0.5-2c-0.1-0.2-0.1-0.4-0.2-0.6c-0.1-0.2-0.1-0.4-0.2-0.7l-0.2-0.6H32z"/> + + - - - - - - + + + + + + - - - + c-0.1-0.6-0.3-1.3-0.5-2c-0.1-0.2-0.1-0.4-0.2-0.6c-0.1-0.2-0.1-0.4-0.2-0.7l-0.2-0.6H32z"/> + + diff --git a/scripts/system/assets/images/tools/mic.svg b/scripts/system/assets/images/tools/mic.svg index 126bb539fc..0424f3eb49 100644 --- a/scripts/system/assets/images/tools/mic.svg +++ b/scripts/system/assets/images/tools/mic.svg @@ -3,193 +3,124 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + + + - + - - + - - + c-0.4-0.2-0.6-0.4-0.9-0.7c-0.2-0.3-0.4-0.6-0.5-1c-0.1-0.4-0.1-0.8-0.1-1.2v-3.3H22v3.3c0,0.3,0,0.5,0.1,0.8 + c0.1,0.2,0.1,0.5,0.3,0.7c0.1,0.2,0.3,0.3,0.5,0.5S23.2,191.8,23.5,191.8z"/> + + - - - - - + + + + - - - - - + + + + + + h-2.3l0-1.8C28.6,79,30.7,76.9,30.7,74.2z"/> - - + + + + + + + + + - - - - - - - - - - + c0.1,0.2,0.1,0.5,0.3,0.7s0.3,0.3,0.5,0.5S30.1,41.9,30.4,41.9z"/> + + - - + + - - + + c0,2.6,2.1,4.8,4.8,5.2l0,1.8h-2.2c-0.5,0-0.9,0.4-0.9,0.9c0,0.5,0.4,0.9,0.9,0.9H28c0.5,0,0.9-0.4,0.9-0.9c0-0.5-0.4-0.9-0.9-0.9 + h-2.3l0-1.8C28.5,29.2,30.6,27,30.6,24.4z"/> - - + + c0.4,0.4,1.1,0.4,1.5,0c0.4-0.4,0.4-1.1,0-1.5L26.1,164.3z"/> - - + + c0,2.6,2.1,4.8,4.8,5.2l0,1.8h-2.2c-0.5,0-0.9,0.4-0.9,0.9c0,0.5,0.4,0.9,0.9,0.9H28c0.5,0,0.9-0.4,0.9-0.9c0-0.5-0.4-0.9-0.9-0.9 + h-2.3l0-1.8C28.5,179.1,30.6,176.9,30.6,174.3z"/> - - - - + + + - - + s-0.6-0.4-0.9-0.7c-0.2-0.3-0.4-0.6-0.5-1c-0.1-0.4-0.1-0.8-0.1-1.2v-3.3h1.2v3.3c0,0.3,0,0.5,0.1,0.8c0.1,0.2,0.1,0.5,0.3,0.7 + c0.1,0.2,0.3,0.3,0.5,0.5S30,141.9,30.3,141.9z"/> + + diff --git a/scripts/system/assets/images/tools/switch.svg b/scripts/system/assets/images/tools/switch.svg index 23655d747d..e67a9aac04 100644 --- a/scripts/system/assets/images/tools/switch.svg +++ b/scripts/system/assets/images/tools/switch.svg @@ -3,228 +3,165 @@ - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + - + - - - - - - - - - - - - - - - - - + + + - - - - + + + + + + + + + + + + + + + - - + + - - - + + + - - - - + + + + - - + + - - - + + + - - - - + + + + - + C31.3,190.2,31.3,189.8,31.3,189.4z"/> + + + From 02cc6cc567150909587d9f09c39882b354f5c4a3 Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 1 Jul 2016 12:18:26 -0700 Subject: [PATCH 5/6] hover states --- .../qml/hifi/toolbars/ToolbarButton.qml | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/toolbars/ToolbarButton.qml b/interface/resources/qml/hifi/toolbars/ToolbarButton.qml index a3be4533d2..4356b18253 100644 --- a/interface/resources/qml/hifi/toolbars/ToolbarButton.qml +++ b/interface/resources/qml/hifi/toolbars/ToolbarButton.qml @@ -8,6 +8,7 @@ Item { property var subImage; property int yOffset: 0 property int buttonState: 0 + property int hoverOffset: 0 property var toolbar; property real size: 50 // toolbar ? toolbar.buttonSize : 50 width: size; height: size @@ -36,9 +37,15 @@ Item { } } - + function updateOffset() { + yOffset = size * (buttonState + hoverOffset); + } onButtonStateChanged: { - yOffset = size * buttonState + hoverOffset = 0; // subtle: show the new state without hover. don't wait for mouse to be moved away + // The above is per UX design, but ALSO avoid a subtle issue that would be a problem because + // the hand controllers don't move the mouse when not triggered, so releasing the trigger would + // never show unhovered. + updateOffset(); } Component.onCompleted: { @@ -58,8 +65,18 @@ Item { } MouseArea { + id: mouseArea + hoverEnabled: true anchors.fill: parent onClicked: button.clicked(); + onEntered: { + hoverOffset = 2; + updateOffset(); + } + onExited: { + hoverOffset = 0; + updateOffset(); + } } } From 1ad9cfde99c3a882537f3d39c4f1821939fde12f Mon Sep 17 00:00:00 2001 From: howard-stearns Date: Fri, 1 Jul 2016 13:54:00 -0700 Subject: [PATCH 6/6] make hud button participate in buttonState just like other toolbar chicklets --- interface/resources/qml/hifi/Desktop.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/resources/qml/hifi/Desktop.qml b/interface/resources/qml/hifi/Desktop.qml index 7a7a6b63df..561bd722f2 100644 --- a/interface/resources/qml/hifi/Desktop.qml +++ b/interface/resources/qml/hifi/Desktop.qml @@ -61,8 +61,8 @@ OriginalDesktop.Desktop { pinned: true, }); - toggleHudButton.yOffset = Qt.binding(function(){ - return desktop.pinned ? 50 : 0 + toggleHudButton.buttonState = Qt.binding(function(){ + return desktop.pinned ? 1 : 0 }); toggleHudButton.clicked.connect(function(){ console.log("Clicked on hud button")