Kirigami2

ForwardButton.qml
1/*
2 * SPDX-FileCopyrightText: 2016 Marco Martin <mart@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7import QtQuick
8import QtQuick.Controls as QQC2
9import org.kde.kirigami as Kirigami
10
11QQC2.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 // The gridUnit wiggle room is used to not flicker the button visibility during an animated resize for instance due to a sidebar collapse
19 visible: {
20 const pageStack = applicationWindow().pageStack;
21 const showNavButtons = globalToolBar?.showNavigationButtons ?? Kirigami.ApplicationHeaderStyle.NoNavigationButtons;
22 return pageStack.layers.depth === 1 && pageStack.contentItem.contentWidth > pageStack.width + Kirigami.Units.gridUnit && (showNavButtons & Kirigami.ApplicationHeaderStyle.ShowForwardButton);
23 }
24
25 onClicked: applicationWindow().pageStack.goForward();
26
27 text: qsTr("Navigate Forward")
28 display: QQC2.ToolButton.IconOnly
29
30 QQC2.ToolTip {
31 visible: button.hovered
32 text: button.text
33 delay: Kirigami.Units.toolTipDelay
34 y: button.height
35 }
36}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:52:23 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.