Kirigami2

ForwardButton.qml
1 /*
2  * SPDX-FileCopyrightText: 2016 Marco Martin <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.0-or-later
5  */
6 
7 import QtQuick 2.1
8 import QtQuick.Controls 2.0 as QQC2
9 import org.kde.kirigami 2.4 as Kirigami
10 
11 QQC2.ToolButton {
12  id: button
13 
14  icon.name: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic")
15 
16  enabled: applicationWindow().pageStack.currentIndex < applicationWindow().pageStack.depth-1
17 
18  property var showNavButtons: {
19  try {
20  return globalToolBar.showNavigationButtons
21  } catch (_) {
22  return false
23  }
24  }
25  // The gridUnit wiggle room is used to not flicker the button visibility during an animated resize for instance due to a sidebar collapse
26  visible: applicationWindow().pageStack.layers.depth === 1 && applicationWindow().pageStack.contentItem.contentWidth > applicationWindow().pageStack.width + Kirigami.Units.gridUnit && (showNavButtons === true || (showNavButtons & Kirigami.ApplicationHeaderStyle.ShowForwardButton))
27 
28  onClicked: applicationWindow().pageStack.goForward();
29 
30  QQC2.ToolTip {
31  visible: button.hovered
32  text: qsTr("Navigate Forward")
33  delay: Kirigami.Units.toolTipDelay
34  timeout: 5000
35  y: button.height
36  }
37 }
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.