Warning, /frameworks/kirigami/src/controls/templates/private/IconPropertiesGroup.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2017 Marco Martin <mart@kde.org>
0003  *
0004  *  SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick
0008 import QtQml
0009 
0010 /**
0011  * @brief Group of icon properties.
0012  *
0013  * This is a subset of those used in QQC2, Kirigami.Action still needs the full one as needs 100% api compatibility
0014  */
0015 QtObject {
0016     /**
0017      * @brief This property holds icon name.
0018      *
0019      * The icon will be loaded from the platform theme. If the icon is found
0020      * in the theme, it will always be used; even if icon.source is also set.
0021      * If the icon is not found, icon.source will be used instead.
0022      */
0023     property string name
0024 
0025     /**
0026      * @brief This property holds the icon source.
0027      *
0028      * The icon will be loaded as a regular image.
0029      *
0030      * @see QtQuick.Image::source
0031      */
0032     property var source
0033 
0034     /**
0035      * @brief This property holds the icon tint color.
0036      *
0037      * The icon is tinted with the specified color, unless the color is set to "transparent".
0038      */
0039     property color color: Qt.rgba(0, 0, 0, 0)
0040 
0041     /**
0042      * This property holds the width of the icon.
0043      */
0044     property real width
0045 
0046     /**
0047      * This property holds the height of the icon.
0048      */
0049     property real height
0050 
0051     /**
0052      * Bind this icon to all matching properties of a Controls icon group.
0053      *
0054      * This function automatically binds all properties to matching properties
0055      * of a controls icon group, since we cannot just reuse the Controls icon
0056      * group.
0057      *
0058      * To use it, you can assign the result to an IconPropertiesGroup, like so:
0059      * `icon: icon.fromControlsIcon(control.icon)`.
0060      */
0061     function fromControlsIcon(icon) {
0062         name = Qt.binding(() => icon.name)
0063         source = Qt.binding(() => icon.source)
0064         color = Qt.binding(() => icon.color)
0065         width = Qt.binding(() => icon.width)
0066         height = Qt.binding(() => icon.height)
0067         return this
0068     }
0069 }