Kirigami2

PrivateSwipeTab.qml
1 /*
2  * SPDX-FileCopyrightText: 2020 Carson Black <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.12
8 import org.kde.kirigami 2.17 as Kirigami
9 
10 Kirigami.PageTab {
11  id: tabRoot
12 
13  active: index === columnView.currentIndex
14  title: modelData.title
15  progress: modelData.progress
16  needsAttention: modelData.needsAttention
17  icon: modelData.icon
18 
19  signal indexChanged(real xPos, real tabWidth)
20 
21  onActiveFocusChanged: {
22  if (activeFocus) {
23  tabRoot.indexChanged(tabRoot.x, tabRoot.width)
24  }
25  }
26  TapHandler {
27  onTapped: eventPoint => {
28  columnView.currentIndex = index;
29  }
30  }
31  Connections {
32  target: columnView
33  function onCurrentIndexChanged() {
34  if (index === columnView.currentIndex) {
35  tabRoot.indexChanged(tabRoot.x, tabRoot.width)
36  }
37  }
38  }
39 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jan 29 2023 04:11:03 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.