42 import
"private/SectionScroller.js" as Sections
43 import org.kde.plasma.core 0.1 as PlasmaCore
63 property ListView listView
66 if (listView && listView.model)
67 internal.initDirtyObserver();
73 if (listView && listView.model) {
74 internal.initDirtyObserver()
79 implicitWidth: scrollBar.implicitWidth
89 bottom: listView.bottom
97 maximumValue: Math.max(0, listView.contentHeight - listView.height)
100 positionAtMinimum: root.width*2
101 positionAtMaximum: root.height - root.width*2
102 value: listView.contentY
103 onPositionChanged: sectionLabel.text = Sections.closestSection(position/listView.height)
109 flickableItem: listView
113 PlasmaCore.FrameSvgItem {
115 imagePath:
"widgets/tooltip"
116 width: sectionLabel.width + margins.left + margins.right
117 height: sectionLabel.height + margins.top + margins.bottom
120 x: parent.margins.left
121 y: parent.margins.top
123 y: Math.min(root.height-height-scrollBar.width, Math.max(scrollBar.width, range.position - height/2))
128 opacity: sectionLabel.text && scrollBar.pressed ? 1 : 0
129 Behavior on opacity {
141 Sections.initSectionData(listView);
142 internal.modelDirty =
false;
143 tooltip.visible = Sections._sections.length > 1
149 property bool modelDirty:
false
150 function initDirtyObserver() {
151 Sections.initSectionData(listView);
152 tooltip.visible = Sections._sections.length > 1
153 function dirtyObserver() {
154 if (!
internal.modelDirty) {
155 internal.modelDirty =
true;
156 dirtyTimer.running =
true;
160 if (listView.model.countChanged)
161 listView.model.countChanged.connect(dirtyObserver);
163 if (listView.model.itemsChanged)
164 listView.model.itemsChanged.connect(dirtyObserver);
166 if (listView.model.itemsInserted)
167 listView.model.itemsInserted.connect(dirtyObserver);
169 if (listView.model.itemsMoved)
170 listView.model.itemsMoved.connect(dirtyObserver);
172 if (listView.model.itemsRemoved)
173 listView.model.itemsRemoved.connect(dirtyObserver);
175 sectionsRepeater.model = Sections._sections.length
This is a label which uses the plasma theme.