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 Accessible.focusable: false
25
26 enum Weight {
27 Light,
28 Normal
29 }
30
31 /**
32 * @brief This property holds the visual weight of the separator.
33 *
34 * Weight options:
35 * * ``Kirigami.Separator.Weight.Light``
36 * * ``Kirigami.Separator.Weight.Normal``
37 *
38 * default: ``Kirigami.Separator.Weight.Normal``
39 *
40 * @since 5.72
41 * @since org.kde.kirigami 2.12
42 */
43 property int weight: Separator.Weight.Normal
44
45 /* TODO: If we get a separator color role, change this to
46 * mix weights lower than Normal with the background color
47 * and mix weights higher than Normal with the text color.
48 */
49 color: Platform.ColorUtils.linearInterpolation(
50 Platform.Theme.backgroundColor,
51 Platform.Theme.textColor,
52 weight === Separator.Weight.Light ? Platform.Theme.lightFrameContrast : Platform.Theme.frameContrast
53 )
54}
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 28 2025 11:53:57 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.