More progress

This commit is contained in:
Zach Fox 2016-12-19 15:31:43 -08:00
parent deb40f67df
commit e7c2229b2c
3 changed files with 99 additions and 23 deletions

View file

@ -9,16 +9,18 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
import Hifi 1.0
import Hifi 1.0 as Hifi
import QtQuick 2.5
import "../styles-uit"
Row {
id: thisNameCard;
// Spacing
spacing: 5;
// Margins
anchors.leftMargin: 5;
spacing: 10;
// Anchors
//anchors.topMargin: 10;
anchors.leftMargin: 10;
//anchors.verticalCenter: parent.verticalCenter
// Properties
property string displayName: "";
@ -29,19 +31,24 @@ Row {
Column {
id: avatarImage;
// Size
width: parent.height - 2;
width: 50;
height: width;
Rectangle {
anchors.fill: parent;
radius: parent.width*0.5;
color: "#AAA5AD";
// Anchors
width: parent.width
height: parent.height;
}
}
Column {
id: textContainer;
// Size
width: parent.width - avatarImage.width;
width: parent.width - avatarImage.width - parent.anchors.leftMargin*2 - parent.spacing;
// Anchors
anchors.verticalCenter: parent.verticalCenter;
// DisplayName Text
RalewaySemiBold {
id: displayNameText;
// Properties
@ -54,6 +61,8 @@ Row {
// Text Positioning
verticalAlignment: Text.AlignVCenter;
}
// UserName Text
RalewayLight {
id: userNameText;
// Properties
@ -67,5 +76,71 @@ Row {
// Text Positioning
verticalAlignment: Text.AlignVCenter;
}
// Spacer
Item {
height: 7;
width: parent.width;
}
// VU Meter
Hifi.AvatarInputs {
id: nameCardVUMeter;
objectName: "AvatarInputs";
width: parent.width;
height: 30;
// Avatar Audio VU Meter
Item {
id: controls;
width: nameCardVUMeter.width;
Rectangle {
anchors.fill: parent;
color: nameCardVUMeter.audioClipping ? "red" : "#696969";
Item {
id: audioMeter
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
anchors.leftMargin: nameCardVUMeter.iconPadding
anchors.right: parent.right
anchors.rightMargin: nameCardVUMeter.iconPadding
height: 8
Rectangle {
id: blueRect
color: "blue"
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
width: parent.width / 4
}
Rectangle {
id: greenRect
color: "green"
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: blueRect.right
anchors.right: redRect.left
}
Rectangle {
id: redRect
color: "red"
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
width: parent.width / 5
}
Rectangle {
z: 100
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
width: (1.0 - nameCardVUMeter.audioLevel) * parent.width
color: "#dddddd";
}
}
}
}
}
}
}

View file

@ -36,10 +36,10 @@ Rectangle {
height: parent.height;
// Properties
property int myCardHeight: 75;
property int rowHeight: 50;
property int nameCardWidth: width*3/5;
property int rowHeight: 65;
property int separatorColWidth: 30;
property int actionWidth: (width - nameCardWidth - separatorColWidth) / (table.columnCount - 2); // "-2" for Name and Separator cols
property int actionButtonWidth: 50;
property int nameCardWidth: width - separatorColWidth- actionButtonWidth*(table.columnCount - 2); // "-2" for Name and Separator cols;
// This contains the current user's NameCard and will contain other information in the future
Item {
@ -47,9 +47,11 @@ Rectangle {
// Size
width: pal.width;
height: myCardHeight;
// Positioning
// Anchors
anchors.top: pal.top;
anchors.left: pal.left;
anchors.topMargin: 10;
anchors.bottomMargin: anchors.topMargin;
// This NameCard refers to the current user's NameCard (the one above the table)
NameCard {
id: myCard;
@ -57,11 +59,10 @@ Rectangle {
displayName: myData.displayName;
userName: myData.userName;
// Size
width: nameCardWidth - anchors.leftMargin;
height: myCardHeight;
// Positioning
width: nameCardWidth;
height: parent.height;
// Anchors
anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter;
}
}
// This TableView refers to the table (below the current user's NameCard)
@ -70,7 +71,7 @@ Rectangle {
// Size
height: pal.height - myInfo.height;
width: pal.width;
// Positioning
// Anchors
anchors.top: myInfo.bottom;
// Properties
frameVisible: false;
@ -86,7 +87,7 @@ Rectangle {
TableViewColumn {
role: "ignore";
title: "Ignore"
width: actionWidth
width: actionButtonWidth
}
TableViewColumn {
title: "";
@ -96,13 +97,13 @@ Rectangle {
visible: iAmAdmin;
role: "mute";
title: "Mute";
width: actionWidth
width: actionButtonWidth
}
TableViewColumn {
visible: iAmAdmin;
role: "kick";
title: "Ban"
width: actionWidth
width: actionButtonWidth
}
model: userModel;
@ -134,10 +135,10 @@ Rectangle {
userName: model.userName;
visible: !isCheckBox && !isSeparator;
// Size
width: nameCardWidth - anchors.leftMargin;
// Positioning
width: nameCardWidth;
height: parent.height;
// Anchors
anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter;
}
// This Rectangle refers to the cells that contain the action buttons
Rectangle {

View file

@ -142,7 +142,7 @@ function usernameFromIDReply(id, username, machineFingerprint) {
// If the ID we've received is our ID...
if (AvatarList.getAvatar('').sessionUUID === id) {
// Set the data to contain specific strings.
data = ['', username + ' (hidden)']
data = ['', username]
} else {
// Set the data to contain the ID and the username+ID concat string.
data = [id, username + '/' + machineFingerprint];