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

0001 /*
0002 *  Copyright 2019  Michail Vourlakos <mvourlakos@gmail.com>
0003 *
0004 *  This file is part of Latte-Dock
0005 *
0006 *  Latte-Dock is free software; you can redistribute it and/or
0007 *  modify it under the terms of the GNU General Public License as
0008 *  published by the Free Software Foundation; either version 2 of
0009 *  the License, or (at your option) any later version.
0010 *
0011 *  Latte-Dock is distributed in the hope that it will be useful,
0012 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 *  GNU General Public License for more details.
0015 *
0016 *  You should have received a copy of the GNU General Public License
0017 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0018 */
0019 
0020 import QtQuick 2.1
0021 
0022 import org.kde.plasma.plasmoid 2.0
0023 
0024 import "code/ColorizerTools.js" as ColorizerTools
0025 
0026 Item{
0027     id: addItem
0028 
0029     property real backgroundOpacity: 1
0030 
0031     Rectangle{
0032         width: Math.min(parent.width, parent.height)
0033         height: width
0034         anchors.centerIn: parent
0035 
0036         radius: Math.max(width,height)/2
0037 
0038         color: Qt.rgba(theme.backgroundColor.r, theme.backgroundColor.g, theme.backgroundColor.b, backgroundOpacity)
0039         border.width: 1
0040         border.color: outlineColor
0041 
0042         property int crossSize: Math.min(0.4*parent.width, 0.4 * parent.height)
0043 
0044         readonly property color outlineColorBase: theme.backgroundColor
0045         readonly property real outlineColorBaseBrightness: ColorizerTools.colorBrightness(outlineColorBase)
0046         readonly property color outlineColor: {
0047             if (outlineColorBaseBrightness > 127.5) {
0048                 return Qt.darker(outlineColorBase, 1.5);
0049             } else {
0050                 return Qt.lighter(outlineColorBase, 2.2);
0051             }
0052         }
0053 
0054         Rectangle{width: parent.crossSize; height: 4; radius:2; anchors.centerIn: parent; color: theme.highlightColor}
0055         Rectangle{width: 4; height: parent.crossSize; radius:2; anchors.centerIn: parent; color: theme.highlightColor}
0056     }
0057 }