Steady progress

This commit is contained in:
Zach Fox 2016-12-19 14:26:49 -08:00
parent 46c787512e
commit deb40f67df
2 changed files with 49 additions and 26 deletions

View file

@ -13,34 +13,59 @@ import Hifi 1.0
import QtQuick 2.5
import "../styles-uit"
Row {
id: thisNameCard;
// Spacing
spacing: 5;
// Margins
anchors.leftMargin: 5;
Column {
// Properties
property string displayName: "";
property string userName: "";
property int displayTextHeight: 18;
property int usernameTextHeight: 12
property int usernameTextHeight: 12;
RalewaySemiBold {
// Properties
text: parent.displayName;
elide: Text.ElideRight;
Column {
id: avatarImage;
// Size
width: parent.width;
// Text Size
size: parent.displayTextHeight;
// Text Positioning
verticalAlignment: Text.AlignVCenter;
width: parent.height - 2;
height: width;
Rectangle {
anchors.fill: parent;
radius: parent.width*0.5;
color: "#AAA5AD";
}
}
RalewayLight {
// Properties
text: parent.userName;
elide: Text.ElideRight;
visible: parent.displayName;
Column {
id: textContainer;
// Size
size: parent.usernameTextHeight;
width: parent.width;
// Text Positioning
verticalAlignment: Text.AlignVCenter;
width: parent.width - avatarImage.width;
RalewaySemiBold {
id: displayNameText;
// Properties
text: thisNameCard.displayName;
elide: Text.ElideRight;
// Size
width: parent.width;
// Text Size
size: thisNameCard.displayTextHeight;
// Text Positioning
verticalAlignment: Text.AlignVCenter;
}
RalewayLight {
id: userNameText;
// Properties
text: thisNameCard.userName;
elide: Text.ElideRight;
visible: thisNameCard.displayName;
// Size
width: parent.width;
// Text Size
size: thisNameCard.usernameTextHeight;
// Text Positioning
verticalAlignment: Text.AlignVCenter;
}
}
}

View file

@ -58,11 +58,10 @@ Rectangle {
userName: myData.userName;
// Size
width: nameCardWidth - anchors.leftMargin;
height: myCardHeight;
// Positioning
anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter;
// Margins
anchors.leftMargin: 10;
}
}
// This TableView refers to the table (below the current user's NameCard)
@ -125,6 +124,7 @@ Rectangle {
itemDelegate: Item {
id: itemCell;
property bool isCheckBox: typeof(styleData.value) === 'boolean';
property bool isSeparator: styleData.value === '';
// This NameCard refers to the cell that contains an avatar's
// DisplayName and UserName
NameCard {
@ -132,19 +132,17 @@ Rectangle {
// Properties
displayName: styleData.value;
userName: model.userName;
visible: !isCheckBox;
visible: !isCheckBox && !isSeparator;
// Size
width: nameCardWidth - anchors.leftMargin;
// Positioning
anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter;
// Margins
anchors.leftMargin: 10;
}
// This Rectangle refers to the cells that contain the action buttons
Rectangle {
radius: itemCell.height / 4;
visible: isCheckBox;
visible: isCheckBox && !isSeparator;
color: styleData.value ? "green" : "red";
anchors.fill: parent;
MouseArea {