ColorsBar.qml 3.39 KB
Newer Older
1 2
import QtQuick 2.0
import QtQuick.Controls 2.2
3
import org.kde.kirigami 2.7 as Kirigami
camilo higuita's avatar
camilo higuita committed
4
import org.kde.mauikit 1.0 as Maui
5 6 7

Row
{
camilo higuita's avatar
camilo higuita committed
8
    signal colorPicked(string color)
camilo higuita's avatar
camilo higuita committed
9
//    anchors.verticalCenter: parent.verticalCenter
camilo higuita's avatar
camilo higuita committed
10
    spacing: Maui.Style.space.medium
Camilo Higuita's avatar
Camilo Higuita committed
11
    property string currentColor
camilo higuita's avatar
camilo higuita committed
12
    property int size : Maui.Style.iconSizes.medium
13 14 15 16 17

    Rectangle
    {
        color:"#ffded4"
        anchors.verticalCenter: parent.verticalCenter
Camilo Higuita's avatar
Camilo Higuita committed
18
        height: size
19
        width: height
camilo higuita's avatar
camilo higuita committed
20
        radius: Maui.Style.radiusV
Camilo Higuita's avatar
Camilo Higuita committed
21
        border.color: Qt.darker(color, 1.7)
22 23 24 25

        MouseArea
        {
            anchors.fill: parent
Camilo Higuita's avatar
Camilo Higuita committed
26 27 28 29 30
            onClicked:
            {
                currentColor = parent.color
                colorPicked(currentColor)
            }
31 32 33 34 35 36 37
        }
    }

    Rectangle
    {
        color:"#d3ffda"
        anchors.verticalCenter: parent.verticalCenter
Camilo Higuita's avatar
Camilo Higuita committed
38
        height: size
39
        width: height
camilo higuita's avatar
camilo higuita committed
40
        radius: Maui.Style.radiusV
Camilo Higuita's avatar
Camilo Higuita committed
41
        border.color: Qt.darker(color, 1.7)
42 43 44 45

        MouseArea
        {
            anchors.fill: parent
Camilo Higuita's avatar
Camilo Higuita committed
46 47 48 49 50
            onClicked:
            {
                currentColor = parent.color
                colorPicked(currentColor)
            }
51 52 53 54 55 56 57
        }
    }

    Rectangle
    {
        color:"#caf3ff"
        anchors.verticalCenter: parent.verticalCenter
Camilo Higuita's avatar
Camilo Higuita committed
58
        height: size
59
        width: height
camilo higuita's avatar
camilo higuita committed
60
        radius: Maui.Style.radiusV
Camilo Higuita's avatar
Camilo Higuita committed
61
        border.color: Qt.darker(color, 1.7)
62 63 64 65

        MouseArea
        {
            anchors.fill: parent
Camilo Higuita's avatar
Camilo Higuita committed
66 67 68 69 70
            onClicked:
            {
                currentColor = parent.color
                colorPicked(currentColor)
            }
71 72 73 74 75 76 77
        }
    }

    Rectangle
    {
        color:"#dbd8ff"
        anchors.verticalCenter: parent.verticalCenter
Camilo Higuita's avatar
Camilo Higuita committed
78
        height: size
79
        width: height
camilo higuita's avatar
camilo higuita committed
80
        radius: Maui.Style.radiusV
Camilo Higuita's avatar
Camilo Higuita committed
81
        border.color: Qt.darker(color, 1.7)
82 83 84 85

        MouseArea
        {
            anchors.fill: parent
Camilo Higuita's avatar
Camilo Higuita committed
86 87 88 89 90
            onClicked:
            {
                currentColor = parent.color
                colorPicked(currentColor)
            }
91 92 93 94 95 96 97
        }
    }

    Rectangle
    {
        color:"#ffcdf4"
        anchors.verticalCenter: parent.verticalCenter
Camilo Higuita's avatar
Camilo Higuita committed
98
        height: size
99
        width: height
camilo higuita's avatar
camilo higuita committed
100
        radius: Maui.Style.radiusV
Camilo Higuita's avatar
Camilo Higuita committed
101
        border.color: Qt.darker(color, 1.7)
102 103 104 105

        MouseArea
        {
            anchors.fill: parent
Camilo Higuita's avatar
Camilo Higuita committed
106 107 108 109 110
            onClicked:
            {
                currentColor = parent.color
                colorPicked(currentColor)
            }
111 112 113 114 115
        }
    }

    Rectangle
    {
116 117
        Kirigami.Theme.inherit: false
        Kirigami.Theme.colorSet: Kirigami.Theme.View
118
        color: Kirigami.Theme.backgroundColor
119
        anchors.verticalCenter: parent.verticalCenter
Camilo Higuita's avatar
Camilo Higuita committed
120
        height: size
121
        width: height
camilo higuita's avatar
camilo higuita committed
122
        radius: Maui.Style.radiusV
Camilo Higuita's avatar
Camilo Higuita committed
123
        border.color: Qt.darker(color, 1.7)
124 125 126 127

        MouseArea
        {
            anchors.fill: parent
Camilo Higuita's avatar
Camilo Higuita committed
128 129 130 131 132
            onClicked:
            {
                currentColor = parent.color
                colorPicked(currentColor)
            }
133 134
        }
    }
camilo higuita's avatar
camilo higuita committed
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154

    Kirigami.Icon
    {
        anchors.verticalCenter: parent.verticalCenter
        height: size
        width: height

        source: "edit-clear"
        color: Kirigami.Theme.textColor

        MouseArea
        {
            anchors.fill: parent
            onClicked:
            {
                currentColor = ""
                colorPicked(currentColor)
            }
        }
    }
155
}