Kirigami-addons

FormArrow.qml
1/*
2 * Copyright 2022 Devin Lin <devin@kde.org>
3 * SPDX-License-Identifier: LGPL-2.0-or-later
4 */
5
6import QtQuick 2.15
7import QtQuick.Controls 2.15
8import QtQuick.Layouts 1.15
9
10import org.kde.kirigami 2.19 as Kirigami
11
12/**
13 * @brief An arrow UI component used in Form delegates.
14 *
15 * This component can be used to decorate existing or custom Form delegates.
16 * It is used, for instance, as the trailing property of FormButtonDelegate.
17 *
18 * Each FormArrow instance corresponds to a single arrow that may point
19 * upwards, downwards, to the left or to the right.
20 *
21 * @since KirigamiAddons 0.11.0
22 *
23 * @inherit Kirigami.Icon
24 */
25
26Kirigami.Icon {
27 /**
28 * @brief The direction the FormArrow will point towards.
29 *
30 * Set this to any Qt::ArrowType enum value.
31 *
32 * default: `Qt.RightArrow`
33 */
34 property int direction: Qt.RightArrow
35
36 source: {
37 switch (direction) {
38 case Qt.UpArrow:
39 return "arrow-up";
40 case Qt.DownArrow:
41 return "arrow-down";
42 case Qt.LeftArrow:
43 return "arrow-left";
44 case Qt.RightArrow:
45 return "arrow-right";
46 }
47 }
48 implicitWidth: Math.round(Kirigami.Units.iconSizes.small * 0.75)
49 implicitHeight: Math.round(Kirigami.Units.iconSizes.small * 0.75)
50}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:46:57 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.