on xenial help sign in
merged with alignment branch
6bb8faaNick Dedekind
qml/Panel/Indicators.qml+36−34
@@ -195,20 +195,6 @@ Showable {
195 enabled: contentEnabled
195 enabled: contentEnabled
196 visibleIndicators: indicatorRow.visibleIndicators
196 visibleIndicators: indicatorRow.visibleIndicators
197
197
198− Connections {
199− property bool enableIndexChangeSignal: true
200−
201− target: enableIndexChangeSignal ? indicatorRow : null
202− onCurrentItemIndexChanged: {
203− var oldActive = enableIndexChangeSignal;
204− enableIndexChangeSignal = false;
205−
206− menuContent.setCurrentMenuIndex(indicatorRow.currentItemIndex);
207−
208− enableIndexChangeSignal = oldActive;
209− }
210− }
211−
212 //small shadow gradient at bottom of menu
198 //small shadow gradient at bottom of menu
213 Rectangle {
199 Rectangle {
214 anchors {
200 anchors {
@@ -279,20 +265,6 @@ Showable {
279 state: indicators.state
265 state: indicators.state
280 unitProgress: indicators.unitProgress
266 unitProgress: indicators.unitProgress
281
267
282− Connections {
283− property bool enableIndexChangeSignal: true
284−
285− target: enableIndexChangeSignal ? menuContent : null
286− onCurrentMenuIndexChanged: {
287− var oldActive = enableIndexChangeSignal;
288− enableIndexChangeSignal = false;
289−
290− indicatorRow.setCurrentItem(menuContent.currentMenuIndex);
291−
292− enableIndexChangeSignal = oldActive;
293− }
294− }
295−
296 EdgeDragArea {
268 EdgeDragArea {
297 id: rowDragArea
269 id: rowDragArea
298 anchors.fill: indicatorRow
270 anchors.fill: indicatorRow
@@ -341,15 +313,45 @@ Showable {
341 }
313 }
342 }
314 }
343
315
316+ QtObject {
317+ id: d
318+ property bool enableIndexChangeSignal: true
344− property var activeDragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle.dragging ? hideDragHandle : null
319+ property var activeDragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle.dragging ? hideDragHandle : null
320+ }
321+
322+ Connections {
323+ target: menuContent
324+ onCurrentMenuIndexChanged: {
325+ var oldActive = d.enableIndexChangeSignal;
326+ if (!oldActive) return;
327+ d.enableIndexChangeSignal = false;
328+
329+ indicatorRow.setCurrentItem(menuContent.currentMenuIndex);
330+
331+ d.enableIndexChangeSignal = oldActive;
332+ }
333+ }
334+
335+ Connections {
336+ target: indicatorRow
337+ onCurrentItemIndexChanged: {
338+ var oldActive = d.enableIndexChangeSignal;
339+ if (!oldActive) return;
340+ d.enableIndexChangeSignal = false;
341+
342+ menuContent.setCurrentMenuIndex(indicatorRow.currentItemIndex);
343+
344+ d.enableIndexChangeSignal = oldActive;
345+ }
346+ }
345 // connections to the active drag handle
347 // connections to the active drag handle
346 Connections {
348 Connections {
347− target: activeDragHandle
349+ target: d.activeDragHandle
348 onTouchXChanged: {
350 onTouchXChanged: {
349− indicators.calculateCurrentItem(activeDragHandle.touchX, true);
351+ indicators.calculateCurrentItem(d.activeDragHandle.touchX, true);
350 }
352 }
351 onTouchSceneYChanged: {
353 onTouchSceneYChanged: {
352− yVelocityCalculator.trackedPosition = activeDragHandle.touchSceneY;
354+ yVelocityCalculator.trackedPosition = d.activeDragHandle.touchSceneY;
353 }
355 }
354 }
356 }
355
357
@@ -403,8 +405,8 @@ Showable {
403 }
405 }
404 StateChangeScript {
406 StateChangeScript {
405 script: {
407 script: {
406− if (activeDragHandle) {
408+ if (d.activeDragHandle) {
407− calculateCurrentItem(activeDragHandle.touchX, false);
409+ calculateCurrentItem(d.activeDragHandle.touchX, false);
408 }
410 }
409 }
411 }
410 }
412 }
qml/Panel/MenuContent.qml+4
@@ -74,6 +74,10 @@ MainView {
74
74
75 filterRole: Indicators.IndicatorsModelRole.IsVisible
75 filterRole: Indicators.IndicatorsModelRole.IsVisible
76 filterRegExp: RegExp("^true$")
76 filterRegExp: RegExp("^true$")
77+
78+ onDataChanged: tabs.selectedTabIndexChanged();
79+ onRowsInserted: tabs.selectedTabIndexChanged();
80+ onRowsRemoved: tabs.selectedTabIndexChanged();
77 }
81 }
78
82
79 Indicators.VisibleIndicatorsModel {
83 Indicators.VisibleIndicatorsModel {