mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Merge pull request #9301 from fayeli/tablet-button-states
Tablet Button Active State's Text and Icon
This commit is contained in:
commit
c972e9ac51
2 changed files with 12 additions and 5 deletions
|
@ -6,6 +6,8 @@ Item {
|
|||
property var uuid;
|
||||
property string text: "EDIT"
|
||||
property string icon: "icons/edit-icon.svg"
|
||||
property string activeText: tabletButton.text
|
||||
property string activeIcon: tabletButton.icon
|
||||
property bool isActive: false
|
||||
property bool inDebugMode: false
|
||||
property bool isEntered: false
|
||||
|
@ -170,12 +172,18 @@ Item {
|
|||
PropertyChanges {
|
||||
target: text
|
||||
color: "#333333"
|
||||
text: tabletButton.activeText
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: iconColorOverlay
|
||||
color: "#333333"
|
||||
}
|
||||
|
||||
PropertyChanges {
|
||||
target: icon
|
||||
source: "../../../" + tabletButton.activeIcon
|
||||
}
|
||||
},
|
||||
State {
|
||||
name: "hover active state"
|
||||
|
|
|
@ -15,16 +15,15 @@
|
|||
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
|
||||
function muteURL() {
|
||||
return "icons/tablet-icons/" + (AudioDevice.getMuted() ? "mic-a.svg" : "mic-i.svg");
|
||||
}
|
||||
var button = tablet.addButton({
|
||||
icon: "icons/tablet-icons/mic-a.svg",
|
||||
text: "MUTE"
|
||||
text: "MUTE",
|
||||
activeIcon: "icons/tablet-icons/mic-i.svg",
|
||||
activeText: "UNMUTE"
|
||||
});
|
||||
|
||||
function onMuteToggled() {
|
||||
button.editProperties({icon: muteURL()});
|
||||
button.editProperties({isActive: AudioDevice.getMuted()});
|
||||
}
|
||||
onMuteToggled();
|
||||
function onClicked(){
|
||||
|
|
Loading…
Reference in a new issue