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

KDE's Doxygen guidelines are available online.