Commit aee1f97a authored by Camilo higuita's avatar Camilo higuita

fixes on pinned notes on notesview

parent 9b20370f
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Controls 2.3
import org.kde.mauikit 1.0 as Maui
import "../../widgets"
......
import QtQuick 2.9
import QtQuick.Controls 2.4
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import "../../widgets"
import QtQml.Models 2.1
import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.2 as Kirigami
import "../../widgets"
import "../../utils/owl.js" as O
import Notes 1.0
......@@ -19,7 +23,7 @@ Maui.Page
signal noteClicked(var note)
margins: 0
margins: space.big
headBarExit : false
headBarVisible: !cardsView.holder.visible
......@@ -101,38 +105,46 @@ Maui.Page
id: notesModel
}
ColumnLayout
{
anchors.fill: parent
spacing: 0
CardsList
Rectangle
{
id: pinnedList
visible: pinButton.checked
Layout.margins: isMobile ? space.big : space.enormous
Layout.alignment: Qt.AlignVCenter
Layout.fillWidth: true
height: cardsView.itemHeight
CardsList
{
id: pinnedList
height: parent.height *0.9
width: parent.width * 0.9
anchors.centerIn: parent
itemHeight: cardsView.itemHeight * 0.9
itemWidth: itemHeight
itemWidth: itemHeight * 1.5
onItemClicked: noteClicked(cardsView.model.get(index))
}
Kirigami.Separator
{
visible: pinnedList.visible
Layout.fillWidth: true
height: unit
color: altColor
radius: radiusV
border.color: Qt.darker(altColor, 1.4)
}
CardsView
{
id: cardsView
Layout.fillHeight: true
Layout.fillWidth: true
width: parent.width
Layout.margins: space.big
onItemClicked: noteClicked(notesModel.get(index))
holder.emoji: "qrc:/Type.png"
holder.emojiSize: iconSizes.huge
......
......@@ -6,12 +6,14 @@ ListView
id: control
clip: true
property int itemWidth: unit * 200
property int itemWidth: unit * 300
property int itemHeight: unit * 200
signal itemClicked(int index)
boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.DragAndOvershootBounds
orientation: ListView.Horizontal
spacing: space.large
spacing: 0
Maui.Holder
{
id: holder
......@@ -19,12 +21,19 @@ ListView
message: "<h3>No pinned notes!</h3><p>You can pin your notes to see them here</p>"
}
model: notesView.cardsView.model
delegate: CardDelegate
model: notesView.model
delegate: Item
{
width: model.pin == 1 ? itemWidth : 0
height: model.pin == 1 ? itemHeight : 0
visible: model.pin == 1
CardDelegate
{
cardWidth: model.pin == 1 ? itemWidth : 0
cardHeight: model.pin == 1 ? itemHeight : 0
condition: model.pin == 1
cardWidth: parent.width * 0.8
cardHeight: parent.height
anchors.centerIn: parent
onClicked:
{
......@@ -32,5 +41,6 @@ ListView
itemClicked(index)
}
}
}
}
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