~seb128/ubuntu-system-settings/storage-get-free-space

« back to all changes in this revision

Viewing changes to plugins/sound/SoundsList.qml

  • Committer: Tarmac
  • Author(s): Sebastien Bacher
  • Date: 2013-07-18 16:50:13 UTC
  • mfrom: (158.4.1 ubuntu-system-settings)
  • Revision ID: tarmac-20130718165013-4qp6ittraze5rzzk
sound: list 'stop playing' button, rework a bit the scrolling to keep the
button out of it (since it's supposed to always be on screen according to
the design document).

Approved by Ken VanDine, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    property string title
9
9
    property variant soundDisplayNames
10
10
    property variant soundFileNames
 
11
    property bool silentModeOn: false
11
12
 
12
13
    id: soundsPage
13
14
    title: title
14
15
 
15
 
    flickable: scrollWidget
16
 
 
17
16
    UbuntuSoundPanel {
18
17
        id: backendInfo
19
18
        Component.onCompleted:
28
27
        soundFileNames = sounds
29
28
    }
30
29
 
 
30
    Column {
 
31
        id: columnId
 
32
        anchors.left: parent.left
 
33
        anchors.right: parent.right
 
34
 
 
35
        SilentModeWarning {
 
36
            id: silentId
 
37
            silentMode: silentModeOn
 
38
        }
 
39
 
 
40
        ListItem.SingleControl {
 
41
            id: listId
 
42
            control: Button {
 
43
                text: i18n.tr("Stop playing")
 
44
                width: parent.width - units.gu(4)
 
45
            }
 
46
            visible: !silentModeOn
 
47
        }
 
48
    }
 
49
 
31
50
    Flickable {
32
 
        id: scrollWidget
33
 
        anchors.fill: parent
 
51
        width: parent.width
34
52
        contentHeight: contentItem.childrenRect.height
35
 
 
36
 
        Column {
37
 
            anchors.left: parent.left
38
 
            anchors.right: parent.right
39
 
 
40
 
            SilentModeWarning {
41
 
                silentMode: false
42
 
            }
43
 
 
44
 
            ListItem.ValueSelector {
45
 
                expanded: true
46
 
                // TODO: There is no way to have a ValueSelector always expanded
47
 
                onExpandedChanged: expanded = true
48
 
                values: soundDisplayNames
49
 
                onSelectedIndexChanged:
50
 
                    print(soundFileNames[selectedIndex]) // TODO: write configuration
51
 
            }
 
53
        anchors.top: columnId.bottom
 
54
        anchors.bottom: soundsPage.bottom
 
55
        clip: true
 
56
 
 
57
        ListItem.ValueSelector {
 
58
            id: soundSelector
 
59
            expanded: true
 
60
            // TODO: There is no way to have a ValueSelector always expanded
 
61
            onExpandedChanged: expanded = true
 
62
            values: soundDisplayNames
 
63
            onSelectedIndexChanged:
 
64
                print(soundFileNames[selectedIndex]) // TODO: write configuration
52
65
        }
53
66
    }
54
67
}