mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-03 13:01:10 +02:00
commit
72da05bb30
2 changed files with 48 additions and 4 deletions
|
@ -47,7 +47,7 @@ Item {
|
||||||
id: myInfo
|
id: myInfo
|
||||||
// Size
|
// Size
|
||||||
width: pal.width
|
width: pal.width
|
||||||
height: myCardHeight
|
height: myCardHeight + 20
|
||||||
// Anchors
|
// Anchors
|
||||||
anchors.top: pal.top
|
anchors.top: pal.top
|
||||||
// Properties
|
// Properties
|
||||||
|
@ -217,6 +217,46 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Refresh button
|
||||||
|
Rectangle {
|
||||||
|
// Size
|
||||||
|
width: hifi.dimensions.tableHeaderHeight-1
|
||||||
|
height: hifi.dimensions.tableHeaderHeight-1
|
||||||
|
// Anchors
|
||||||
|
anchors.left: table.left
|
||||||
|
anchors.leftMargin: 4
|
||||||
|
anchors.top: table.top
|
||||||
|
// Style
|
||||||
|
color: hifi.colors.tableBackgroundLight
|
||||||
|
// Actual refresh icon
|
||||||
|
HiFiGlyphs {
|
||||||
|
id: reloadButton
|
||||||
|
text: hifi.glyphs.reloadSmall
|
||||||
|
// Size
|
||||||
|
size: parent.width*1.5
|
||||||
|
// Anchors
|
||||||
|
anchors.fill: parent
|
||||||
|
// Style
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
color: hifi.colors.darkGray
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
id: reloadButtonArea
|
||||||
|
// Anchors
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
// Everyone likes a responsive refresh button!
|
||||||
|
// So use onPressed instead of onClicked
|
||||||
|
onPressed: {
|
||||||
|
reloadButton.color = hifi.colors.lightGrayText
|
||||||
|
pal.sendToScript({method: 'refresh'})
|
||||||
|
}
|
||||||
|
onReleased: reloadButton.color = (containsMouse ? hifi.colors.baseGrayHighlight : hifi.colors.darkGray)
|
||||||
|
onEntered: reloadButton.color = hifi.colors.baseGrayHighlight
|
||||||
|
onExited: reloadButton.color = (pressed ? hifi.colors.lightGrayText: hifi.colors.darkGray)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Separator between user and admin functions
|
// Separator between user and admin functions
|
||||||
Rectangle {
|
Rectangle {
|
||||||
// Size
|
// Size
|
||||||
|
|
|
@ -94,6 +94,10 @@ pal.fromQml.connect(function (message) { // messages are {method, params}, like
|
||||||
overlay.select(selected);
|
overlay.select(selected);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
case 'refresh':
|
||||||
|
removeOverlays();
|
||||||
|
populateUserList();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
print('Unrecognized message from Pal.qml:', JSON.stringify(message));
|
||||||
}
|
}
|
||||||
|
@ -313,13 +317,13 @@ Script.setInterval(function () {
|
||||||
//
|
//
|
||||||
// Button state.
|
// Button state.
|
||||||
//
|
//
|
||||||
function onVisibileChanged() {
|
function onVisibleChanged() {
|
||||||
button.writeProperty('buttonState', pal.visible ? 0 : 1);
|
button.writeProperty('buttonState', pal.visible ? 0 : 1);
|
||||||
button.writeProperty('defaultState', pal.visible ? 0 : 1);
|
button.writeProperty('defaultState', pal.visible ? 0 : 1);
|
||||||
button.writeProperty('hoverState', pal.visible ? 2 : 3);
|
button.writeProperty('hoverState', pal.visible ? 2 : 3);
|
||||||
}
|
}
|
||||||
button.clicked.connect(onClicked);
|
button.clicked.connect(onClicked);
|
||||||
pal.visibleChanged.connect(onVisibileChanged);
|
pal.visibleChanged.connect(onVisibleChanged);
|
||||||
pal.closed.connect(off);
|
pal.closed.connect(off);
|
||||||
Users.usernameFromIDReply.connect(usernameFromIDReply);
|
Users.usernameFromIDReply.connect(usernameFromIDReply);
|
||||||
|
|
||||||
|
@ -329,7 +333,7 @@ Users.usernameFromIDReply.connect(usernameFromIDReply);
|
||||||
Script.scriptEnding.connect(function () {
|
Script.scriptEnding.connect(function () {
|
||||||
button.clicked.disconnect(onClicked);
|
button.clicked.disconnect(onClicked);
|
||||||
toolBar.removeButton(buttonName);
|
toolBar.removeButton(buttonName);
|
||||||
pal.visibleChanged.disconnect(onVisibileChanged);
|
pal.visibleChanged.disconnect(onVisibleChanged);
|
||||||
pal.closed.disconnect(off);
|
pal.closed.disconnect(off);
|
||||||
Users.usernameFromIDReply.disconnect(usernameFromIDReply);
|
Users.usernameFromIDReply.disconnect(usernameFromIDReply);
|
||||||
off();
|
off();
|
||||||
|
|
Loading…
Reference in a new issue