Commit 914f0aa1 authored by camilo higuita's avatar camilo higuita

more work for the boolets model

parent d0d0ab6e
......@@ -16,6 +16,7 @@ class Booklet : public MauiList
Q_PROPERTY(SORTBY sortBy READ getSortBy WRITE setSortBy NOTIFY sortByChanged)
Q_PROPERTY(ORDER order READ getOrder WRITE setOrder NOTIFY orderChanged)
Q_PROPERTY(QString book READ getBook WRITE setBook NOTIFY bookChanged)
public:
Booklet(QObject *parent = nullptr);
......@@ -45,6 +46,21 @@ public:
void setOrder(const ORDER &order);
ORDER getOrder() const;
QString getBook() const
{
return m_book;
}
public slots:
void setBook(QString book)
{
if (m_book == book)
return;
m_book = book;
emit bookChanged(m_book);
}
private:
FMH::MODEL_LIST m_list;
......@@ -53,9 +69,12 @@ private:
SORTBY sort = SORTBY::MODIFIED;
ORDER order = ORDER::DESC;
QString m_book;
signals:
void sortByChanged();
void orderChanged();
void bookChanged(QString book);
};
#endif // BOOKLET_H
......@@ -4,25 +4,90 @@ import QtQuick.Layouts 1.3
import org.kde.mauikit 1.0 as Maui
import org.kde.kirigami 2.7 as Kirigami
Maui.Page
Item
{
id: control
id: control
signal exit()
signal exit()
headBar.leftContent: ToolButton
{
icon.name: "go-previous"
onClicked: control.exit()
}
Maui.Page
{
id: _page
anchors.fill: parent
anchors.rightMargin: _drawer.modal === false ? _drawer.contentItem.width * _drawer.position : 0
Kirigami.OverlayDrawer
{
edge: Qt.RightEdge
width: Kirigami.Units.gridUnit * 16
height: parent.height - headBar.height
y: headBar.height
modal: true
}
headBar.leftContent: [
ToolButton
{
icon.name: "go-previous"
onClicked: control.exit()
},
TextField
{
id: title
Layout.fillWidth: true
Layout.margins: space.medium
placeholderText: qsTr("New chapter...")
font.weight: Font.Bold
font.bold: true
font.pointSize: fontSizes.large
// Kirigami.Theme.backgroundColor: selectedColor
// Kirigami.Theme.textColor: Qt.darker(selectedColor, 2.5)
// color: fgColor
background: Rectangle
{
color: "transparent"
}
}
]
Maui.Editor
{
anchors.fill: parent
}
Maui.Dialog
{
id: _newChapter
title: qsTr("New Chapter")
message: qsTr("Create a new chapter for your current book. Give it a title")
entryField: true
}
Kirigami.OverlayDrawer
{
id: _drawer
edge: Qt.RightEdge
width: Kirigami.Units.gridUnit * 16
height: parent.height - headBar.height
y: headBar.height
modal: !isWide
Rectangle
{
z: 999
anchors.bottom: parent.bottom
anchors.margins: toolBarHeight
anchors.horizontalCenter: parent.horizontalCenter
height: toolBarHeight
width: height
color: Kirigami.Theme.highlightColor
radius: radiusV
ToolButton
{
anchors.centerIn: parent
icon.name: "list-add"
icon.color: Qt.darker(parent.color, 2)
onClicked: _newChapter.open()
}
}
}
}
}
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