mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
Checkboxes!
This commit is contained in:
parent
9b65a72bb5
commit
0be4db1e68
3 changed files with 16 additions and 20 deletions
|
@ -21,7 +21,7 @@ Original.CheckBox {
|
|||
property int colorScheme: hifi.colorSchemes.light
|
||||
readonly property bool isLightColorScheme: colorScheme == hifi.colorSchemes.light
|
||||
|
||||
readonly property int boxSize: 14
|
||||
property int boxSize: 14
|
||||
readonly property int boxRadius: 3
|
||||
readonly property int checkSize: 10
|
||||
readonly property int checkRadius: 2
|
||||
|
|
|
@ -67,7 +67,7 @@ Row {
|
|||
}
|
||||
|
||||
// UserName Text
|
||||
FiraSansSemiBold {
|
||||
FiraSansRegular {
|
||||
id: userNameText;
|
||||
// Properties
|
||||
text: thisNameCard.userName;
|
||||
|
|
|
@ -172,25 +172,21 @@ Item {
|
|||
// Anchors
|
||||
anchors.left: parent.left;
|
||||
}
|
||||
// This Rectangle refers to the cells that contain the action buttons
|
||||
Rectangle {
|
||||
radius: itemCell.height / 4;
|
||||
|
||||
// This CheckBox belongs in the columns that contain the action buttons ("Mute", "Ban", etc)
|
||||
HifiControls.CheckBox {
|
||||
visible: isCheckBox && !isSeparator;
|
||||
color: styleData.value ? "green" : "red";
|
||||
anchors.fill: parent;
|
||||
MouseArea {
|
||||
anchors.fill: parent;
|
||||
acceptedButtons: Qt.LeftButton;
|
||||
hoverEnabled: true;
|
||||
onClicked: {
|
||||
var newValue = !model[styleData.role];
|
||||
var datum = userData[model.userIndex];
|
||||
datum[styleData.role] = model[styleData.role] = newValue;
|
||||
Users[styleData.role](model.sessionId);
|
||||
// Just for now, while we cannot undo things:
|
||||
userData.splice(model.userIndex, 1);
|
||||
sortModel();
|
||||
}
|
||||
anchors.centerIn: parent;
|
||||
colorScheme: hifi.colorSchemes.dark;
|
||||
boxSize: 22;
|
||||
onClicked: {
|
||||
var newValue = !model[styleData.role];
|
||||
var datum = userData[model.userIndex];
|
||||
datum[styleData.role] = model[styleData.role] = newValue;
|
||||
Users[styleData.role](model.sessionId);
|
||||
// Just for now, while we cannot undo things:
|
||||
userData.splice(model.userIndex, 1);
|
||||
sortModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue