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 searchHistory: SearchHistoryModel { }
77 property var scope: scopes.getScope(currentIndex)
102 anchors { fill: parent; margins: units.gu(1) }
111 anchors { left: parent.left; right: parent.right }
113 onTextChanged: dashContent.scope.searchQuery = text
116 target: dashContent.scope
117 onSearchQueryChanged: searchField.text = dashContent.scope.searchQuery
124 verticalAlignment: Text.AlignBottom
129 anchors { left: parent.left; right: parent.right }
130 model: dashContent.scope ? dashContent.scope.categories : null
132 property Item selectedItem
134 delegate: OptionSelectorDelegate {
137 property string categoryId: model.categoryId
138 property string template: JSON.stringify(JSON.parse(model.rawRendererTemplate), null,
" ");
140 onSelectedChanged:
if (selected) categorySelector.selectedItem = categoryDelegate
149 text: categorySelector.selectedItem && categorySelector.selectedItem.template
154 text:
"Override category"
156 PopupUtils.open(categoryEditor)
167 title:
"Editing category definition"
170 id: categoryEditorArea
172 wrapMode: Text.WordWrap
173 text: categoryJson.text
176 onCancelClicked: PopupUtils.close(sheet)
178 PopupUtils.close(sheet);
179 dashContent.scope.categories.overrideCategoryJson(categorySelector.selectedItem.categoryId, categoryEditorArea.text);