Commit aee1f97a authored by Camilo higuita's avatar Camilo higuita

fixes on pinned notes on notesview

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