Ubuntu Pastebin

Paste from zub at Thu, 6 Aug 2015 06:50:44 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
    OptionSelector {
        id: currencyList
        anchors.fill: parent
        //multiSelection: true
        expanded: true
        model: CurrencyModel {}

        delegate: OptionSelectorDelegate {
            text: model.code
            subText: model.name
            iconSource: "images/" + model.icon + ".svg"
            constrainImage: true
            Component.onCompleted: {
                // FIXME: this is a brittle hack
                var image = this.children[0].children[0];
                if (image && image.objectName === "icon") {
                    image.height -= units.gu(2);
                    image.anchors.verticalCenter = image.parent.verticalCenter;
                }
                // else: hack failed :-(
            }
        }
    }
Download as text