Kirigami2

Separator.qml
1 /*
2  * SPDX-FileCopyrightText: 2012 Marco Martin <[email protected]>
3  * SPDX-FileCopyrightText: 2016 Aleix Pol Gonzalez <[email protected]>
4  *
5  * SPDX-License-Identifier: LGPL-2.0-or-later
6  */
7 
8 import QtQuick 2.1
9 import QtQuick.Layouts 1.2
10 import org.kde.kirigami 2.12
11 
20 Rectangle {
21  id: root
22  implicitHeight: Math.floor(Units.devicePixelRatio)
23  implicitWidth: Math.floor(Units.devicePixelRatio)
24 
25  enum Weight {
26  Light,
27  Normal
28  }
29 
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: ColorUtils.linearInterpolation(Theme.backgroundColor, Theme.textColor, weight == Separator.Weight.Light ? 0.1 : 0.2);
50 }
51 
Q_INVOKABLE QColor linearInterpolation(const QColor &one, const QColor &two, double balance)
Returns a linearly interpolated color between color one and color two.
Definition: colorutils.cpp:53
real devicePixelRatio
The ratio between physical and device-independent pixels.
Utilities for processing items to obtain colors and information useful for UIs that need to adjust to...
Definition: colorutils.h:18
A set of named colors for the application.
A set of values to define semantically sizes and durations.
A visual separator.
Definition: Separator.qml:18
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:36:16 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.