Kirigami2
8import QtQuick.Controls as QQC2
9import QtQuick.Templates as T
10import org.kde.kirigami as Kirigami
27 property T.Action action
34 property alias acceptedButtons: area.acceptedButtons
40 property alias mouseArea: area
50 property color normalColor: Kirigami.Theme.linkColor
59 property color pressedColor: Qt.darker(normalColor)
68 property color disabledColor: Kirigami.Theme.textColor
70 activeFocusOnTab: true
71 Accessible.role: Accessible.Button
73 Accessible.onPressAction: clicked({ button: Qt.LeftButton })
75 text: action?.text ?? ""
76 enabled: action?.enabled ?? true
78 onClicked: action?.trigger()
80 font.bold: activeFocus
81 font.underline: enabled
82 color: if (!enabled) {
83 return control.disabledColor;
84 } else if (area.containsPress) {
85 return control.pressedColor;
87 return control.normalColor;
89 horizontalAlignment: Text.AlignHCenter
90 verticalAlignment: Text.AlignVCenter
91 elide: Text.ElideRight
93 signal pressed(var mouse)
94 signal clicked(var mouse)
96 Keys.onPressed: event => {
102 control.clicked({ button:
Qt.LeftButton });
103 event.accepted =
true;
106 control.pressed({ button:
Qt.RightButton });
107 event.accepted =
true;
116 cursorShape:
Qt.PointingHandCursor
118 onClicked: mouse => control.clicked(mouse)
119 onPressed: mouse => control.pressed(mouse)
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:47:53 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.