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 modelTLnotifications = 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 notificationGenerator = function(item){

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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