mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 18:21:16 +02:00
Added settings controls sounds
This commit is contained in:
parent
5a452fa981
commit
b5f0c4d940
5 changed files with 46 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4 as Original
|
import QtQuick.Controls 1.4 as Original
|
||||||
import QtQuick.Controls.Styles 1.4
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
import "../styles-uit"
|
import "../styles-uit"
|
||||||
|
|
||||||
|
@ -23,6 +24,16 @@ Original.Button {
|
||||||
|
|
||||||
HifiConstants { id: hifi }
|
HifiConstants { id: hifi }
|
||||||
|
|
||||||
|
onHoveredChanged: {
|
||||||
|
if (hovered) {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonHover)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonClick)
|
||||||
|
}
|
||||||
|
|
||||||
style: ButtonStyle {
|
style: ButtonStyle {
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
import QtQuick.Controls 1.4 as Original
|
import QtQuick.Controls 1.4 as Original
|
||||||
import QtQuick.Controls.Styles 1.4
|
import QtQuick.Controls.Styles 1.4
|
||||||
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
import "../styles-uit"
|
import "../styles-uit"
|
||||||
|
|
||||||
|
@ -24,6 +25,16 @@ Original.Button {
|
||||||
width: 120
|
width: 120
|
||||||
height: 28
|
height: 28
|
||||||
|
|
||||||
|
onHoveredChanged: {
|
||||||
|
if (hovered) {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonHover)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonClick)
|
||||||
|
}
|
||||||
|
|
||||||
style: ButtonStyle {
|
style: ButtonStyle {
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
import "../../controls-uit"
|
import "../../controls-uit"
|
||||||
|
|
||||||
|
@ -22,7 +23,16 @@ Preference {
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: button
|
id: button
|
||||||
onClicked: preference.trigger()
|
onHoveredChanged: {
|
||||||
|
if (hovered) {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonHover)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
preference.trigger()
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonClick)
|
||||||
|
}
|
||||||
width: 180
|
width: 180
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
|
import TabletScriptingInterface 1.0
|
||||||
|
|
||||||
import "../../controls-uit"
|
import "../../controls-uit"
|
||||||
|
|
||||||
|
@ -38,6 +39,16 @@ Preference {
|
||||||
|
|
||||||
CheckBox {
|
CheckBox {
|
||||||
id: checkBox
|
id: checkBox
|
||||||
|
onHoveredChanged: {
|
||||||
|
if (hovered) {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonHover)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
tabletInterface.playSound(TabletEnums.ButtonClick)
|
||||||
|
}
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
top: spacer.bottom
|
top: spacer.bottom
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
|
|
@ -2310,6 +2310,8 @@ void Application::initializeUi() {
|
||||||
|
|
||||||
surfaceContext->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
surfaceContext->setContextProperty("Account", AccountScriptingInterface::getInstance());
|
||||||
surfaceContext->setContextProperty("Tablet", DependencyManager::get<TabletScriptingInterface>().data());
|
surfaceContext->setContextProperty("Tablet", DependencyManager::get<TabletScriptingInterface>().data());
|
||||||
|
// Tablet inteference with Tablet.qml. Need to avoid this in QML space
|
||||||
|
surfaceContext->setContextProperty("tabletInterface", DependencyManager::get<TabletScriptingInterface>().data());
|
||||||
surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
|
surfaceContext->setContextProperty("DialogsManager", _dialogsManagerScriptingInterface);
|
||||||
surfaceContext->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
surfaceContext->setContextProperty("GlobalServices", GlobalServicesScriptingInterface::getInstance());
|
||||||
surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
|
surfaceContext->setContextProperty("FaceTracker", DependencyManager::get<DdeFaceTracker>().data());
|
||||||
|
|
Loading…
Reference in a new issue