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
7import QtQuick.Controls
8import QtQuick.Layouts
9
10import org.kde.kirigami 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-symbolic";
40 case Qt.DownArrow:
41 return "arrow-down-symbolic";
42 case Qt.LeftArrow:
43 return "arrow-left-symbolic";
44 case Qt.RightArrow:
45 return "arrow-right-symbolic";
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 Dec 13 2024 11:46:08 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.