Make sliders appear only when row is selected

This commit is contained in:
Zach Fox 2017-01-13 15:41:17 -08:00
parent 8343769352
commit a89868dcad
2 changed files with 6 additions and 4 deletions

View file

@ -34,6 +34,7 @@ Row {
property int usernameTextHeight: 12
property real audioLevel: 0.0
property bool isMyCard: false
property bool selected: false
/* User image commented out for now - will probably be re-introduced later.
Column {
@ -143,12 +144,12 @@ Row {
Item {
width: parent.width
height: 3
visible: !isMyCard
visible: !isMyCard && selected
}
// Per-Avatar Gain Slider
Slider {
id: gainSlider
visible: !isMyCard
visible: !isMyCard && selected
width: parent.width
height: 18
value: pal.gainSliderValueDB[uuid] ? pal.gainSliderValueDB[uuid] : 0.0

View file

@ -25,7 +25,7 @@ Rectangle {
color: "#E3E3E3"
// Properties
property int myCardHeight: 90
property int rowHeight: 80
property int rowHeight: 70
property int actionButtonWidth: 75
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
@ -190,7 +190,7 @@ Rectangle {
// This Rectangle refers to each Row in the table.
rowDelegate: Rectangle { // The only way I know to specify a row height.
// Size
height: rowHeight
height: rowHeight + (styleData.selected ? 20 : 0)
color: styleData.selected
? hifi.colors.orangeHighlight
: styleData.alternate ? hifi.colors.tableRowLightEven : hifi.colors.tableRowLightOdd
@ -211,6 +211,7 @@ Rectangle {
audioLevel: model && model.audioLevel
visible: !isCheckBox && !isButton
uuid: model && model.sessionId
selected: styleData.selected
// Size
width: nameCardWidth
height: parent.height