ColorTagsBar.qml 1.03 KB
Newer Older
1
import QtQuick 2.10
2
import QtQuick.Layouts 1.3
3
import QtQuick.Controls 2.10
4
import org.kde.mauikit 1.0 as Maui
5 6 7

Item
{
camilo higuita's avatar
camilo higuita committed
8
    property int recSize: Maui.Style.iconSizes.medium
9
    readonly property int recRadius : recSize*0.05
10
    signal colorClicked(string color)
11

12 13 14
    RowLayout
    {
        anchors.fill: parent
camilo higuita's avatar
camilo higuita committed
15
        spacing: Maui.Style.space.small
16

camilo higuita's avatar
camilo higuita committed
17
        Repeater
18
        {
camilo higuita's avatar
camilo higuita committed
19
            model: vvave.moodColors()
20

camilo higuita's avatar
camilo higuita committed
21
            MouseArea
22
            {
camilo higuita's avatar
camilo higuita committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36
                Layout.fillWidth: true
                Layout.fillHeight: true
                onClicked: colorClicked(modelData)
                propagateComposedEvents: false
                Rectangle
                {
                    color: modelData
                    anchors.verticalCenter: parent.verticalCenter
                    height: recSize
                    width: height
                    radius: Maui.Style.radiusV
                    border.color: Qt.darker(color, 1.7)
                    anchors.centerIn: parent
                }
37 38 39 40 41 42 43
            }


        }

    }
}