Warning, /frameworks/kirigami/src/controls/Separator.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 * SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
0003 * SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <aleixpol@kde.org>
0004 *
0005 * SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007
0008 import QtQuick
0009 import org.kde.kirigami as Kirigami
0010
0011 /**
0012 * @brief A visual separator.
0013 *
0014 * Useful for splitting one set of items from another.
0015 *
0016 * @inherit QtQuick.Rectangle
0017 */
0018 Rectangle {
0019 id: root
0020 implicitHeight: 1
0021 implicitWidth: 1
0022 Accessible.role: Accessible.Separator
0023
0024 enum Weight {
0025 Light,
0026 Normal
0027 }
0028
0029 /**
0030 * @brief This property holds the visual weight of the separator.
0031 *
0032 * Weight options:
0033 * * ``Kirigami.Separator.Weight.Light``
0034 * * ``Kirigami.Separator.Weight.Normal``
0035 *
0036 * default: ``Kirigami.Separator.Weight.Normal``
0037 *
0038 * @since 5.72
0039 * @since org.kde.kirigami 2.12
0040 */
0041 property int weight: Separator.Weight.Normal
0042
0043 /* TODO: If we get a separator color role, change this to
0044 * mix weights lower than Normal with the background color
0045 * and mix weights higher than Normal with the text color.
0046 */
0047 color: Kirigami.ColorUtils.linearInterpolation(
0048 Kirigami.Theme.backgroundColor,
0049 Kirigami.Theme.textColor,
0050 weight === Separator.Weight.Light ? Kirigami.Theme.lightFrameContrast : Kirigami.Theme.frameContrast)
0051 }