v0.6.3 Dark Mode

This commit is contained in:
LubuWest 2021-10-28 21:56:00 +02:00
commit 66e5c33b00
56 changed files with 1869 additions and 1283 deletions

View file

@ -33,6 +33,7 @@ import QtQuick 2.5
import QtQuick.LocalStorage 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import QSystemTrayIcon 1.0
import "qrc:/js/news.js" as Newsjs
@ -47,7 +48,7 @@ ApplicationWindow{
property QtObject osSettings: {var tmp=Qt.createComponent("qrc:/qml/configqml/OSSettingsLinux.qml");return tmp.createObject(root)}
width: globaloptions.hasOwnProperty("appWidth")?globaloptions.appWidth:osSettings.appWidth
height:globaloptions.hasOwnProperty("appHeight")?globaloptions.appHeight:osSettings.appHeight
visible: true
visible: filesystem.Visibility// true
property var db: ["Friendiqa", "1.0", "Stores Friendica data", 100000000]
property var login: Service.readActiveConfig(db)
property real fontFactor: root.font.pixelSize/root.font.pointSize
@ -72,6 +73,10 @@ ApplicationWindow{
property var contactposts:[]
property bool imagePicking: false
Material.theme: Material.System // globaloptions.view_darkmode==1?Material.Dark:Material.Light
color: Material.backgroundColor
function onLoginChanged(login){
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
else{
@ -138,14 +143,14 @@ ApplicationWindow{
onClosing: {
if (rootstack.currentIndex==0){
newstab.active=true;
newstab.active=true;print("newstabstatus "+newstab.newstabstatus + " newsViewType " +globaloptions.newsViewType)
if (newstab.newstabstatus!=globaloptions.newsViewType){
newstab.newstabstatus=globaloptions.newsViewType;
if(globaloptions.newsViewType=="Timeline"){Newsjs.newsfromdb(db,login.username,0,function(dbnews){
newsSignal(dbnews)
})}
else{
Newsjs.chatsfromdb(db,login.username,function(dbnews){
Newsjs.chatsfromdb(db,login.username,0,function(dbnews){
newsSignal(dbnews)
})}
close.accepted=false;
@ -159,13 +164,13 @@ ApplicationWindow{
root.pop();
close.accepted=false
}
else{
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
else{print("Closing");
Service.cleanNews(root.db,function(){print("cleannews");
Service.cleanHashtags(root.db,function(){print("cleanhashtags");
Service.cleanContacts(root.login,root.db,function(){print("cleancontacts");
if (osSettings.osType=="Android"){
Qt.quit()}
else{
else{print("show systray")
systemTray.show();
systemTray.showMessage("",qsTr("Background Sync\n Rightclick or Middleclick to Quit"),"",5000)
root.hide()
@ -180,13 +185,16 @@ ApplicationWindow{
}
Rectangle{
anchors.fill: parent
color: Material.backgroundColor
}
header: ToolBar{
position: wideScreen?ToolBar.Header:ToolBar.Footer
background: Rectangle{
anchors.fill: parent
color: "#EEEEEE"//"#F8F8F8"
color: Material.backgroundDimColor//"#EEEEEE"//"#F8F8F8"
}
RowLayout{
anchors.fill: parent
@ -206,28 +214,28 @@ ApplicationWindow{
text: "\uf03a"
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
color: Material.backgroundDimColor
}
}
TabButton {
text: "\uf0c0"
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
color: Material.backgroundDimColor
}
}
TabButton {
text: "\uf03e"
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
color: Material.backgroundDimColor
}
}
TabButton {
text: "\uf073"
background:Rectangle{
anchors.fill: parent
color: "#EEEEEE"
color: Material.backgroundDimColor
}
}
}
@ -287,10 +295,10 @@ StackView{id:rootstackView
Qt.quit()
}
}
Component.onCompleted: {
Component.onCompleted: {print("systray completed")
icon = iconTray
toolTip = qsTr("Click to open Friendiqa")
hide()
//&hide()
}
}
@ -298,6 +306,17 @@ StackView{id:rootstackView
Component.onCompleted: {
onLoginChanged(login);
globaloptions=Service.readGO(db);
if(globaloptions.view_darkmode==1){Material.theme=Material.Dark}
else if (globaloptions.view_darkmode==2){Material.theme=Material.Light}
else {Material.theme=Material.System}
if(!filesystem.Visibility){
systemTray.icon = iconTray;
// systemTray.toolTip = qsTr("Click to open Friendiqa");
systemTray.visible=true
systemTray.show();
}
if(osSettings.osType=="Android"){
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
var IntentReceiverQml = component.createObject(root);