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 QtQuick 2.5
import "../styles-uit" import "../styles-uit"
Row {
id: thisNameCard;
// Spacing
spacing: 5;
// Margins
anchors.leftMargin: 5;
Column {
// Properties // Properties
property string displayName: ""; property string displayName: "";
property string userName: ""; property string userName: "";
property int displayTextHeight: 18; property int displayTextHeight: 18;
property int usernameTextHeight: 12 property int usernameTextHeight: 12;
RalewaySemiBold { Column {
// Properties id: avatarImage;
text: parent.displayName;
elide: Text.ElideRight;
// Size // Size
width: parent.width; width: parent.height - 2;
// Text Size height: width;
size: parent.displayTextHeight; Rectangle {
// Text Positioning anchors.fill: parent;
verticalAlignment: Text.AlignVCenter; radius: parent.width*0.5;
color: "#AAA5AD";
}
} }
RalewayLight { Column {
// Properties id: textContainer;
text: parent.userName;
elide: Text.ElideRight;
visible: parent.displayName;
// Size // Size
size: parent.usernameTextHeight; width: parent.width - avatarImage.width;
width: parent.width;
// Text Positioning RalewaySemiBold {
verticalAlignment: Text.AlignVCenter; 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; userName: myData.userName;
// Size // Size
width: nameCardWidth - anchors.leftMargin; width: nameCardWidth - anchors.leftMargin;
height: myCardHeight;
// Positioning // Positioning
anchors.left: parent.left; anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
// Margins
anchors.leftMargin: 10;
} }
} }
// This TableView refers to the table (below the current user's NameCard) // This TableView refers to the table (below the current user's NameCard)
@ -125,6 +124,7 @@ Rectangle {
itemDelegate: Item { itemDelegate: Item {
id: itemCell; id: itemCell;
property bool isCheckBox: typeof(styleData.value) === 'boolean'; property bool isCheckBox: typeof(styleData.value) === 'boolean';
property bool isSeparator: styleData.value === '';
// This NameCard refers to the cell that contains an avatar's // This NameCard refers to the cell that contains an avatar's
// DisplayName and UserName // DisplayName and UserName
NameCard { NameCard {
@ -132,19 +132,17 @@ Rectangle {
// Properties // Properties
displayName: styleData.value; displayName: styleData.value;
userName: model.userName; userName: model.userName;
visible: !isCheckBox; visible: !isCheckBox && !isSeparator;
// Size // Size
width: nameCardWidth - anchors.leftMargin; width: nameCardWidth - anchors.leftMargin;
// Positioning // Positioning
anchors.left: parent.left; anchors.left: parent.left;
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
// Margins
anchors.leftMargin: 10;
} }
// This Rectangle refers to the cells that contain the action buttons // This Rectangle refers to the cells that contain the action buttons
Rectangle { Rectangle {
radius: itemCell.height / 4; radius: itemCell.height / 4;
visible: isCheckBox; visible: isCheckBox && !isSeparator;
color: styleData.value ? "green" : "red"; color: styleData.value ? "green" : "red";
anchors.fill: parent; anchors.fill: parent;
MouseArea { MouseArea {