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