Kirigami2

Separator.qml
1/*
2 * SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
3 * SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8import QtQuick
9import org.kde.kirigami as Kirigami
10
11/**
12 * @brief A visual separator.
13 *
14 * Useful for splitting one set of items from another.
15 *
16 * @inherit QtQuick.Rectangle
17 */
18Rectangle {
19 id: root
20 implicitHeight: 1
21 implicitWidth: 1
22 Accessible.role: Accessible.Separator
23
24 enum Weight {
25 Light,
26 Normal
27 }
28
29 /**
30 * @brief This property holds the visual weight of the separator.
31 *
32 * Weight options:
33 * * ``Kirigami.Separator.Weight.Light``
34 * * ``Kirigami.Separator.Weight.Normal``
35 *
36 * default: ``Kirigami.Separator.Weight.Normal``
37 *
38 * @since 5.72
39 * @since org.kde.kirigami 2.12
40 */
41 property int weight: Separator.Weight.Normal
42
43 /* TODO: If we get a separator color role, change this to
44 * mix weights lower than Normal with the background color
45 * and mix weights higher than Normal with the text color.
46 */
47 color: Kirigami.ColorUtils.linearInterpolation(
48 Kirigami.Theme.backgroundColor,
49 Kirigami.Theme.textColor,
50 weight === Separator.Weight.Light ? Kirigami.Theme.lightFrameContrast : Kirigami.Theme.frameContrast)
51}
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:49:34 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.