Changeset View
Changeset View
Standalone View
Standalone View
kcms/notifications/package/contents/ui/SourcesPage.qml
Show All 16 Lines | |||||
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | import QtQuick 2.9 | 21 | import QtQuick 2.9 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Controls 2.3 as QtControls | 23 | import QtQuick.Controls 2.3 as QtControls | ||
24 | 24 | | |||
25 | import org.kde.kirigami 2.8 as Kirigami | 25 | import org.kde.kirigami 2.10 as Kirigami | ||
26 | import org.kde.kcm 1.2 as KCM | 26 | import org.kde.kcm 1.2 as KCM | ||
27 | 27 | | |||
28 | import org.kde.private.kcms.notifications 1.0 as Private | 28 | import org.kde.private.kcms.notifications 1.0 as Private | ||
29 | 29 | | |||
30 | Kirigami.Page { | 30 | Kirigami.Page { | ||
31 | id: sourcesPage | 31 | id: sourcesPage | ||
32 | title: i18n("Application Settings") | 32 | title: i18n("Application Settings") | ||
33 | 33 | | |||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 96 | ListView { | |||
103 | highlightMoveDuration: 0 | 103 | highlightMoveDuration: 0 | ||
104 | 104 | | |||
105 | model: kcm.filteredModel | 105 | model: kcm.filteredModel | ||
106 | currentIndex: -1 | 106 | currentIndex: -1 | ||
107 | 107 | | |||
108 | section { | 108 | section { | ||
109 | criteria: ViewSection.FullString | 109 | criteria: ViewSection.FullString | ||
110 | property: "sourceType" | 110 | property: "sourceType" | ||
111 | delegate: Kirigami.AbstractListItem { | 111 | delegate: Kirigami.ListSectionHeader { | ||
112 | id: sourceSection | 112 | id: sourceSection | ||
113 | width: sourcesList.width | 113 | width: sourcesList.width | ||
114 | 114 | label: { | |||
115 | backgroundColor: Kirigami.Theme.backgroundColor | | |||
116 | Kirigami.Theme.inherit: false | | |||
117 | Kirigami.Theme.colorSet: Kirigami.Theme.Window | | |||
118 | | ||||
119 | hoverEnabled: false | | |||
120 | supportsMouseEvents: false | | |||
121 | | ||||
122 | Kirigami.Heading { | | |||
123 | level: 2 | | |||
124 | text: { | | |||
125 | switch (Number(section)) { | 115 | switch (Number(section)) { | ||
126 | case Private.SourcesModel.ApplicationType: return i18n("Applications"); | 116 | case Private.SourcesModel.ApplicationType: return i18n("Applications"); | ||
127 | case Private.SourcesModel.ServiceType: return i18n("System Services"); | 117 | case Private.SourcesModel.ServiceType: return i18n("System Services"); | ||
128 | } | 118 | } | ||
129 | } | 119 | } | ||
130 | } | 120 | } | ||
131 | } | 121 | } | ||
132 | } | | |||
133 | 122 | | |||
134 | // We need to manually keep track of the index when we filter | 123 | // We need to manually keep track of the index when we filter | ||
135 | function updateCurrentIndex() { | 124 | function updateCurrentIndex() { | ||
136 | if (!appConfiguration.rootIndex || !appConfiguration.rootIndex.valid) { | 125 | if (!appConfiguration.rootIndex || !appConfiguration.rootIndex.valid) { | ||
137 | currentIndex = -1; | 126 | currentIndex = -1; | ||
138 | return; | 127 | return; | ||
139 | } | 128 | } | ||
140 | 129 | | |||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |