Kirigami2

DefaultChipBackground.qml
1 // SPDX-FileCopyrightText: 2022 Felipe Kinoshita <[email protected]>
2 // SPDX-License-Identifier: GPL-2.0-or-later
3 
4 import QtQuick 2.15
5 import QtQuick.Controls 2.15 as QQC2
6 import QtQuick.Layouts 1.15
7 import org.kde.kirigami 2.19 as Kirigami
8 
9 Rectangle {
10  /**
11  * @brief This property holds the color of the Chip's background when it is being pressed.
12  * @see QtQuick.AbstractButton::pressed
13  */
14  property color pressedColor: Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.3)
15 
16  /**
17  * @brief This property holds the color of the Chip's background when it is checked.
18  * @see QtQuick.AbstractButton::checked
19  */
20  property color hoverSelectColor: Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.2)
21 
22  /**
23  * @brief This property holds the color of the Chip's border when it is checked.
24  * @see QtQuick.AbstractButton::checked
25  */
26  property color checkedBorderColor: Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.7)
27 
28  /**
29  * @brief This property holds the color of the Chip's border when it is being pressed.
30  * @see QtQuick.AbstractButton::pressed
31  */
32  property color pressedBorderColor: Qt.rgba(Kirigami.Theme.highlightColor.r, Kirigami.Theme.highlightColor.g, Kirigami.Theme.highlightColor.b, 0.9)
33 
34  Kirigami.Theme.colorSet:Kirigami.Theme.Header
35  Kirigami.Theme.inherit: false
36 
37  color: parent.pressed ? pressedColor : (parent.checked ? hoverSelectColor : Kirigami.Theme.backgroundColor)
38  border.color: parent.pressed ? checkedBorderColor : (parent.checked ? pressedBorderColor : Qt.darker(Kirigami.Theme.backgroundColor, 1.1))
39  border.width: 1
40  radius: 3
41 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 04:14:23 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.