~macslow/ubuntu-ui-toolkit/green-darkgrey-gradient

« back to all changes in this revision

Viewing changes to examples/ubuntu-ui-toolkit-gallery/Icons.qml

  • Committer: Christian Dywan
  • Date: 2014-05-15 09:41:46 UTC
  • mfrom: (1000.41.2 staging)
  • mto: (1000.41.5 staging)
  • mto: This revision was merged to the branch mainline in revision 1022.
  • Revision ID: christian.dywan@canonical.com-20140515094146-51ahypeh4ow161wp
MergeĀ lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/staging

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
import QtQuick 2.0
18
18
import Ubuntu.Components 0.1
 
19
import Ubuntu.Components.ListItems 0.1 as ListItem
 
20
import Ubuntu.Components.Popups 1.0
 
21
import Qt.labs.folderlistmodel 2.1
19
22
 
20
23
Template {
21
24
    objectName: "iconsTemplate"
74
77
                height: 24
75
78
            }
76
79
        }
 
80
 
 
81
        TemplateRow {
 
82
            title: i18n.tr("Theme")
 
83
            spacing: units.gu(2)
 
84
 
 
85
 
 
86
            Flow {
 
87
                anchors.fill: parent
 
88
                spacing: units.gu(2)
 
89
 
 
90
                Repeater {
 
91
                    model: FolderListModel {
 
92
                        folder: "/usr/share/icons/ubuntu-mobile/actions/scalable"
 
93
                        showDirs: false
 
94
                        showOnlyReadable : true
 
95
                        sortField: FolderListModel.Name
 
96
                        nameFilters: [ "*.svg" ]
 
97
                    }
 
98
                    Icon {
 
99
                        id: themedIcon
 
100
                        name: fileBaseName || ""
 
101
                        width: 24
 
102
                        height: 24
 
103
                        MouseArea {
 
104
                            anchors.fill: parent
 
105
                            onClicked: PopupUtils.open(iconPop, themedIcon, { 'icon': themedIcon.name })
 
106
                        }
 
107
                        Component {
 
108
                            id: iconPop
 
109
                            Popover {
 
110
                                id: iconPopover
 
111
                                property string icon: "N/A"
 
112
 
 
113
                                Column {
 
114
                                    anchors.top: parent.top
 
115
                                    anchors.left: parent.left
 
116
                                    anchors.right: parent.right
 
117
 
 
118
                                    ListItem.Standard {
 
119
                                        iconName: iconPopover.icon
 
120
                                        text: iconPopover.icon
 
121
                                    }
 
122
                                }
 
123
                            }
 
124
                        }
 
125
                    }
 
126
                }
 
127
            }
 
128
        }
77
129
    }
78
130
}