Hanoi-Towers/HanoiTowers/client/menu/UserTableRow.qml

76 lines
1.6 KiB
QML
Raw Normal View History

//#
//# Copyright (C) 2018 - 2021 QuasarApp.
//# Distributed under the lgplv3 software license, see the accompanying
//# Everyone is permitted to copy and distribute verbatim copies
//# of this license document, but changing it is not allowed.
//#
2020-11-04 23:37:20 +03:00
import QtQuick 2.15
2019-11-11 23:36:18 +03:00
import QtQuick.Layouts 1.3
2020-11-04 23:37:20 +03:00
import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.15
import QtQuick.Window 2.15
2019-11-12 20:13:09 +03:00
Item {
2019-11-20 17:55:13 +03:00
id: row
2019-11-11 23:36:18 +03:00
property string name: ""
2021-03-16 12:06:39 +03:00
property int number: 0
2020-11-04 23:37:20 +03:00
property string points: "0"
2019-11-20 17:55:13 +03:00
property bool selected: false
height: source.height
signal removedRow();
signal onlineRowChanged(var online);
2019-11-20 17:55:13 +03:00
signal clicked();
Rectangle {
color: (selected)? "#3700f991" : "#0000f991"
anchors.fill: parent;
Behavior on color {
ColorAnimation {
duration: 500
}
}
}
2019-11-11 23:36:18 +03:00
2019-11-12 20:13:09 +03:00
RowLayout {
id : source
anchors.left: parent.left
anchors.right: parent.right
2019-11-11 23:36:18 +03:00
2021-03-16 12:06:39 +03:00
TextField {
readOnly: true;
text: number
TextMetrics {
id: textMetrics
text: "9999"
}
Layout.preferredWidth: textMetrics.advanceWidth
}
2019-11-12 20:13:09 +03:00
TextField {
Layout.fillWidth: true
readOnly: true;
text: name
2019-11-20 17:55:13 +03:00
onFocusChanged: {
if (focus)
row.clicked();
}
2019-11-12 20:13:09 +03:00
}
2019-11-11 23:36:18 +03:00
2020-11-04 23:37:20 +03:00
TextField {
text: points
readOnly: true;
Layout.minimumWidth: 5 * Screen.pixelDensity
2019-11-12 20:13:09 +03:00
}
2019-11-11 23:36:18 +03:00
}
}
2019-11-12 20:13:09 +03:00