version v0.6

This commit is contained in:
LubuWest 2021-05-12 21:41:34 +02:00
commit 8482bde3ed
86 changed files with 7064 additions and 3208 deletions

View file

@ -31,20 +31,23 @@
import QtQuick 2.11
import QtQuick.Controls 2.12
//import QtQuick.Controls.Styles 2.3
//import QtQuick.Dialogs 1.3
import "qrc:/qml/newsqml"
import "qrc:/qml/genericqml"
import "qrc:/js/news.js" as Newsjs
import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/service.js" as Service
Item {
Rectangle{
id:newstabitem
width:rootstack.width//-5*mm
height: rootstack.height-8*mm//rootstack.height-100*mm
onHeightChanged: {newsSwipeview.height=height-6*mm}
//anchors.fill: parent
//onHeightChanged: {newsSwipeview.height=height-5*mm}
Timer {id:contacttimer; interval: 50; running: false; repeat: false
onTriggered: {
// downloadNotice.text=downloadNotice.text + "\n contactTimer start "+ Date.now()
root.newContacts=Newsjs.findNewContacts(root.news,root.contactlist);
root.onNewContactsChanged(root.newContacts);
Newsjs.storeNews(login,db,root.news,root)
}
}
@ -56,6 +59,7 @@ Item {
xhr.setUrl(login.server);
xhr.setApi("/api/conversation/show");
xhr.setParam("id",newsitemobject.id)
xhr.setParam("count","200")
xhr.get();
}
else{
@ -113,51 +117,101 @@ Item {
}
function onFriendsMessages(friend){
newstab.newstabstatus="Contact"
Newsjs.newsfromdb(db,root.login.username, 0,function(dbnews){
if (dbnews.length==0){
Newsjs.newsfromdb(db,login.username,0,function(forumnews){
showNews(forumnews)
},friend.url)
}
else showNews(dbnews)
},friend.id)
// CalendarTab{
// visible: wideScreen&&rootstackView.depth<2
// width: newstabitem.width/3
// x: newsSwipeview.width
// //anchors.left: newsSwipeview.right
// //anchors.fill: null
// }
// Rectangle{
// color: "#F8F8F8"
// height: parent.height
// width: 0.5*mm
// anchors.left: newsSwipeview.right
// }
BlueButton{
x:mm
y:mm
z:2
visible: !wideScreen
fontColor: "grey"
border.color: "transparent"
text: "\uf0c9"
font.pointSize: osSettings.bigFontSize
onClicked:{
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
}
Label{
text:"\uf0c9 "
font.pixelSize: 5* mm
anchors.left: parent.left
anchors.margins: mm
color: "#B0BEC5"
MouseArea{
anchors.fill: parent
onClicked:{
leftDrawer.open()
}
}
LeftDrawerLinux{
id:leftDrawer
property var newstabstatus: newstab.newstabstatus
visible: wideScreen&&rootstackView.depth<2
width: visible?root.fontFactor*osSettings.systemFontSize*15:0
height: root.height-bar.height
}
Label{
text:qsTr(newsSwipeview.stacktype)
font.pixelSize: 3* mm
anchors.horizontalCenter: parent.horizontalCenter
anchors.margins: 2*mm
LeftDrawerAndroid{
id: leftDrawerAndroid
}
// BlueButton{
// z:2
// anchors.left: newsSwipeview.left
// anchors.verticalCenter: newsSwipeview.verticalCenter//anchors.bottom: newsSwipeview.bottom
// anchors.margins: mm
// visible: wideScreen && newsSwipeview.currentIndex!=0
// text:"\uf053"
// fontColor:"grey"
// border.color: "transparent"
// color:"transparent"
// radius:0
// onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex-1}
// }
// BlueButton{
// z:2
// anchors.right: newsSwipeview.right
// anchors.verticalCenter: newsSwipeview.verticalCenter//anchors.bottom: newsSwipeview.bottom
// anchors.margins: mm
// visible: wideScreen && newsSwipeview.currentIndex!=3
// text:"\uf054"
// fontColor:"grey"
// border.color: "transparent"
// color:"transparent"
// radius:0
// onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex+1}
// }
SwipeView{
id: newsSwipeview
property string stacktype:"Home"
currentIndex: 0
width: parent.width
height: parent.height-6*mm
y: 5*mm
width: wideScreen&&rootstackView.depth<2?newstabitem.width-leftDrawer.width-mm:newstabitem.width-mm//newstabitem.width/3*2:newstabitem.width
height: newstabitem.height-4*mm
x: leftDrawer.width
function onDirectMessage(friend){currentIndex=2}
transitions: Transition {
PropertyAnimation { properties: "height";
easing.type: Easing.InOutQuad
duration: 1000
}
}
// transitions: Transition {
// PropertyAnimation { properties: "height";
// easing.type: Easing.InOutQuad
// duration: 1000
// }
// }
// Label{
// text:"\uf0c9 "
// font.pixelSize: 5* mm
// anchors.left: parent.left
// anchors.margins: mm
// color: "#B0BEC5"
// MouseArea{
// anchors.fill: parent
// onClicked:{
// leftDrawer.open()
// }
// }
// }
onCurrentIndexChanged: {
switch(currentIndex){
@ -168,6 +222,7 @@ Item {
default: stacktype="Home";
}
}
//anchors.fill: parent
Loader{
id: friendstimeline
@ -192,16 +247,17 @@ Item {
source:(newsSwipeview.currentIndex==3)? "qrc:/qml/newsqml/NewsStack.qml":""
//onLoaded: newsSwipeview.stacktype="Notifications"
}
Component.onCompleted: {root.directmessageSignal.connect(onDirectMessage)}
}
PageIndicator {
id: swipeIndicator
z:5
height: root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
count: newsSwipeview.count
currentIndex: newsSwipeview.currentIndex
anchors.bottom: newsSwipeview.bottom
anchors.horizontalCenter: parent.horizontalCenter
}
Component.onCompleted: {root.directmessageSignal.connect(newsSwipeview.onDirectMessage)}
}