Commit f86571eb authored by Camilo higuita's avatar Camilo higuita

testing kirigami cardsgridview

parent fdec828a
......@@ -9,5 +9,8 @@
<file>Astronaut.png</file>
<file>Faq.png</file>
<file>buho.png</file>
<file>buho72.png</file>
<file>buho96.png</file>
<file>buho.svg</file>
</qresource>
</RCC>
import QtQuick 2.9
import QtQuick.Controls 2.2
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kirigami 2.4 as Kirigami
import org.kde.mauikit 1.0 as Maui
import "src/widgets"
......@@ -27,6 +27,8 @@ Maui.ApplicationWindow
property color headBarTint : Qt.lighter(headBarBGColor, 1.25)
altColorText : "white"/*Qt.darker(accentColor, 2.5)*/
about.appDescription: qsTr("Buho allows you to take quick notes, collect links and take long notes organized by chapters.")
about.appIcon: "qrc:/buho.svg"
property int currentView : views.notes
property var views : ({
notes: 0,
......@@ -70,6 +72,7 @@ Maui.ApplicationWindow
}
]
footBarMargins: space.huge
footBarAligment: Qt.AlignRight
footBar.middleContent: [
......@@ -82,9 +85,9 @@ Maui.ApplicationWindow
model: ListModel
{
ListElement {iconName: "document-new"; mid: "page"}
ListElement {iconName: "link"; mid: "link"}
ListElement {iconName: "draw-text"; mid: "note"}
ListElement {iconName: "view-notes"; mid: "note"}
ListElement {iconName: "view-links"; mid: "link"}
ListElement {iconName: "view-books"; mid: "page"}
}
onItemClicked:
......@@ -97,6 +100,7 @@ Maui.ApplicationWindow
}
]
// /***** COMPONENTS *****/
Connections
......
mauikit @ a89b6421
Subproject commit 04529188cf1eb36e7a3304fdfeca6b7c3d76d19a
Subproject commit a89b6421a0115317a1128a2216cea40ecf9c0742
......@@ -17,5 +17,6 @@
<file>src/widgets/CardsList.qml</file>
<file>src/widgets/CardMenu.qml</file>
<file>src/utils/owl.js</file>
<file>src/widgets/CardsViewK.qml</file>
</qresource>
</RCC>
#include "buho.h"
#include <QDesktopServices>
Buho::Buho(QObject *parent) : DBActions(parent)
{
......@@ -11,11 +10,6 @@ Tagging *Buho::getTagging()
return this->tag;
}
bool Buho::openLink(const QString &url)
{
return QDesktopServices::openUrl(QUrl::fromUserInput(url));
}
void Buho::setFolders()
{
QDir notes_path(OWL::NotesPath);
......
......@@ -15,7 +15,6 @@ class Buho : public DBActions
public:
explicit Buho(QObject *parent = nullptr);
Tagging* getTagging();
Q_INVOKABLE bool openLink(const QString &url);
private:
void setFolders();
......
......@@ -4,16 +4,14 @@ import QtQuick.Layouts 1.0
import org.kde.mauikit 1.0 as Maui
import "../../widgets"
Popup
Maui.Popup
{
parent: ApplicationWindow.overlay
height: parent.height * 0.9
width: parent.width * (isMobile ? 0.9 : 0.7)
x: (parent.width / 2) - (width / 2)
y: (parent.height /2 ) - (height / 2)
modal: true
clip: true
padding: isAndroid ? 2 : "undefined"
parent: parent
heightHint: 0.95
widthHint: 0.95
maxWidth: 800*unit
maxHeight: maxWidth
property alias webView: webViewer.item
signal linkSaved(var link)
......@@ -43,7 +41,7 @@ Popup
Maui.ToolButton
{
iconName: "document-launch"
onClicked: owl.openLink(webView.url)
onClicked: Maui.FM.openUrl(webView.url)
}
]
......@@ -85,7 +83,7 @@ Popup
{
spacing: space.medium
Button
Maui.Button
{
id: discard
text: qsTr("Discard")
......@@ -93,7 +91,7 @@ Popup
}
Button
Maui.Button
{
id: save
text: qsTr("Save")
......
......@@ -5,21 +5,23 @@ import org.kde.mauikit 1.0 as Maui
GridView
{
id: control
property bool gridView : true
property alias holder : holder
property alias menu : cardMenu
readonly property int defaultSize : unit * 200
property int itemWidth : !gridView ? width :
isMobile? (width-itemSpacing) * 0.42 : unit * 200
unit * 300
property int itemHeight: unit * 120
property int itemSpacing: space.huge
signal itemClicked(int index)
boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.DragAndOvershootBounds
cellWidth: itemWidth + itemSpacing
cellWidth: width > itemWidth ? width/2 : width
cellHeight: itemHeight + itemSpacing
topMargin: Kirigami.Units.largeSpacing * 2
clip : true
Maui.Holder
......@@ -39,8 +41,11 @@ GridView
delegate: CardDelegate
{
id: delegate
cardWidth: itemWidth
cardWidth: Math.min(control.cellWidth, control.itemWidth) - Kirigami.Units.largeSpacing * 2
cardHeight: itemHeight
anchors.left: parent.left
anchors.leftMargin: control.width <= control.itemWidth ? 0 : (index % 2 === 0 ? Math.max(0, control.cellWidth - control.itemWidth) :
control.cellWidth)
onClicked:
{
......@@ -61,7 +66,7 @@ GridView
}
}
onWidthChanged: if(!isMobile && gridView) adaptGrid()
// onWidthChanged: if(!isMobile && gridView) adaptGrid()
function adaptGrid()
{
......
import QtQuick 2.9
import QtQuick.Controls 2.2
import org.kde.kirigami 2.4 as Kirigami
import org.kde.mauikit 1.0 as Maui
Kirigami.CardsGridView
{
id: cardViewRoot
property bool gridView : true
readonly property int defaultSize : unit * 200
property int itemWidth : !gridView ? width :
unit * 400
property int itemHeight: unit * 120
property int itemSpacing: space.huge
signal itemClicked(int index)
boundsBehavior: !isMobile? Flickable.StopAtBounds : Flickable.DragAndOvershootBounds
maximumColumnWidth: itemWidth
Maui.Holder
{
id: holder
visible: count < 1
z: 999
}
CardMenu
{
id: cardMenu
}
model: ListModel
{
id: cardsModel
}
CardDelegate
{
id: delegate
cardWidth: itemWidth
cardHeight: itemWidth
onClicked:
{
currentIndex = index
itemClicked(index)
}
onRightClicked:
{
currentIndex = index
cardMenu.popup()
}
onPressAndHold:
{
currentIndex = index
cardMenu.popup()
}
}
}
......@@ -5,12 +5,13 @@ import org.kde.mauikit 1.0 as Maui
import org.buho.editor 1.0
import org.kde.kirigami 2.2 as Kirigami
Popup
Maui.Popup
{
parent: ApplicationWindow.overlay
height: previewReady ? parent.height * (isMobile ? 0.8 : 0.7) :
contentLayout.implicitHeight
width: parent.width * (isMobile ? 0.9 : 0.7)
parent: parent
heightHint: 0.95
widthHint: 0.95
maxHeight: previewReady ? unit * 800 : contentLayout.implicitHeight
maxWidth: unit *700
signal linkSaved(var link)
property string selectedColor : "#ffffe6"
......@@ -32,7 +33,6 @@ Popup
}
}
Maui.Page
{
id: content
......@@ -201,14 +201,14 @@ Popup
{
spacing: space.medium
Button
Maui.Button
{
id: discard
text: qsTr("Discard")
onClicked: clear()
}
Button
Maui.Button
{
id: save
text: qsTr("Save")
......
......@@ -4,23 +4,19 @@ import QtQuick.Layouts 1.0
import org.kde.mauikit 1.0 as Maui
import org.buho.editor 1.0
Popup
Maui.Popup
{
parent: ApplicationWindow.overlay
height: parent.height * 0.8
width: parent.width * 0.9
parent: parent
heightHint: 0.95
widthHint: 0.95
maxWidth: 500*unit
maxHeight: maxWidth
property string selectedColor : "#ffffe6"
property string fgColor: Qt.darker(selectedColor, 2.5)
property bool showEditActions : false
signal noteSaved(var note)
x: (parent.width / 2) - (width / 2)
y: (parent.height /2 ) - (height / 2)
modal: true
padding: isAndroid ? 1 : "undefined"
Maui.Page
{
......@@ -203,7 +199,7 @@ Popup
{
spacing: space.medium
Button
Maui.Button
{
id: discard
text: qsTr("Discard")
......@@ -211,7 +207,7 @@ Popup
}
Button
Maui.Button
{
id: save
text: qsTr("Save")
......
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