MauiKit Controls

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.mauikit.controls as Maui
10
11/**
12 * @inherit QtQuick.Rectangle
13 * @brief A visual separator.
14 *
15 * Useful as a visual hint for diciding grouped elements.
16 */
17Rectangle
18{
19 id: control
20 implicitHeight: 1
21 implicitWidth: 1
22 Accessible.role: Accessible.Separator
23
24 /**
25 * @brief Types of weight.
26 */
27 enum Weight {
28 Light,
29 Normal
30 }
31
32 /**
33 * @brief This property holds the visual weight of the separator.
34 *
35 * Weight values:
36 * * `Separator.Weight.Light`
37 * * `Separator.Weight.Normal`
38 *
39 * The default is `Separator.Weight.Normal`
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: Maui.ColorUtils.linearInterpolation(Maui.Theme.backgroundColor, Maui.Theme.textColor, weight == Separator.Weight.Light ? 0.07 : 0.15);
48
49 Behavior on color
50 {
51 Maui.ColorTransition{}
52 }
53}
54
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 27 2024 11:53:23 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.