Commit 02f1e1ba authored by camilo higuita's avatar camilo higuita
Browse files

use mauikit colors bar

parent 1c44c104
......@@ -526,6 +526,7 @@ StackView
{
id: colorBar
anchors.centerIn: parent
currentColor: currentNote.color
onColorPicked:
{
notesList.update(({"color": color}), cardsView.currentIndex)
......
import QtQuick 2.0
import QtQuick.Controls 2.2
import org.kde.kirigami 2.7 as Kirigami
import org.mauikit.controls 1.0 as Maui
import org.mauikit.controls 1.3 as Maui
Row
Maui.ColorsRow
{
spacing: Maui.Style.space.medium
property color currentColor
property int size : Maui.Style.iconSizes.medium
signal colorPicked(string color)
Repeater
{
model: ["#ffded4", "#d3ffda", "#caf3ff", "#dbd8ff", "#ffcdf4"]
Rectangle
{
color: modelData
anchors.verticalCenter: parent.verticalCenter
height: size
width: size
radius: color == currentColor ? Maui.Style.radiusV : size
border.color: Qt.lighter(color, 2.5)
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = parent.color
colorPicked(currentColor)
}
}
}
}
Kirigami.Icon
{
anchors.verticalCenter: parent.verticalCenter
height: size
width: height
source: "edit-clear"
color: Kirigami.Theme.textColor
id: control
colors: ["#ffded4", "#d3ffda", "#caf3ff", "#dbd8ff", "#ffcdf4"]
MouseArea
{
anchors.fill: parent
onClicked:
{
currentColor = ""
colorPicked(currentColor)
}
}
}
}
......@@ -102,7 +102,11 @@ Maui.Page
footBar.leftContent: ColorsBar
{
onColorPicked: control.backgroundColor = color
onColorPicked:
{
control.backgroundColor = color
}
currentColor: control.backgroundColor
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment