Added navigation elements and model for bookmarks.

This commit is contained in:
Mark Washeim 2022-11-16 18:50:40 +01:00
parent b78110ba3f
commit 829346b995
18 changed files with 1359 additions and 1543 deletions

File diff suppressed because it is too large Load diff

View file

@ -116,6 +116,8 @@ var modelTLpublic = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt
var modelTLlocal = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject'); var modelTLlocal = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
var modelTLnotifications = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject'); var modelTLnotifications = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
var modelTLsearch = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject'); var modelTLsearch = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
var modelTLbookmarks = Qt.createQmlObject('import QtQuick 2.0; ListModel { }', Qt.application, 'InternalQmlObject');
var notificationsList = [] var notificationsList = []
var notificationGenerator = function(item){ var notificationGenerator = function(item){

View file

@ -6,7 +6,7 @@ import "./components/"
Page { Page {
id: mainPage id: mainPage
property bool debug: false
property bool isFirstPage: true property bool isFirstPage: true
property bool isTablet: true //Screen.sizeCategory >= Screen.Large property bool isTablet: true //Screen.sizeCategory >= Screen.Large
@ -24,7 +24,8 @@ Page {
id: navigation id: navigation
isPortrait: !mainPage.isPortrait isPortrait: !mainPage.isPortrait
onSlideshowShow: { onSlideshowShow: {
console.log(vIndex) if (debug) console.log(vIndex)
slideshow.positionViewAtIndex(vIndex, ListView.SnapToItem) slideshow.positionViewAtIndex(vIndex, ListView.SnapToItem)
} }
} }
@ -74,6 +75,15 @@ Page {
height: parent.itemHeight height: parent.itemHeight
onOpenDrawer: isPortrait ? infoPanel.open = setDrawer : infoPanel.open = true onOpenDrawer: isPortrait ? infoPanel.open = setDrawer : infoPanel.open = true
} }
MyList {
id: tlBookmarks
title: qsTr("Bookmarks")
type: "bookmarks"
mdl: Logic.modelTLbookmarks
width: isPortrait ? parent.itemWidth : parent.itemWidth - Theme.itemSizeLarge
height: parent.itemHeight
onOpenDrawer: isPortrait ? infoPanel.open = setDrawer : infoPanel.open = true
}
Item { Item {
id: tlSearch id: tlSearch
@ -84,7 +94,7 @@ Page {
width: isPortrait ? parent.itemWidth : parent.itemWidth - Theme.itemSizeLarge width: isPortrait ? parent.itemWidth : parent.itemWidth - Theme.itemSizeLarge
height: parent.itemHeight height: parent.itemHeight
onSearchChanged: { onSearchChanged: {
console.log(search) if (debug) console.log(search)
loader.sourceComponent = loading loader.sourceComponent = loading
if (search.charAt(0) === "@") { if (search.charAt(0) === "@") {
loader.sourceComponent = userListComponent loader.sourceComponent = userListComponent
@ -114,7 +124,7 @@ Page {
EnterKey.onClicked: { EnterKey.onClicked: {
tlSearch.search = text.toLowerCase().trim() tlSearch.search = text.toLowerCase().trim()
focus = false focus = false
console.log(text) if (debug) console.log(text)
} }
} }
} }
@ -270,17 +280,21 @@ Page {
function onLinkActivated(href) { function onLinkActivated(href) {
var test = href.split("/") var test = href.split("/")
console.log(href) debug = true
console.log(JSON.stringify(test)) if (debug) {
console.log(JSON.stringify(test.length)) console.log(href)
console.log(JSON.stringify(test))
console.log(JSON.stringify(test.length))
}
if (test.length === 5 && (test[3] === "tags" || test[3] === "tag") ) { if (test.length === 5 && (test[3] === "tags" || test[3] === "tag") ) {
tlSearch.search = "#"+decodeURIComponent(test[4]) tlSearch.search = "#"+decodeURIComponent(test[4])
slideshow.positionViewAtIndex(4, ListView.SnapToItem) slideshow.positionViewAtIndex(5, ListView.SnapToItem)
navigation.navigateTo('search') navigation.navigateTo('search')
console.log("search tag")
} else if (test.length === 4 && test[3][0] === "@" ) { } else if (test.length === 4 && test[3][0] === "@" ) {
tlSearch.search = decodeURIComponent("@"+test[3].substring(1)+"@"+test[2]) tlSearch.search = decodeURIComponent("@"+test[3].substring(1)+"@"+test[2])
slideshow.positionViewAtIndex(4, ListView.SnapToItem) slideshow.positionViewAtIndex(5, ListView.SnapToItem)
navigation.navigateTo('search') navigation.navigateTo('search')
} else { } else {
@ -289,6 +303,6 @@ Page {
} }
Component.onCompleted: { Component.onCompleted: {
console.log("aaa") //console.log("aaa")
} }
} }

View file

@ -38,7 +38,6 @@ SilicaGridView {
active: false active: false
unread: false unread: false
} }
ListElement { ListElement {
icon: "image://theme/icon-m-website?" icon: "image://theme/icon-m-website?"
slug: "federated" slug: "federated"
@ -47,6 +46,14 @@ SilicaGridView {
unread: false unread: false
} }
ListElement {
icon: "../../images/icon-s-bookmark.svg?"
//icon: "image://theme/icon-s-bookmark"
slug: "bookmarks"
name: "Bookmarks"
active: false
unread: false
}
ListElement { ListElement {
icon: "image://theme/icon-m-search?" icon: "image://theme/icon-m-search?"
slug: "search" slug: "search"

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Neuer Toot</translation> <translation>Neuer Toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Νέος</translation> <translation>Νέος</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Nuevo toot</translation> <translation>Nuevo toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Nouveau pouet</translation> <translation>Nouveau pouet</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Nuovo Toot</translation> <translation>Nuovo Toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Nieuwe Toot</translation> <translation>Nieuwe Toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Nieuwen toot</translation> <translation>Nieuwen toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation type="unfinished">Nòu Tut</translation> <translation type="unfinished">Nòu Tut</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Nowy wpis</translation> <translation>Nowy wpis</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Новый</translation> <translation>Новый</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Novi toot</translation> <translation>Novi toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>Ny toot</translation> <translation>Ny toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation></translation> <translation></translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>

View file

@ -149,6 +149,10 @@
<source>New Toot</source> <source>New Toot</source>
<translation>New Toot</translation> <translation>New Toot</translation>
</message> </message>
<message>
<source>Bookmarks</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
<context> <context>
<name>MediaFullScreen</name> <name>MediaFullScreen</name>