Kirigami2

NavigationButton.qml
1/*
2 * SPDX-FileCopyrightText: 2025 Marco Martin <mart@kde.org>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7import QtQuick
8import QtQuick.Layouts
9import QtQuick.Controls as QQC2
10import org.kde.kirigami as Kirigami
11
12QQC2.ToolButton {
13 id: button
14
15 Layout.rightMargin: state.length === 0 ? 0 : -width
16
17 states: [
18 State {
19 PropertyChanges {
20 target: button
21 opacity: 1
22 visible: true
23 }
24 },
25 State {
26 name: "invisible"
27 PropertyChanges {
28 target: button
29 opacity: 0
30 visible: false
31 }
32 }
33 ]
34 transitions: [
35 Transition {
36 from: "invisible"
37 SequentialAnimation {
38 PropertyAction {
39 target: button
40 property: "visible"
41 value: true
42 }
43 NumberAnimation {
44 target: button
45 property: "opacity"
46 from: 0
47 to: 1
48 duration: Kirigami.Units.longDuration
49 easing.type: Easing.InOutQuad
50 }
51 }
52 },
53 Transition {
54 to: "invisible"
55 SequentialAnimation {
56 NumberAnimation {
57 target: button
58 property: "opacity"
59 from: 1
60 to: 0
61 duration: Kirigami.Units.longDuration
62 easing.type: Easing.InOutQuad
63 }
64 PropertyAction {
65 target: button
66 property: "visible"
67 value: false
68 }
69 }
70 }
71 ]
72
73 display: QQC2.ToolButton.IconOnly
74
75 QQC2.ToolTip {
76 visible: button.hovered
77 text: button.text
78 delay: Kirigami.Units.toolTipDelay
79 timeout: 5000
80 y: button.height
81 }
82}
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:57:51 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.