18 import Ubuntu.Components 0.1
19 import Ubuntu.Components.Popups 0.1
48 SortFilterProxyModel {
53 dynamicSortFilter:
true
55 filterRole: Scopes.RoleVisible
56 filterRegExp: RegExp(
"^true$")
60 anchors.fill: dashContent
65 anchors.fill: dashContent
66 source: root.width > root.height ?
"Dash/graphics/paper_landscape.png" :
"Dash/graphics/paper_portrait.png"
67 fillMode: Image.PreserveAspectCrop
68 horizontalAlignment: Image.AlignRight
69 verticalAlignment: Image.AlignTop
76 property var scope: scopes.getScope(currentIndex)
101 anchors { fill: parent; margins: units.gu(1) }
110 anchors { left: parent.left; right: parent.right }
112 onTextChanged: dashContent.scope.searchQuery = text
115 target: dashContent.scope
116 onSearchQueryChanged: searchField.text = dashContent.scope.searchQuery
123 verticalAlignment: Text.AlignBottom
128 anchors { left: parent.left; right: parent.right }
129 model: dashContent.scope ? dashContent.scope.categories : null
131 property Item selectedItem
133 delegate: OptionSelectorDelegate {
136 property string categoryId: model.categoryId
137 property string template: JSON.stringify(JSON.parse(model.rawRendererTemplate), null,
" ");
139 onSelectedChanged:
if (selected) categorySelector.selectedItem = categoryDelegate
148 text: categorySelector.selectedItem && categorySelector.selectedItem.template
153 text:
"Override category"
155 PopupUtils.open(categoryEditor)
166 title:
"Editing category definition"
169 id: categoryEditorArea
171 wrapMode: Text.WordWrap
172 text: categoryJson.text
175 onCancelClicked: PopupUtils.close(sheet)
177 PopupUtils.close(sheet);
178 dashContent.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);