Warning, /plasma/latte-dock/declarativeimports/components/AddItem.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Michail Vourlakos <mvourlakos@gmail.com>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 import QtQuick 2.1
0007 
0008 import org.kde.plasma.plasmoid 2.0
0009 
0010 import "code/ColorizerTools.js" as ColorizerTools
0011 
0012 Item{
0013     id: addItem
0014 
0015     property real backgroundOpacity: 1
0016 
0017     Rectangle{
0018         width: Math.min(parent.width, parent.height)
0019         height: width
0020         anchors.centerIn: parent
0021 
0022         radius: 0.05 * Math.max(width,height)
0023 
0024         color: Qt.rgba(theme.backgroundColor.r, theme.backgroundColor.g, theme.backgroundColor.b, backgroundOpacity)
0025         border.width: 1
0026         border.color: outlineColor
0027 
0028         property int crossSize: Math.min(0.4*parent.width, 0.4 * parent.height)
0029 
0030         readonly property color outlineColorBase: theme.backgroundColor
0031         readonly property real outlineColorBaseBrightness: ColorizerTools.colorBrightness(outlineColorBase)
0032         readonly property color outlineColor: {
0033             if (outlineColorBaseBrightness > 127.5) {
0034                 return Qt.darker(outlineColorBase, 1.5);
0035             } else {
0036                 return Qt.lighter(outlineColorBase, 2.2);
0037             }
0038         }
0039 
0040         Rectangle{width: parent.crossSize; height: 4; radius:2; anchors.centerIn: parent; color: theme.highlightColor}
0041         Rectangle{width: 4; height: parent.crossSize; radius:2; anchors.centerIn: parent; color: theme.highlightColor}
0042     }
0043 }