Initial replacement of status text with status icons on the PC view

This commit is contained in:
Cameron Gutman
2018-08-05 11:47:14 -07:00
parent b04bc5117d
commit 1dcf55515b
5 changed files with 27 additions and 32 deletions
+12 -32
View File
@@ -98,6 +98,18 @@ GridView {
}
}
Image {
// TODO: Tooltip
id: stateIcon
anchors.centerIn: pcIcon // TODO: Center within screen
visible: !model.addPc && (!model.online || !model.paired)
source: !model.online ? "qrc:/res/baseline-warning-24px.svg" : "qrc:/res/baseline-lock-24px.svg"
sourceSize {
width: 50
height: 50
}
}
Text {
id: pcNameText
text: model.name
@@ -110,38 +122,6 @@ GridView {
wrapMode: Text.Wrap
}
Text {
function getStatusText(model)
{
if (model.online) {
var text = "<font color=\"green\">Online</font>"
text += "<font color=\"white\"> - </font>"
if (model.paired) {
text += "<font color=\"skyblue\">Paired</font>"
}
else if (model.busy) {
text += "<font color=\"red\">Busy</font>"
}
else {
text += "<font color=\"red\">Not Paired</font>"
}
return text
}
else {
return "<font color=\"red\">Offline</font>";
}
}
id: pcPairedText
text: getStatusText(model)
visible: !model.addPc
width: parent.width
anchors.top: pcNameText.bottom
font.pointSize: 24
horizontalAlignment: Text.AlignHCenter
}
Menu {
id: pcContextMenu
MenuItem {