NameCard improvements & user feedback

This commit is contained in:
Zach Fox 2017-01-13 15:25:07 -08:00
parent a69a10b8e4
commit 8343769352
2 changed files with 25 additions and 18 deletions

View file

@ -20,16 +20,13 @@ Row {
// Spacing // Spacing
spacing: 10 spacing: 10
// Anchors // Anchors
anchors.top: parent.top
anchors { anchors {
topMargin: (parent.height - contentHeight)/2 verticalCenter: parent.verticalCenter
bottomMargin: (parent.height - contentHeight)/2
leftMargin: 10 leftMargin: 10
rightMargin: 10 rightMargin: 10
} }
// Properties // Properties
property int contentHeight: 70
property string uuid: "" property string uuid: ""
property string displayName: "" property string displayName: ""
property string userName: "" property string userName: ""
@ -42,7 +39,7 @@ Row {
Column { Column {
id: avatarImage id: avatarImage
// Size // Size
height: contentHeight height: parent.height
width: height width: height
Image { Image {
id: userImage id: userImage
@ -56,9 +53,8 @@ Row {
Column { Column {
id: textContainer id: textContainer
// Size // Size
width: parent.width - /*avatarImage.width - */parent.anchors.leftMargin - parent.anchors.rightMargin - parent.spacing width: parent.width - /*avatarImage.width - parent.spacing - */parent.anchors.leftMargin - parent.anchors.rightMargin
height: contentHeight anchors.verticalCenter: parent.verticalCenter
// DisplayName Text // DisplayName Text
FiraSansSemiBold { FiraSansSemiBold {
id: displayNameText id: displayNameText
@ -94,7 +90,7 @@ Row {
// Spacer // Spacer
Item { Item {
height: 4 height: 3
width: parent.width width: parent.width
} }
@ -146,7 +142,7 @@ Row {
// Per-Avatar Gain Slider Spacer // Per-Avatar Gain Slider Spacer
Item { Item {
width: parent.width width: parent.width
height: 4 height: 3
visible: !isMyCard visible: !isMyCard
} }
// Per-Avatar Gain Slider // Per-Avatar Gain Slider
@ -159,20 +155,31 @@ Row {
minimumValue: -60.0 minimumValue: -60.0
maximumValue: 20.0 maximumValue: 20.0
stepSize: 2 stepSize: 2
updateValueWhileDragging: false updateValueWhileDragging: true
onValueChanged: updateGainFromQML(uuid, value) onValueChanged: updateGainFromQML(uuid, value)
MouseArea {
anchors.fill: parent
onWheel: {
// Do nothing.
}
onDoubleClicked: {
gainSlider.value = 0.0
}
onPressed: {
// Pass through to Slider
mouse.accepted = false
}
onReleased: {
// Pass through to Slider
mouse.accepted = false
}
}
style: SliderStyle { style: SliderStyle {
groove: Rectangle { groove: Rectangle {
color: "#dbdbdb" color: "#dbdbdb"
implicitWidth: gainSlider.width implicitWidth: gainSlider.width
implicitHeight: 4 implicitHeight: 4
radius: 2 radius: 2
MouseArea {
anchors.fill: parent
onDoubleClicked: {
gainSlider.value = 0.0
}
}
} }
handle: Rectangle { handle: Rectangle {
anchors.centerIn: parent anchors.centerIn: parent

View file

@ -25,7 +25,7 @@ Rectangle {
color: "#E3E3E3" color: "#E3E3E3"
// Properties // Properties
property int myCardHeight: 90 property int myCardHeight: 90
property int rowHeight: 90 property int rowHeight: 80
property int actionButtonWidth: 75 property int actionButtonWidth: 75
property int nameCardWidth: palContainer.width - actionButtonWidth*(iAmAdmin ? 4 : 2) - 4 - hifi.dimensions.scrollbarBackgroundWidth property int nameCardWidth: palContainer.width - actionButtonWidth*(iAmAdmin ? 4 : 2) - 4 - hifi.dimensions.scrollbarBackgroundWidth
property var myData: ({displayName: "", userName: "", audioLevel: 0.0}) // valid dummy until set property var myData: ({displayName: "", userName: "", audioLevel: 0.0}) // valid dummy until set