1/*
2    SPDX-FileCopyrightText: 2019 Michail Vourlakos <mvourlakos@gmail.com>
3    SPDX-License-Identifier: GPL-2.0-or-later
4*/
5
6import QtQuick 2.1
7
8import org.kde.plasma.plasmoid 2.0
9
10import "code/ColorizerTools.js" as ColorizerTools
11
12Item{
13    id: addItem
14
15    property real backgroundOpacity: 1
16
17    Rectangle{
18        width: Math.min(parent.width, parent.height)
19        height: width
20        anchors.centerIn: parent
21
22        radius: 0.05 * Math.max(width,height)
23
24        color: Qt.rgba(theme.backgroundColor.r, theme.backgroundColor.g, theme.backgroundColor.b, backgroundOpacity)
25        border.width: 1
26        border.color: outlineColor
27
28        property int crossSize: Math.min(0.4*parent.width, 0.4 * parent.height)
29
30        readonly property color outlineColorBase: theme.backgroundColor
31        readonly property real outlineColorBaseBrightness: ColorizerTools.colorBrightness(outlineColorBase)
32        readonly property color outlineColor: {
33            if (outlineColorBaseBrightness > 127.5) {
34                return Qt.darker(outlineColorBase, 1.5);
35            } else {
36                return Qt.lighter(outlineColorBase, 2.2);
37            }
38        }
39
40        Rectangle{width: parent.crossSize; height: 4; radius:2; anchors.centerIn: parent; color: theme.highlightColor}
41        Rectangle{width: 4; height: parent.crossSize; radius:2; anchors.centerIn: parent; color: theme.highlightColor}
42    }
43}
44