Native theme, qml slimming (settings, calendar, image), tabbing, warning fixes

This commit is contained in:
MorsMortium 2023-02-24 14:24:51 +01:00
parent e1c7694202
commit 8dc907e345
87 changed files with 1339 additions and 1617 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
build-friendiqa-Desktop-Debug
friendiqa.pro.user
.directory

View File

@ -8,4 +8,3 @@
+ footer: ToolBar{ + footer: ToolBar{
background: Rectangle{ background: Rectangle{
anchors.fill: parent anchors.fill: parent
color: Material.backgroundDimColor

View File

@ -28,7 +28,7 @@ Page {
id: dialog id: dialog
anchors.centerIn: parent anchors.centerIn: parent
title: "Dialog" title: "Dialog"
Text { Label {
text: "Demo" text: "Demo"
} }
z: 20 z: 20

View File

@ -1 +0,0 @@
../source-linux/application.qrc

1
source-android/application.qrc Executable file
View File

@ -0,0 +1 @@
../source-linux/application.qrc

View File

@ -1 +0,0 @@
../../source-linux/common/alarm.h

1
source-android/common/alarm.h Executable file
View File

@ -0,0 +1 @@
../../source-linux/common/alarm.h

View File

@ -1 +0,0 @@
../../source-linux/common/alarmandroid.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/alarmandroid.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/alarmlinux.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/alarmlinux.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/filesystem.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/filesystem.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/filesystem.h

View File

@ -0,0 +1 @@
../../source-linux/common/filesystem.h

View File

@ -1 +0,0 @@
../../source-linux/common/filesystemandroid.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/filesystemandroid.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/remoteauthasyncimageprovider.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/remoteauthasyncimageprovider.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/remoteauthasyncimageprovider.h

View File

@ -0,0 +1 @@
../../source-linux/common/remoteauthasyncimageprovider.h

View File

@ -1 +0,0 @@
../../source-linux/common/updatenews.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/updatenews.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/updatenews.h

View File

@ -0,0 +1 @@
../../source-linux/common/updatenews.h

View File

@ -1 +0,0 @@
../../source-linux/common/uploadableimage.cpp

View File

@ -0,0 +1 @@
../../source-linux/common/uploadableimage.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/uploadableimage.h

View File

@ -0,0 +1 @@
../../source-linux/common/uploadableimage.h

View File

@ -1 +0,0 @@
../../source-linux/common/xhr.cpp

1
source-android/common/xhr.cpp Executable file
View File

@ -0,0 +1 @@
../../source-linux/common/xhr.cpp

View File

@ -1 +0,0 @@
../../source-linux/common/xhr.h

1
source-android/common/xhr.h Executable file
View File

@ -0,0 +1 @@
../../source-linux/common/xhr.h

View File

@ -1 +0,0 @@
../source-linux/images

1
source-android/images Executable file
View File

@ -0,0 +1 @@
../source-linux/images

View File

@ -1 +0,0 @@
../source-linux/js

1
source-android/js Executable file
View File

@ -0,0 +1 @@
../source-linux/js

View File

@ -1 +0,0 @@
../../source-linux/qml/calendarqml

1
source-android/qml/calendarqml Executable file
View File

@ -0,0 +1 @@
../../source-linux/qml/calendarqml

View File

@ -1 +0,0 @@
../../source-linux/qml/configqml

1
source-android/qml/configqml Executable file
View File

@ -0,0 +1 @@
../../source-linux/qml/configqml

View File

@ -1 +0,0 @@
../../source-linux/qml/contactqml

1
source-android/qml/contactqml Executable file
View File

@ -0,0 +1 @@
../../source-linux/qml/contactqml

View File

@ -1 +0,0 @@
../../source-linux/qml/genericqml

1
source-android/qml/genericqml Executable file
View File

@ -0,0 +1 @@
../../source-linux/qml/genericqml

View File

@ -1 +0,0 @@
../../source-linux/qml/newsqml

1
source-android/qml/newsqml Executable file
View File

@ -0,0 +1 @@
../../source-linux/qml/newsqml

View File

@ -1 +0,0 @@
../../source-linux/qml/photoqml

1
source-android/qml/photoqml Executable file
View File

@ -0,0 +1 @@
../../source-linux/qml/photoqml

View File

@ -1 +0,0 @@
../source-linux/qtquickcontrols2.conf

View File

@ -0,0 +1 @@
../source-linux/qtquickcontrols2.conf

View File

@ -1 +0,0 @@
../source-linux/translations

1
source-android/translations Executable file
View File

@ -0,0 +1 @@
../source-linux/translations

View File

@ -26,9 +26,9 @@
<file>qml/genericqml/ImagePickerLinux.qml</file> <file>qml/genericqml/ImagePickerLinux.qml</file>
<file>qml/genericqml/Search.qml</file> <file>qml/genericqml/Search.qml</file>
<file>qml/genericqml/IntentReceiver.qml</file> <file>qml/genericqml/IntentReceiver.qml</file>
<file>qml/genericqml/MButton.qml</file>
<file>qml/genericqml/LinuxSync.qml</file> <file>qml/genericqml/LinuxSync.qml</file>
<file>qml/genericqml/BlueButton.qml</file> <file>qml/genericqml/BlueButton.qml</file>
<file>qml/genericqml/CloseButton.qml</file>
<file>qml/genericqml/ContactComponent.qml</file> <file>qml/genericqml/ContactComponent.qml</file>
<file>qml/genericqml/PermissionDialog.qml</file> <file>qml/genericqml/PermissionDialog.qml</file>
<file>qml/calendarqml/CalendarTab.qml</file> <file>qml/calendarqml/CalendarTab.qml</file>
@ -224,7 +224,6 @@
<file>images/smileys/adult/finger.gif</file> <file>images/smileys/adult/finger.gif</file>
<file>images/smileys/adult/sperm.gif</file> <file>images/smileys/adult/sperm.gif</file>
<file>images/smileys/adult/tits.gif</file> <file>images/smileys/adult/tits.gif</file>
<file>images/addImage.png</file>
<file>common/filesystem.cpp</file> <file>common/filesystem.cpp</file>
<file>common/filesystem.h</file> <file>common/filesystem.h</file>
<file>common/friendiqa.cpp</file> <file>common/friendiqa.cpp</file>
@ -246,7 +245,8 @@
<file>translations/friendiqa-hu.qm</file> <file>translations/friendiqa-hu.qm</file>
<file>translations/friendiqa-hu.ts</file> <file>translations/friendiqa-hu.ts</file>
<file>images/Friendiqa.png</file> <file>images/Friendiqa.png</file>
<file>images/Friendica_monochrome.png</file> <file>images/friendica-tray-black.svg</file>
<file>images/friendica-tray-white.svg</file>
<file>qml/configqml/ConfigAppearancePage.qml</file> <file>qml/configqml/ConfigAppearancePage.qml</file>
<file>qml/configqml/ConfigStartPage.qml</file> <file>qml/configqml/ConfigStartPage.qml</file>
<file>qml/contactqml/ContactsSearchPage.qml</file> <file>qml/contactqml/ContactsSearchPage.qml</file>

View File

@ -56,4 +56,4 @@ private:
int m_time; int m_time;
}; };
#endif // UPDATENEWS_H #endif // ALARM_H

View File

@ -47,6 +47,7 @@
//#include <QQuickWidget> //#include <QQuickWidget>
#include <QSystemTrayIcon> #include <QSystemTrayIcon>
#include <QQmlContext> #include <QQmlContext>
#include <QQuickStyle>
// Declare a user-defined data type to work with an icon in QML // Declare a user-defined data type to work with an icon in QML
Q_DECLARE_METATYPE(QSystemTrayIcon::ActivationReason) Q_DECLARE_METATYPE(QSystemTrayIcon::ActivationReason)
@ -105,11 +106,16 @@ int main(int argc, char *argv[]) {
ALARM* alarm = ALARM::instance(); ALARM* alarm = ALARM::instance();
view.rootContext()->setContextProperty("alarm", alarm); view.rootContext()->setContextProperty("alarm", alarm);
UPDATENEWS* updatenews = UPDATENEWS::instance(); UPDATENEWS* updatenews = UPDATENEWS::instance();
updatenews->setDatabase();
if(updatenews->getStyle() != 0){
QQuickStyle::setStyle("Material");
}
view.rootContext()->setContextProperty("updatenews", updatenews); view.rootContext()->setContextProperty("updatenews", updatenews);
qmlRegisterType<QSystemTrayIcon>("QSystemTrayIcon", 1, 0, "QSystemTrayIcon"); qmlRegisterType<QSystemTrayIcon>("QSystemTrayIcon", 1, 0, "QSystemTrayIcon");
qRegisterMetaType<QSystemTrayIcon::ActivationReason>("ActivationReason"); qRegisterMetaType<QSystemTrayIcon::ActivationReason>("ActivationReason");
view.rootContext()->setContextProperty("iconTray", QIcon(":/images/Friendica_monochrome.png")); view.rootContext()->setContextProperty("iconTrayBlack", QIcon(QPixmap(":/images/friendica-tray-black.svg")));
view.rootContext()->setContextProperty("iconTrayWhite", QIcon(QPixmap(":/images/friendica-tray-white.svg")));
view.rootContext()->setContextProperty("iconTrayAvailable", QSystemTrayIcon::isSystemTrayAvailable()); view.rootContext()->setContextProperty("iconTrayAvailable", QSystemTrayIcon::isSystemTrayAvailable());
view.load(QUrl("qrc:/qml/friendiqa.qml")); view.load(QUrl("qrc:/qml/friendiqa.qml"));

View File

@ -86,6 +86,16 @@ void UPDATENEWS::setDatabase()
} }
} }
int UPDATENEWS::getStyle()
{
QSqlQuery syncquery("SELECT * FROM globaloptions",m_db);
while (syncquery.next()){
if (syncquery.value(0).toString()=="view_darkmode"){
return syncquery.value(1).toInt();
}
}
return 0;
}
void UPDATENEWS::login() void UPDATENEWS::login()
{ {

View File

@ -63,6 +63,7 @@ public slots:
void setUrl(QString url); void setUrl(QString url);
void setSyncAll(bool syncAll); void setSyncAll(bool syncAll);
void setDatabase(); void setDatabase();
int getStyle();
void login(); void login();
void timeline(); void timeline();
void replies(); void replies();

View File

@ -317,7 +317,7 @@ void XHR::onRequestFinished()
else if (m_downloadtype=="picturelist") { else if (m_downloadtype=="picturelist") {
QJsonDocument jsonResponse = QJsonDocument::fromJson(buffer); QJsonDocument jsonResponse = QJsonDocument::fromJson(buffer);
QJsonObject jsonObject = jsonResponse.object(); QJsonObject jsonObject = jsonResponse.object();
int arraystart=buffer.indexOf('{"data":"')+8; int arraystart=buffer.indexOf("{\"data\":\"")+8;
int arraylength=buffer.indexOf('"',9)-arraystart; int arraylength=buffer.indexOf('"',9)-arraystart;
QByteArray b64=buffer.mid(arraystart,arraylength); QByteArray b64=buffer.mid(arraystart,arraylength);
QString helpfilename=jsonObject["filename"].toString(); QString helpfilename=jsonObject["filename"].toString();

View File

@ -13,7 +13,7 @@
TEMPLATE = app TEMPLATE = app
TARGET = friendiqa TARGET = friendiqa
CONFIG += release CONFIG += release
QT += qml quick gui widgets sql webview dbus webengine QT += qml quick gui widgets sql webview dbus webengine quickcontrols2
SOURCES += common/friendiqa.cpp \ SOURCES += common/friendiqa.cpp \
common/uploadableimage.cpp \ common/uploadableimage.cpp \

Binary file not shown.

Before

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg
width="658.75421"
height="657.44232"
viewBox="-10 -5 851.43982 849.7442"
version="1.1"
id="svg4"
sodipodi:docname="friendica-tray-black.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="0.67875"
inkscape:cx="334.43831"
inkscape:cy="259.30018"
inkscape:window-width="1366"
inkscape:window-height="701"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
fill="#000000"
d="m 140.74419,-5 q -37,0 -70.500004,18.5 -33.5,18.5 -54.5,50 -21,31.5 -24,68.5 v 1 q -1,113 -1,337 v 206 q -4,40 13.5,77.5 17.5,37.5 50.5,62 33,24.5 74.000004,27.5 h 1 q 112,1 337,1 h 206 q 40,4 77.5,-13.5 37.5,-17.5 62,-50.5 24.5,-33 27.5,-74 v -1 q 1,-113 1,-338 V 160 q 4,-41 -15,-79 -19,-38 -54,-61.5 -35,-23.5 -77,-24.5 z m 411,34 h 143 q 31,0 58,19 27,19 42,49 15,30 12,61 v 209 q 0,225 -1,337 -2,31 -21.5,56.5 -19.5,25.5 -49,39 -29.5,13.5 -60.5,10.5 h -395 V 606 h 272 l -1,-203 -271,1 V 232 h 272 z"
id="path2" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg
width="658.75421"
height="657.44232"
viewBox="-10 -5 851.43982 849.7442"
version="1.1"
id="svg4"
sodipodi:docname="friendica-tray-white.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="0.67875"
inkscape:cx="290.97606"
inkscape:cy="377.1639"
inkscape:window-width="1366"
inkscape:window-height="701"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
fill="#ffffff"
d="m 140.74419,-5 q -37,0 -70.500004,18.5 -33.5,18.5 -54.5,50 -21,31.5 -24,68.5 v 1 q -1,113 -1,337 v 206 q -4,40 13.5,77.5 17.5,37.5 50.5,62 33,24.5 74.000004,27.5 h 1 q 112,1 337,1 h 206 q 40,4 77.5,-13.5 37.5,-17.5 62,-50.5 24.5,-33 27.5,-74 v -1 q 1,-113 1,-338 V 160 q 4,-41 -15,-79 -19,-38 -54,-61.5 -35,-23.5 -77,-24.5 z m 411,34 h 143 q 31,0 58,19 27,19 42,49 15,30 12,61 v 209 q 0,225 -1,337 -2,31 -21.5,56.5 -19.5,25.5 -49,39 -29.5,13.5 -60.5,10.5 h -395 V 606 h 272 l -1,-203 -271,1 V 232 h 272 z"
id="path2" />
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -29,8 +29,8 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick.Controls 2.12
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls.Material 2.12
//import QtQuick.Controls 2.4 //import QtQuick.Controls 2.4
Item { Item {
@ -38,28 +38,27 @@ Item {
width: root.fontFactor*osSettings.bigFontSize*2 width: root.fontFactor*osSettings.bigFontSize*2
height: root.fontFactor*osSettings.bigFontSize*2 height: root.fontFactor*osSettings.bigFontSize*2
property int dateInt: Math.floor(model.date.valueOf()/86400000) property int dateInt: Math.floor(model.date.valueOf()/86400000)
Rectangle { opacity: (model.month==monthgrid.month)?1:0.2
id: placeHolder Label {
color: model.today?'lightblue':'transparent';
border.color: 'lightblue'
border.width: 2
antialiasing: true
anchors.fill:parent
radius: 0.5*mm
}
Text {
id:daytext id:daytext
anchors.right: parent.right anchors.right: parent.right
anchors.margins: 0.5*mm anchors.margins: 0.5*mm
color:(model.month==monthgrid.month)?Material.primaryTextColor:Material.secondaryTextColor
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
text: model.day text: model.day
font.bold: model.today font.bold: model.today
font.pointSize: 1.2*osSettings.systemFontSize font.pointSize: 1.2*osSettings.systemFontSize
} }
Rectangle { Rectangle {
id: placeHolder
border.color: model.today?'red':daytext.color;
color:"transparent"
border.width: 2
antialiasing: true
anchors.fill:parent
radius: 0.5*mm
}
Item {
id:eventRect id:eventRect
color:"grey"
anchors.margins: 0.5*mm anchors.margins: 0.5*mm
anchors.bottom: calendarDay.bottom anchors.bottom: calendarDay.bottom
width: parent.width-mm width: parent.width-mm

View File

@ -31,21 +31,19 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.15 import QtQuick.Controls 2.15
import QtQuick.Controls.Material 2.12
import QtQml 2.2 import QtQml 2.2
import Qt.labs.calendar 1.0 import Qt.labs.calendar 1.0
//import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/calendarqml" import "qrc:/qml/calendarqml"
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Rectangle { Item {
id:calendarrectangle id:calendarrectangle
// y:1 // y:1
width:parent.width width: (parent != null)?parent.width:0
height:parent.height height: (parent != null)?parent.height:0
color: Material.backgroundColor
property date currentTime: new Date() property date currentTime: new Date()
property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000 property int offsetTime: currentTime.getTimezoneOffset() * 60 * 1000
property var events:[] property var events:[]
@ -68,7 +66,7 @@ Rectangle {
eventdays=dayArray; eventdays=dayArray;
calBusy.running=false calBusy.running=false
var currentevents=events; var currentevents=events;
var currentevents=events.filter(event=>(currentTime<=event.end)); currentevents=events.filter(event=>(currentTime<=event.end));
for (var i=0; i<Math.min(5,currentevents.length);i++){ for (var i=0; i<Math.min(5,currentevents.length);i++){
var liststate=""; var liststate="";
eventModel.append({"event":currentevents[i],"eventstatus":liststate}); eventModel.append({"event":currentevents[i],"eventstatus":liststate});
@ -102,10 +100,7 @@ Rectangle {
BlueButton{ BlueButton{
z:2 z:2
visible: !wideScreen visible: !wideScreen
fontColor: "grey"
border.color: "transparent"
text: "\uf0c9" text: "\uf0c9"
font.pointSize: osSettings.bigFontSize
onClicked:{ onClicked:{
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()} leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
} }
@ -122,7 +117,7 @@ Rectangle {
id: leftDrawerAndroid id: leftDrawerAndroid
} }
MButton{ Button{
id: updateEvents id: updateEvents
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
@ -165,7 +160,7 @@ Rectangle {
onRejected: {close()} onRejected: {close()}
} }
MButton{ Button{
id: createNewEvent id: createNewEvent
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
@ -191,7 +186,7 @@ Rectangle {
} }
} }
MButton{ Button{
id: calendartabstatusButton id: calendartabstatusButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm
@ -229,24 +224,21 @@ Rectangle {
from: new Date() from: new Date()
to: new Date(new Date().valueOf()+93312000000) to: new Date(new Date().valueOf()+93312000000)
} }
delegate: delegate: Item {
Item{ width: (parent != null)?Math.min(23*root.fontFactor*osSettings.bigFontSize,parent.width):0
width:Math.min(23*root.fontFactor*osSettings.bigFontSize,calendarView.width) height: (parent != null)?parent.height:0
height: parent.height Label{
Text{
font.bold: true font.bold: true
//Layout.fillWidth: true //Layout.fillWidth: true
width: parent.width-root.fontFactor*osSettings.bigFontSize width: parent.width-root.fontFactor*osSettings.bigFontSize
horizontalAlignment:Text.AlignHCenter horizontalAlignment:Text.AlignHCenter
color: Material.primaryTextColor
text: model.year text: model.year
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
} }
Text{y:1.5*root.fontFactor*osSettings.bigFontSize Label{y:1.5*root.fontFactor*osSettings.bigFontSize
width: parent.width-osSettings.bigFontSize width: parent.width-osSettings.bigFontSize
text: Qt.locale().standaloneMonthName(model.month) text: Qt.locale().standaloneMonthName(model.month)
//Layout.fillWidth: true //Layout.fillWidth: true
color: Material.primaryTextColor
horizontalAlignment:Text.AlignHCenter horizontalAlignment:Text.AlignHCenter
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
} }
@ -255,6 +247,12 @@ Rectangle {
locale: monthgrid.locale locale: monthgrid.locale
//Layout.fillWidth: true //Layout.fillWidth: true
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
delegate: Label {
text: model.shortName
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
} }
MonthGrid {y:5*root.fontFactor*osSettings.bigFontSize MonthGrid {y:5*root.fontFactor*osSettings.bigFontSize

View File

@ -31,8 +31,8 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls 1.4 as Oldcontrols import QtQuick.Controls 1.4 as Oldcontrols
import QtQuick.Controls.Styles 1.4
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
@ -42,9 +42,9 @@ Flickable{
id:eventCreateBox id:eventCreateBox
property date startDate: new Date() property date startDate: new Date()
property var eventInformation: ({}) property var eventInformation: ({})
anchors.fill: parent width: (parent != null)?parent.width:0
height: (parent != null)?parent.height:0
contentWidth: eventRect.width; contentHeight: eventRect.height
function formatText(count, modelData) { function formatText(count, modelData) {
var data = count === 12 ? modelData + 1 : modelData; var data = count === 12 ? modelData + 1 : modelData;
return data.toString().length < 2 ? "0" + data : data; return data.toString().length < 2 ? "0" + data : data;
@ -52,339 +52,325 @@ Flickable{
boundsBehavior:Flickable.StopAtBounds boundsBehavior:Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar { } ScrollBar.vertical: ScrollBar { }
Rectangle{
id: eventRect
width: root.width
height: textColumn.height + 6*root.fontFactor*osSettings.bigFontSize
color: Material.backgroundColor
MButton{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
onClicked:{rootstackView.pop()}
}
Label{ Button{
x: 0.5*root.fontFactor*osSettings.bigFontSize id:closeButton
y: 2*root.fontFactor*osSettings.bigFontSize anchors.top: parent.top
width: 3*root.fontFactor*osSettings.bigFontSize anchors.topMargin: 1*mm
height: root.fontFactor*osSettings.bigFontSize anchors.right: parent.right
font.pointSize: osSettings.systemFontSize anchors.rightMargin: 1*mm
//verticalAlignment: TextInput.AlignBottom width: height
color: Material.primaryTextColor text: "\uf057"
text:qsTr("Start") onClicked: {rootstackView.pop()}
} }
TextField { Label {
id: textStartDate x: 0.5*root.fontFactor*osSettings.bigFontSize
property string dateDay:(startDate.getDate()).toString().length<2?"0"+(startDate.getDate()):(startDate.getDate()) y: 2*root.fontFactor*osSettings.bigFontSize
property string dateMonth: (startDate.getMonth()+1).toString().length<2?"0"+(startDate.getMonth()+1):(startDate.getMonth()+1) width: 3*root.fontFactor*osSettings.bigFontSize
x: 4*root.fontFactor*osSettings.bigFontSize height: root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize font.pointSize: osSettings.systemFontSize
width: 5*root.fontFactor*osSettings.bigFontSize text:qsTr("Start")
height: 2.5*root.fontFactor*osSettings.bigFontSize }
font.pointSize: osSettings.systemFontSize
horizontalAlignment: TextInput.AlignRight
text: dateDay+"-"+dateMonth+"-"+startDate.getFullYear()
inputMask: "99-99-9999"
validator: RegExpValidator{regExp: /^([0-2\s]?[0-9\s]|3[0-1\s])-(0[0-9\s]|1[0-2\s])-([0-9\s][0-9\s][0-9\s][0-9\s])$ / }
font.bold: true
}
MButton { TextField {
id: textStartDateDropdown id: textStartDate
x: 9.5*root.fontFactor*osSettings.bigFontSize property string dateDay:(startDate.getDate()).toString().length<2?"0"+(startDate.getDate()):(startDate.getDate())
y: root.fontFactor*osSettings.bigFontSize property string dateMonth: (startDate.getMonth()+1).toString().length<2?"0"+(startDate.getMonth()+1):(startDate.getMonth()+1)
width: 2*root.fontFactor*osSettings.bigFontSize x: 4*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize y: root.fontFactor*osSettings.bigFontSize
text:"\uf0d7" width: 5*root.fontFactor*osSettings.bigFontSize
onClicked:{ height: 2.5*root.fontFactor*osSettings.bigFontSize
cal.visible=true; font.pointSize: osSettings.systemFontSize
cal.curSelection="start" horizontalAlignment: TextInput.AlignRight
} text: dateDay+"-"+dateMonth+"-"+startDate.getFullYear()
} inputMask: "99-99-9999"
validator: RegExpValidator{regExp: /^([0-2\s]?[0-9\s]|3[0-1\s])-(0[0-9\s]|1[0-2\s])-([0-9\s][0-9\s][0-9\s][0-9\s])$ / }
font.bold: true
}
TextField { Button {
id: textStartTime id: textStartDateDropdown
x: 13*root.fontFactor*osSettings.bigFontSize x: 9.5*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize y: root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize width: 2*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize text:"\uf0d7"
inputMask: "99:99" onClicked:{
text: "00:00" cal.visible=true;
horizontalAlignment: TextInput.AlignRight cal.curSelection="start"
validator: RegExpValidator{regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s])$ / }
font.bold: true
} }
}
MButton { TextField {
id: textStartTimeDropdown id: textStartTime
x: 16.5*root.fontFactor*osSettings.bigFontSize x: 13*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize y: root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize width: 3*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize height: 2.5*root.fontFactor*osSettings.bigFontSize
text:"\uf0d7" font.pointSize: osSettings.systemFontSize
onClicked:{ inputMask: "99:99"
onClicked: {timeTumbler.visible=true;timeTumbler.curSelection="start"} text: "00:00"
} horizontalAlignment: TextInput.AlignRight
} validator: RegExpValidator{regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s])$ / }
font.bold: true
}
Label{ Button {
x: 0.5*root.fontFactor*osSettings.bigFontSize id: textStartTimeDropdown
y: 4*root.fontFactor*osSettings.bigFontSize x: 16.5*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize y: root.fontFactor*osSettings.bigFontSize
height: root.fontFactor*osSettings.bigFontSize width: 2*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize height: 2*root.fontFactor*osSettings.bigFontSize
color: Material.primaryTextColor text:"\uf0d7"
text:qsTr("End") onClicked:{
} onClicked: {timeTumbler.visible=true;timeTumbler.curSelection="start"}
TextField {
id: textEndDate
x: 4*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize
width: 5*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
horizontalAlignment: TextInput.AlignRight
inputMask: "99-99-9999"
validator: RegExpValidator{regExp: /^([0-2\s]?[0-9\s]|3[0-1\s])-(0[0-9\s]|1[0-2\s])-([0-9\s][0-9\s][0-9\s][0-9\s])$ / }
enabled: false
font.bold: true
} }
}
MButton { Label{
id: textEndDateDropdown x: 0.5*root.fontFactor*osSettings.bigFontSize
x: 9.5*root.fontFactor*osSettings.bigFontSize y: 4*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize width: 3*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize height: root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize font.pointSize: osSettings.systemFontSize
enabled: false text:qsTr("End")
text:"\uf0d7" }
onClicked:{ TextField {
cal.visible=true; id: textEndDate
cal.curSelection="end" x: 4*root.fontFactor*osSettings.bigFontSize
} y: 3*root.fontFactor*osSettings.bigFontSize
} width: 5*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
horizontalAlignment: TextInput.AlignRight
inputMask: "99-99-9999"
validator: RegExpValidator{regExp: /^([0-2\s]?[0-9\s]|3[0-1\s])-(0[0-9\s]|1[0-2\s])-([0-9\s][0-9\s][0-9\s][0-9\s])$ / }
enabled: false
font.bold: true
}
TextField { Button {
id: textEndTime id: textEndDateDropdown
x: 13*root.fontFactor*osSettings.bigFontSize x: 9.5*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize y: 3*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize width: 2*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize enabled: false
enabled: false text:"\uf0d7"
horizontalAlignment: TextInput.AlignRight onClicked:{
inputMask: "99:99" cal.visible=true;
validator: RegExpValidator{regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s])$ / } cal.curSelection="end"
font.bold: true
} }
}
MButton { TextField {
id: textEndTimeDropdown id: textEndTime
x: 16.5*root.fontFactor*osSettings.bigFontSize x: 13*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize y: 3*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize width: 3*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize height: 2.5*root.fontFactor*osSettings.bigFontSize
enabled: false font.pointSize: osSettings.systemFontSize
text:"\uf0d7" enabled: false
onClicked:{ horizontalAlignment: TextInput.AlignRight
onClicked: {timeTumbler.visible=true;timeTumbler.curSelection="end"} inputMask: "99:99"
} validator: RegExpValidator{regExp: /^([0-1\s]?[0-9\s]|2[0-3\s]):([0-5\s][0-9\s])$ / }
font.bold: true
}
Button {
id: textEndTimeDropdown
x: 16.5*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
enabled: false
text:"\uf0d7"
onClicked:{
onClicked: {timeTumbler.visible=true;timeTumbler.curSelection="end"}
} }
}
Column{ Column{
id: textColumn x: 4*root.fontFactor*osSettings.bigFontSize
x: 4*root.fontFactor*osSettings.bigFontSize y: 6*root.fontFactor*osSettings.bigFontSize
y: 6*root.fontFactor*osSettings.bigFontSize width: parent.width-7*root.fontFactor*osSettings.bigFontSize
width: parent.width-7*root.fontFactor*osSettings.bigFontSize Oldcontrols.Calendar{
Oldcontrols.Calendar{ id:cal
id:cal property string curSelection: "start"
property string curSelection: "start" width: 12*root.fontFactor*osSettings.bigFontSize
width: 12*root.fontFactor*osSettings.bigFontSize height: 15*root.fontFactor*osSettings.bigFontSize
height: 15*root.fontFactor*osSettings.bigFontSize visible: false
visible: false selectedDate: new Date()
selectedDate: new Date() onClicked: {
onClicked: { if (curSelection=="start"){
if (curSelection=="start"){ textStartDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
textStartDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy"); }else{
}else{ textEndDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
textEndDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
}
cal.visible=false
} }
cal.visible=false
} }
style: CalendarStyle {
Frame { dayDelegate: Rectangle {
id: timeTumbler color:"transparent"
width: 12*root.fontFactor*osSettings.bigFontSize opacity: styleData.visibleMonth ? 1 : 0.2
height: 10*root.fontFactor*osSettings.bigFontSize
visible: false
property string curSelection: "start"
Row {
Tumbler {
id: hoursTumbler
model: 24
delegate: tumblerDelegateComponent
currentIndex: 12
}
Tumbler {
id: minutesTumbler
model: 60
delegate: tumblerDelegateComponent
}
}
MButton {
id: timeInputfinished
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text:"\uf00c"
onClicked:{
if (timeTumbler.curSelection=="start"){
textStartTime.text=formatText(24,hoursTumbler.currentIndex)+":"+formatText(60,minutesTumbler.currentIndex);
}else{
textEndTime.text=formatText(24,hoursTumbler.currentIndex)+":"+formatText(60,minutesTumbler.currentIndex);
}
timeTumbler.visible=false
}
}
}
CheckBox{
id: checkNoEndTime
width: 12*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
checked: true
font.pointSize: osSettings.systemFontSize
text: qsTr("no end")
onCheckedChanged: {
if(checked==true){
textEndDate.enabled=false;
textEndDateDropdown.enabled=false;
textEndTime.enabled=false;
textEndTimeDropdown.enabled=false;
textEndDate.text="";
textEndTime.text=""
}else{
textEndDate.enabled=true;
textEndDateDropdown.enabled=true;
textEndTime.enabled=true;
textEndTimeDropdown.enabled=true;
textEndDate.text=textStartDate.text;
textEndTime.text=textStartTime.text
}
}
}
TextField {
id: titleField
width: parent.width-root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: true
placeholderText: qsTr("Title (required)")
}
Rectangle{
color: Material.backgroundColor
radius: 0.5*mm
width: parent.width-root.fontFactor*osSettings.bigFontSize
height:Math.max(bodyField.contentHeight+root.fontFactor*osSettings.bigFontSize,2.5*root.fontFactor*osSettings.bigFontSize)
TextArea {
id: bodyField
anchors.fill: parent anchors.fill: parent
font.pointSize: osSettings.systemFontSize Label {
font.family: "Noto Sans" id: daytext
wrapMode: Text.Wrap text: styleData.date.getDate()
selectByMouse: true anchors.centerIn: parent
placeholderText: qsTr("Event description (optional)") }
textFormat: TextEdit.PlainText border.width: 1
text: eventInformation.hasOwnProperty("text")?eventInformation.text:"" border.color: styleData.selected?'red':daytext.color;
onLinkActivated:{Qt.openUrlExternally(link)} }
dayOfWeekDelegate:Item {
height: root.fontFactor*osSettings.bigFontSize
Label {
text: control.__locale.dayName(styleData.dayOfWeek, control.dayOfWeekFormat)
anchors.centerIn: parent
}
}
background:Item {}
navigationBar: Item {
height: root.fontFactor*osSettings.bigFontSize
ToolButton {
height: parent.height
id: previousMonth
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left
icon.name: "go-previous"
onClicked: control.showPreviousMonth()
}
Label {
height: parent.height
text: styleData.title
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
anchors.left: previousMonth.right
anchors.right: nextMonth.left
}
ToolButton {
height: parent.height
id: nextMonth
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
icon.name: "go-next"
onClicked: control.showNextMonth()
}
} }
} }
}
TextField { Frame {
id: locationField id: timeTumbler
width: parent.width-root.fontFactor*osSettings.bigFontSize width: 12*root.fontFactor*osSettings.bigFontSize
height: 10*root.fontFactor*osSettings.bigFontSize
visible: false
property string curSelection: "start"
Row {
Tumbler {
id: hoursTumbler
model: 24
delegate: tumblerDelegateComponent
currentIndex: 12
}
Tumbler {
id: minutesTumbler
model: 60
delegate: tumblerDelegateComponent
}
}
Button {
id: timeInputfinished
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text:"\uf00c"
onClicked:{
if (timeTumbler.curSelection=="start"){
textStartTime.text=formatText(24,hoursTumbler.currentIndex)+":"+formatText(60,minutesTumbler.currentIndex);
}else{
textEndTime.text=formatText(24,hoursTumbler.currentIndex)+":"+formatText(60,minutesTumbler.currentIndex);
}
timeTumbler.visible=false
}
}
}
CheckBox{
id: checkNoEndTime
width: 12*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
checked: true
font.pointSize: osSettings.systemFontSize
text: qsTr("no end")
onCheckedChanged: {
if(checked==true){
textEndDate.enabled=false;
textEndDateDropdown.enabled=false;
textEndTime.enabled=false;
textEndTimeDropdown.enabled=false;
textEndDate.text="";
textEndTime.text=""
}else{
textEndDate.enabled=true;
textEndDateDropdown.enabled=true;
textEndTime.enabled=true;
textEndTimeDropdown.enabled=true;
textEndDate.text=textStartDate.text;
textEndTime.text=textStartTime.text
}
}
}
TextField {
id: titleField
width: parent.width-root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
font.bold: true
placeholderText: qsTr("Title (required)")
}
Item{
width: parent.width-root.fontFactor*osSettings.bigFontSize
height:Math.max(bodyField.contentHeight+root.fontFactor*osSettings.bigFontSize,2.5*root.fontFactor*osSettings.bigFontSize)
TextArea {
id: bodyField
anchors.fill: parent
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
placeholderText: qsTr("Location (optional)") font.family: "Noto Sans"
wrapMode: Text.Wrap
selectByMouse: true
placeholderText: qsTr("Event description (optional)")
onLinkActivated:{Qt.openUrlExternally(link)}
} }
}
CheckBox{ TextField {
id: chkbxPublish id: locationField
width: 10*root.fontFactor*osSettings.bigFontSize width: parent.width-root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize font.pointSize: osSettings.systemFontSize
checked: true placeholderText: qsTr("Location (optional)")
font.pointSize: osSettings.systemFontSize }
text: qsTr("Publish event?")
}
BusyIndicator{ CheckBox{
id: eventCreateBusy id: chkbxPublish
anchors.horizontalCenter: eventCreateBox.horizontalCenter width: 10*root.fontFactor*osSettings.bigFontSize
anchors.top:eventCreateBox.top height: 2.5*root.fontFactor*osSettings.bigFontSize
anchors.topMargin: 2*root.fontFactor*osSettings.bigFontSize checked: true
width:3*root.fontFactor*osSettings.bigFontSize font.pointSize: osSettings.systemFontSize
height: 3*root.fontFactor*osSettings.bigFontSize text: qsTr("Publish event?")
running: false }
}
MButton{ Button{
id:createEventButton id:createEventButton
text: qsTr("Create event") text: qsTr("Create event")
onClicked:{ onClicked:{
let startdatetext=textStartDate.getText(0,textStartDate.length); let startdatetext=textStartDate.getText(0,textStartDate.length);
let startdate=new Date(startdatetext.substring(6,10)+"-"+startdatetext.substring(3,5)+"-"+startdatetext.substring(0,2)+"T"+textStartTime.text) let startdate=new Date(startdatetext.substring(6,10)+"-"+startdatetext.substring(3,5)+"-"+startdatetext.substring(0,2)+"T"+textStartTime.text)
if (titleField.text==""){
Helperjs.showMessage(qsTr("Error"),qsTr("No event name supplied"),eventCreateBox)
}else{
let startdatetext=textStartDate.getText(0,textStartDate.length);
let startdate=new Date(startdatetext.substring(6,10)+"-"+startdatetext.substring(3,5)+"-"+startdatetext.substring(0,2)+"T"+textStartTime.text)
eventCreateBusy.running=true;
xhr.setLogin(login.username+":"+Qt.atob(login.password));
xhr.setUrl(login.server);
xhr.setApi("/api/friendica/event_create");
xhr.clearParams();
xhr.setParam("name", titleField.text);
xhr.setParam("start_time",startdate.toISOString())
if(!checkNoEndTime.checked){
let enddatetext=textEndDate.getText(0,textEndDate.length);
let enddate=new Date(enddatetext.substring(6,10)+"-"+enddatetext.substring(3,5)+"-"+enddatetext.substring(0,2)+"T"+textEndTime.text)
xhr.setParam("end_time",enddate.toISOString())
}
xhr.setParam("name",titleField.text)
if (bodyField.text!=""){xhr.setParam("desc",bodyField.text)}
if (locationField.text!=""){xhr.setParam("place",locationField.text)}
xhr.setParam("publish",chkbxPublish.checked)
xhr.post();
}
}
}
Connections{
target: xhr
function onSuccess(text,api){
if (api=="/api/friendica/event_create"){
updatenews.setDatabase();
updatenews.login();
updatenews.setSyncAll(false);
updatenews.events();
try{while(rootstackView.depth>1){rootstackView.pop()}}catch(e){}
}
}
function onError(text,api){
if (api=="/api/friendica/event_create"){
Helperjs.showMessage(qsTr("Error"),text,root)
}
}
} }
} }
@ -393,11 +379,18 @@ Flickable{
Label { Label {
text: formatText(Tumbler.tumbler.count, modelData) text: formatText(Tumbler.tumbler.count, modelData)
opacity: 1.0 - Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2) opacity: 1.0 - Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2)
color:Material.primaryTextColor
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
} }
} }
} }
BusyIndicator{
id: eventCreateBusy
anchors.centerIn: parent
width:3*root.fontFactor*osSettings.bigFontSize
height: 3*root.fontFactor*osSettings.bigFontSize
running: false
}
} }

View File

@ -31,20 +31,19 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQml.Models 2.14
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/qml/calendarqml" import "qrc:/qml/calendarqml"
Rectangle{ Item{
id:eventList id:eventList
color: Material.backgroundColor
property var daylist:[] property var daylist:[]
property int dayint: 0 property int dayint: 0
property var events:[] property var events:[]
MButton{ Button{
id:closeButton id:closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1*mm anchors.topMargin: 1*mm
@ -54,7 +53,7 @@ Rectangle{
onClicked:{rootstackView.pop()} onClicked:{rootstackView.pop()}
} }
MButton{ Button{
id: createNewEvent id: createNewEvent
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1*mm anchors.topMargin: 1*mm

View File

@ -31,22 +31,17 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/qml/calendarqml" import "qrc:/qml/calendarqml"
Rectangle{ Item{
id:eventItem id:eventItem
property string status: eventstatus property string status: eventstatus
property var currEvent: event property var currEvent: event
width:parent.width width:parent.width
height:Math.max(eventNameText.height+eventDetailsText.height,profileImage.height)+mm height:Math.max(eventNameText.height+eventDetailsText.height,profileImage.height)+mm
border.color: Material.backgroundDimColor
color: Material.backgroundColor
border.width: 1
radius: 0.5*mm
Image { Image {
id:profileImage id:profileImage
source: ((event.eventOwner.profile_image!="") && (typeof(event.eventOwner.profile_image)=="string"))? "file://"+event.eventOwner.profile_image : event.eventOwner.profile_image_url source: ((event.eventOwner.profile_image!="") && (typeof(event.eventOwner.profile_image)=="string"))? "file://"+event.eventOwner.profile_image : event.eventOwner.profile_image_url
@ -56,25 +51,23 @@ Rectangle{
height: 7*mm height: 7*mm
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"} onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
} }
Text { Label{
id:eventNameText id:eventNameText
x: 8*mm x: 8*mm
width:parent.width-8*mm width:parent.width-8*mm
height:contentHeight height:contentHeight
color: Material.primaryTextColor
textFormat: Text.RichText textFormat: Text.RichText
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
text: new Date(event.start).toLocaleString(Qt.locale(),Locale.NarrowFormat)+ " - " +((event.end>0)&&(event.end!=null)?new Date(event.end).toLocaleString(Qt.locale(),Locale.NarrowFormat):"\u221E")+":<br>"+(status=="large"?"<b>"+event.title+"</b>":event.title) text: new Date(event.start).toLocaleString(Qt.locale(),Locale.NarrowFormat)+ " - " +((event.end>0)&&(event.end!=null)?new Date(event.end).toLocaleString(Qt.locale(),Locale.NarrowFormat):"\u221E")+":<br>"+(status=="large"?"<b>"+event.title+"</b>":event.title)
wrapMode:Text.Wrap wrapMode:Text.Wrap
} }
Text { Label{
id:eventDetailsText id:eventDetailsText
x:8*mm x:8*mm
z:4 z:4
width: parent.width-8*mm width: parent.width-8*mm
height: contentHeight height: contentHeight
color: Material.primaryTextColor
textFormat: Text.RichText textFormat: Text.RichText
text: status!="large"?"":Qt.atob(event.desc) + (event.location==""?"":"<br><br>"+qsTr("Location")+": "+event.location) text: status!="large"?"":Qt.atob(event.desc) + (event.location==""?"":"<br><br>"+qsTr("Location")+": "+event.location)
anchors.top: eventNameText.bottom anchors.top: eventNameText.bottom
@ -85,7 +78,7 @@ Rectangle{
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
MButton{ Button{
id: deleteEvent id: deleteEvent
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*mm anchors.topMargin: 0.5*mm

View File

@ -59,7 +59,7 @@ Page{
} }
} }
MButton{ Button{
id:userButton id:userButton
text:qsTr("User") text:qsTr("User")
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
@ -105,7 +105,7 @@ Page{
} }
} }
FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"} FontLoader{id: fontAwesome; source: "qrc:/images/fontawesome-webfont.ttf"}
MButton{ Button{
id:serverSearchButton id:serverSearchButton
text:"\uf002" text:"\uf002"
icon.name: "search" icon.name: "search"
@ -200,7 +200,7 @@ Page{
ListElement{text:"https://venera.social"} ListElement{text:"https://venera.social"}
} }
MButton { Button {
id: ruleButton id: ruleButton
x: root.fontFactor*osSettings.bigFontSize; y: 6*root.fontFactor*osSettings.bigFontSize; width: root.width-9*mm; x: root.fontFactor*osSettings.bigFontSize; y: 6*root.fontFactor*osSettings.bigFontSize; width: root.width-9*mm;
visible: (osSettings.osType=="Android") && (userButton.text== qsTr("User")) visible: (osSettings.osType=="Android") && (userButton.text== qsTr("User"))
@ -266,15 +266,15 @@ Page{
text: "" //filesystem.homePath+"/.friendiqa/"+username.text+"/" //(osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":"" text: "" //filesystem.homePath+"/.friendiqa/"+username.text+"/" //(osSettings.osType=="Android") && (filesystem.fileexist("/storage/emulated/0/Pictures/"))?"/storage/emulated/0/Pictures/":""
wrapMode: TextEdit.NoWrap wrapMode: TextEdit.NoWrap
onTextChanged: imagestoredir=imagestore.text onTextChanged: imagestoredir=imagestore.text
} }
MButton { Button {
x: root.width-3*root.fontFactor*osSettings.bigFontSize; y: 13*root.fontFactor*osSettings.bigFontSize; x: root.width-3*root.fontFactor*osSettings.bigFontSize; y: 13*root.fontFactor*osSettings.bigFontSize;
height: 2*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
visible:imagestore.text!="" visible:imagestore.text!=""
text: "..." text: "..."
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
onClicked:{imagestoreDialog.open()} onClicked:{imagestoreDialog.open()}
} }
FileDialog { FileDialog {
@ -298,7 +298,7 @@ Page{
running: false running: false
} }
MButton { Button {
id:confirmation id:confirmation
x: root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize x: root.fontFactor*osSettings.bigFontSize; y: 16*root.fontFactor*osSettings.bigFontSize
text: qsTr("Confirm") text: qsTr("Confirm")
@ -312,21 +312,19 @@ Page{
else if (username.text==""){errormessage+=qsTr("No nickname given! ")} else if (username.text==""){errormessage+=qsTr("No nickname given! ")}
else if (password.text=="") {errormessage+=qsTr("No password given! ")} else if (password.text=="") {errormessage+=qsTr("No password given! ")}
else if (imagestoredir=="") {errormessage+=qsTr("No image directory given!")} else if (imagestoredir=="") {errormessage+=qsTr("No image directory given!")}
else {errormessage=""} else {errormessage=""}
if (errormessage=="") { if (errormessage=="") {
Helperjs.friendicaRequest(userconfig,"/api/account/verify_credentials.json?skip_status=true",root,function(obj){ Helperjs.friendicaRequest(userconfig,"/api/account/verify_credentials.json?skip_status=true",root,function(obj){
accountBusy.running=false; accountBusy.running=false;
try{var credentials=JSON.parse(obj); try{
var credentials=JSON.parse(obj);
if (credentials.hasOwnProperty('error')){ if (credentials.hasOwnProperty('error')){
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password or 2FA enabled!"),root) Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password or 2FA enabled!"),root)
} } else{
else{
if (users.length==0){Service.setDefaultOptions(db);} if (users.length==0){Service.setDefaultOptions(db);}
if(userconfig.imagestore == filesystem.homePath+"/"+username.text+"/") if(userconfig.imagestore == filesystem.homePath+"/"+username.text+"/") {
{
filesystem.makePath(filesystem.homePath+"/"+username.text); filesystem.makePath(filesystem.homePath+"/"+username.text);
} }
filesystem.Directory=imagestoredir filesystem.Directory=imagestoredir
filesystem.makeDir("contacts"); filesystem.makeDir("contacts");
filesystem.makeDir("albums"); filesystem.makeDir("albums");
@ -334,26 +332,30 @@ Page{
Service.storeConfig(db,userconfig); Service.storeConfig(db,userconfig);
Service.readConfig(db,function(userconfig){ Service.readConfig(db,function(userconfig){
Helperjs.readData(db,"config","",function(storedUsers){ Helperjs.readData(db,"config","",function(storedUsers){
storedUsers.sort(function(obj1, obj2) { storedUsers.sort(function(obj1, obj2) {
return obj1.isActive - obj2.isActive; return obj1.isActive - obj2.isActive;
}); });
accountPage.users=storedUsers}); accountPage.users=storedUsers
//reset values });
//reset values
login=userconfig; login=userconfig;
news=[]; news=[];
contactlist=[]; contactlist=[];
rootstack.currentIndex=0; rootstack.currentIndex=0;
newstypeSignal("refresh"); newstypeSignal("refresh");
},"isActive",0); },"isActive",0);
Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root) Helperjs.showMessage(qsTr("Success"),qsTr("Name")+": "+credentials.name+"\nScreen Name: "+credentials.screen_name,root)
rootstackView.pop() rootstackView.pop()
} }
}catch(e){Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password or 2FA enabled!"),root)}; }catch(e){
Helperjs.showMessage(qsTr("Error"),qsTr("Wrong password or 2FA enabled!"),root)
})} };
else {Helperjs.showMessage(qsTr("Error"), errormessage,root)} })
}} } else {
Helperjs.showMessage(qsTr("Error"), errormessage,root)
}
}
}
Row{ Row{
spacing:0.5*mm spacing:0.5*mm
@ -361,7 +363,7 @@ Page{
anchors.topMargin: root.fontFactor*osSettings.bigFontSize anchors.topMargin: root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 1*mm anchors.rightMargin: 1*mm
MButton { Button {
width: 5*mm; width: 5*mm;
visible: users.length>0 visible: users.length>0
text: "-" text: "-"
@ -391,7 +393,7 @@ Page{
}) })
}} }}
MButton { Button {
width: 5*mm; width: 5*mm;
visible: users.length>0 visible: users.length>0
text: "+" text: "+"
@ -407,7 +409,7 @@ Page{
} }
} }
MButton { Button {
width: 5*mm; width: 5*mm;
text: "?" text: "?"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
@ -415,7 +417,7 @@ Page{
rootstackView.push("qrc:/qml/configqml/InfoBox.qml"); rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
} }
} }
MButton{ Button{
id:closeButton id:closeButton
width: 5*mm; width: 5*mm;
visible: users.length>0 visible: users.length>0

View File

@ -33,188 +33,116 @@ import QtQuick 2.11
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/qml/configqml" import "qrc:/qml/configqml"
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Page{ Page{
//anchors.fill: parent anchors.fill: parent
width:root.width
height:root.height
Label { ColumnLayout{
text: qsTr("News as") anchors.fill: parent
font.pointSize:osSettings.systemFontSize Label {
x: root.fontFactor*osSettings.bigFontSize; y: 2*root.fontFactor*osSettings.bigFontSize text: qsTr("News as")
}
Rectangle{
x: root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
width: newsTypeField.contentWidth+2*mm; height: 2*root.fontFactor*osSettings.bigFontSize
color: Material.dialogColor//"#F3F3F3"
radius: 0.5*mm
Label{
id: newsTypeField
anchors.fill: parent
font.pointSize:osSettings.bigFontSize
text:qsTr("Conversations")
}
MouseArea{
anchors.fill:parent
onClicked:newstypemenu.popup()
}
}
Menu {
id:newstypemenu
width:12*root.fontFactor*osSettings.bigFontSize
MenuItem {
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
text: qsTr("Timeline")
onTriggered: {newsTypeField.text=qsTr("Timeline");
Service.updateglobaloptions(root.db,"newsViewType","Timeline");}
} }
MenuItem {
font.pointSize: osSettings.bigFontSize
text: qsTr("Conversations")
onTriggered: {newsTypeField.text=qsTr("Conversations");
Service.updateglobaloptions(root.db,"newsViewType","Conversations");}
}
}
ComboBox {
Label { Layout.minimumWidth:root.width - mm * 3 - closeButton.width
text: qsTr("Max. News") model: [ qsTr("Timeline"), qsTr("Conversations") ]
font.pointSize: osSettings.systemFontSize currentIndex: globaloptions["newsViewType"] == "Timeline"?0:1
x: root.fontFactor*osSettings.bigFontSize; y:8*root.fontFactor*osSettings.bigFontSize onCurrentIndexChanged: {
} if(currentIndex == 0) {
Service.updateglobaloptions(root.db,"newsViewType","Timeline");
Slider{ id: maxNews } else {
x:6*root.fontFactor*osSettings.bigFontSize; y: 10*root.fontFactor*osSettings.bigFontSize; Service.updateglobaloptions(root.db,"newsViewType","Conversations");
width: root.width/2;height:2*root.fontFactor*osSettings.bigFontSize }
from: 0;to:2000; stepSize: 100
value: root.globaloptions.hasOwnProperty("max_news")?root.globaloptions.max_news:1000
}
Rectangle{
color: Material.dialogColor
x: root.fontFactor*osSettings.bigFontSize; y: 10*root.fontFactor*osSettings.bigFontSize;
width: 4*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
radius: 0.5*mm
TextEdit{id:maxNewsText;
anchors.fill: parent
font.pointSize: osSettings.bigFontSize
verticalAlignment:TextEdit.AlignRight
color: Material.primaryTextColor
text:maxNews.value
selectByMouse: true
onTextChanged: {
Service.updateglobaloptions(root.db,"max_news",text);
} }
} }
}
CheckBox{ Label {
id: nsfwCheckbox text: qsTr("Max. News")
x: root.fontFactor*osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
y: 14*root.fontFactor*osSettings.bigFontSize }
font.pointSize: osSettings.bigFontSize Row{
text: qsTr("Hide #nsfw?") Label {
checked:(globaloptions["hide_nsfw"]==1)?true:false anchors.top: parent.top
onClicked: { anchors.bottom: parent.bottom
toggle(); id:maxNewsText
if(nsfwCheckbox.checked==true){ text:maxNews.value
Service.updateglobaloptions(root.db,"hide_nsfw",0);nsfwCheckbox.checked=false;
} }
else{ Slider{
Service.updateglobaloptions(root.db,"hide_nsfw",1);nsfwCheckbox.checked=true; id: maxNews
width: root.width - maxNewsText.width - mm * 2 - closeButton.width
from: 0;to:2000; stepSize: 100
value: root.globaloptions.hasOwnProperty("max_news")?root.globaloptions.max_news:1000
onMoved: {
Service.updateglobaloptions(root.db,"max_news",value);
}
} }
} }
}
CheckBox{
text: qsTr("Hide #nsfw?")
font.pointSize: osSettings.bigFontSize
checked:globaloptions["hide_nsfw"]==1
onClicked: {
if(checked){
Service.updateglobaloptions(root.db,"hide_nsfw",1);
}
else{
Service.updateglobaloptions(root.db,"hide_nsfw",0);
}
}
}
// CheckBox{
// id: darkmodeCheckbox
// tristate:true
// x: root.fontFactor*osSettings.bigFontSize
// y: 24*root.fontFactor*osSettings.bigFontSize
// font.pointSize: osSettings.bigFontSize
// text: qsTr("Dark Mode")
// checked:(globaloptions["view_darkmode"]==1)?true:false
// onClicked: {
// toggle();
// if(darkmodeCheckbox.checked==true){
// Service.updateglobaloptions(root.db,"view_darkmode",0);darkmodeCheckbox.checked=false;
// root.Material.theme=Material.Light
// }
// else{
// Service.updateglobaloptions(root.db,"view_darkmode",1);darkmodeCheckbox.checked=true;
// root.Material.theme=Material.Dark
// }
// }
// }
Column{
x: root.fontFactor*osSettings.bigFontSize
y: 18*root.fontFactor*osSettings.bigFontSize
Label{ Label{
text: qsTr("Dark Mode") text: qsTr("Dark Mode")
font.pointSize: osSettings.systemFontSize} font.pointSize: osSettings.bigFontSize
}
RadioButton{
id: darkRadio
text: qsTr("Native")
checked: globaloptions["view_darkmode"]==0 || globaloptions["view_darkmode"]==undefined
onClicked: {
if(checked){
Service.updateglobaloptions(root.db,"view_darkmode",0);
}
}
}
RadioButton{ RadioButton{
text: qsTr("System") text: qsTr("System")
checked: (globaloptions["view_darkmode"]==0 || globaloptions["view_darkmode"]==undefined)?true:false checked: globaloptions["view_darkmode"]==1
font.pointSize: osSettings.bigFontSize
onClicked: { onClicked: {
if(checked==true){ if(checked){
Service.updateglobaloptions(root.db,"view_darkmode",0);
root.Material.theme=Material.System root.Material.theme=Material.System
} systemTray.icon = root.color<palette.text?iconTrayWhite:iconTrayBlack
Service.updateglobaloptions(root.db,"view_darkmode",1);
}
} }
} }
RadioButton{ RadioButton{
text: qsTr("Dark") text: qsTr("Dark")
checked: (globaloptions["view_darkmode"]==1)?true:false checked: globaloptions["view_darkmode"]==2
font.pointSize: osSettings.bigFontSize
onClicked: { onClicked: {
if(checked==true){ if(checked){
Service.updateglobaloptions(root.db,"view_darkmode",1);
root.Material.theme=Material.Dark root.Material.theme=Material.Dark
} systemTray.icon = root.color<palette.text?iconTrayWhite:iconTrayBlack
Service.updateglobaloptions(root.db,"view_darkmode",2);
}
} }
} }
RadioButton{ RadioButton{
text: qsTr("Light") text: qsTr("Light")
checked: (globaloptions["view_darkmode"]==2)?true:false checked: globaloptions["view_darkmode"]==3
font.pointSize: osSettings.bigFontSize
onClicked: { onClicked: {
if(checked==true){ if(checked){
Service.updateglobaloptions(root.db,"view_darkmode",2);
root.Material.theme=Material.Light root.Material.theme=Material.Light
} systemTray.icon = root.color<palette.text?iconTrayWhite:iconTrayBlack
Service.updateglobaloptions(root.db,"view_darkmode",3);
}
} }
} }
} }
MButton {
anchors.right: parent.right; //anchors.rightMargin: mm;
anchors.top: parent.top
anchors.topMargin: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize;
text: "?"
font.pointSize: osSettings.bigFontSize
onClicked:{
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
}
}
// MButton{
// id:closeButton
// // height: 2*root.fontFactor*osSettings.bigFontSize
// width: 2*root.fontFactor*osSettings.bigFontSize;
// anchors.top: parent.top
// anchors.topMargin:root.fontFactor*osSettings.bigFontSize
// anchors.right: parent.right
// anchors.rightMargin: 1*mm
// text: "\uf057"
// font.pointSize: osSettings.bigFontSize
// onClicked:{rootstackView.pop()}
// }
} }

View File

@ -33,73 +33,41 @@ import QtQuick 2.11
import QtQuick.Dialogs 1.2 import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/qml/configqml" import "qrc:/qml/configqml"
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Page{ Page{
//anchors.fill: parent width: (parent != null)?parent.width:0
width:root.width height: (parent != null)?parent.height:0
height:root.height
TabBar { TabBar {
id: configbar id: configbar
width: parent.width-3*root.fontFactor*osSettings.bigFontSize//osSettings.osType=="Android"?parent.width-3*root.fontFactor*osSettings.bigFontSize:parent.width
height: 2*root.fontFactor*osSettings.bigFontSize
x: osSettings.osType=="Android"?2*osSettings.bigFontSize:0
//visible: !wideScreen
position:TabBar.Header position:TabBar.Header
currentIndex: 0 currentIndex: 0
TabButton { TabButton {
text: qsTr("Appearance") text: qsTr("Appearance")
font.pointSize: osSettings.systemFontSize width:root.width/3
height: 2*root.fontFactor*osSettings.bigFontSize
width:6*root.fontFactor*osSettings.bigFontSize
} }
TabButton { TabButton {
text: qsTr("Sync") text: qsTr("Sync")
font.pointSize: osSettings.systemFontSize width:root.width/3
height: 2*root.fontFactor*osSettings.bigFontSize
width:10*root.fontFactor*osSettings.bigFontSize
} }
TabButton { TabButton {
text: qsTr("Start") text: qsTr("Start")
visible:osSettings.osType=="Linux" visible:osSettings.osType=="Linux"
font.pointSize: osSettings.systemFontSize width:root.width/3
height: 2*root.fontFactor*osSettings.bigFontSize
width:10*root.fontFactor*osSettings.bigFontSize
} }
} }
LeftDrawerLinux{
id:leftDrawer
visible: wideScreen&&rootstackView.depth<2
width: visible?osSettings.systemFontSize*15:0
height: root.height-bar.height
}
LeftDrawerAndroid{
id: leftDrawerAndroid
}
StackLayout{ StackLayout{
id:configTabView id:configTabView
//anchors.fill: parent anchors.right: parent.right
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm//newstabitem.width/3*2:newstabitem.width anchors.left: leftDrawer.right
x: leftDrawer.width anchors.top: configbar.bottom
y: configbar.height anchors.bottom: parent.bottom
height: parent.height-configbar.height-mm anchors.leftMargin: mm
currentIndex: configbar.currentIndex currentIndex: configbar.currentIndex
// onCurrentIndexChanged:{
// if (currentIndex==1){
// contactsSignal("")
// }
// else if (currentIndex==2){
// contactsSignal("")
// }
// else if (currentIndex==3){groupsSignal(root.login.username)}
// }
Loader{ Loader{
id: appearanceLoader id: appearanceLoader
@ -116,16 +84,32 @@ Page{
source:(configTabView.currentIndex==2)? "qrc:/qml/configqml/ConfigStartPage.qml":"" source:(configTabView.currentIndex==2)? "qrc:/qml/configqml/ConfigStartPage.qml":""
} }
} }
MButton{
id:closeButton LeftDrawerLinux{
// height: 2*root.fontFactor*osSettings.bigFontSize id:leftDrawer
width: 2*root.fontFactor*osSettings.bigFontSize; visible: wideScreen&&rootstackView.depth<2
anchors.top: parent.top width: visible?osSettings.systemFontSize*15:0
anchors.topMargin:2*root.fontFactor*osSettings.bigFontSize height: root.height-bar.height
anchors.right: parent.right }
anchors.rightMargin: 1*mm
text: "\uf057" LeftDrawerAndroid{
id: leftDrawerAndroid
}
CloseButton {
id: closeButton
anchors.top: configTabView.top
}
Button {
anchors.top: closeButton.bottom
anchors.topMargin: 1*mm
anchors.left: closeButton.left
width: height
text: "?"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
onClicked:{rootstackView.pop()} onClicked:{
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
}
} }
} }

View File

@ -31,33 +31,18 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
Page{ Page{
//anchors.fill: parent anchors.fill: parent
width:root.width
height:root.height-6*root.fontFactor*osSettings.bigFontSize
CheckBox{ CheckBox{
id: autostartCheckbox id: autostartCheckbox
x: mm
y: root.fontFactor*osSettings.bigFontSize
width: 10*root.fontFactor*osSettings.bigFontSize
checked:filesystem.isAutostart checked:filesystem.isAutostart
//style: CheckBoxStyle {
text: qsTr("Autostart") text: qsTr("Autostart")
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
onClicked: { onClicked: {
toggle(); filesystem.setAutostart(checked);
if(autostartCheckbox.checked==true){
filesystem.setAutostart(false);
autostartCheckbox.checked=false;
}
else{
filesystem.setAutostart(true);
autostartCheckbox.checked=true;
}
} }
} }
// CheckBox{ // CheckBox{

View File

@ -31,17 +31,15 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Page{ Page{
Text{id:infoBoxText Label{id:infoBoxText
anchors.top:closeButton.bottom anchors.left: parent.left
anchors.topMargin: mm anchors.right: parent.right
anchors.top: closeButton.bottom
anchors.leftMargin: mm
textFormat: Text.RichText textFormat: Text.RichText
width: root.width-mm
font.pointSize: osSettings.systemFontSize
color:Material.primaryTextColor
wrapMode: Text.WrapAtWordBoundaryOrAnywhere wrapMode: Text.WrapAtWordBoundaryOrAnywhere
text: "<b>Friendiqa v0.6.7 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+ text: "<b>Friendiqa v0.6.7 </b><br>Licensed under GPL 3 with the exception of OpenSSL <br> "+
"Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+ "Website <a href='https://friendiqa.ma-nic.de'>https://friendiqa.ma-nic.de</a><br>"+
@ -54,16 +52,12 @@ Page{
"AndroidNative by <a href='https://github.com/benlau/androidnative.pri'>Ben Lau</a><br>"+ "AndroidNative by <a href='https://github.com/benlau/androidnative.pri'>Ben Lau</a><br>"+
"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href='http://www.openssl.org/'>http://www.openssl.org/</a>)" "This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (<a href='http://www.openssl.org/'>http://www.openssl.org/</a>)"
onLinkActivated:{ onLinkActivated:{
Qt.openUrlExternally(link)} Qt.openUrlExternally(link)
}
} }
MButton{
id:closeButton CloseButton {
id: closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
font.pointSize: osSettings.bigFontSize
onClicked:{rootstackView.pop()}
} }
} }

View File

@ -55,25 +55,29 @@ ScrollView{
text: "\uf085 "+ qsTr("Settings") text: "\uf085 "+ qsTr("Settings")
MouseArea{ MouseArea{
anchors.fill:parent anchors.fill:parent
onClicked:{rootstackView.push("qrc:qml/configqml/ConfigPage.qml"); onClicked:{
rootstackView.push("qrc:qml/configqml/ConfigPage.qml");
if(!wideScreen){leftDrawerAndroid.close()} if(!wideScreen){leftDrawerAndroid.close()}
} }
} }
} }
Label{y: 2*root.fontFactor*osSettings.bigFontSize Label{
y: 2*root.fontFactor*osSettings.bigFontSize
width:implicitWidth width:implicitWidth
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
text: "\uf2bb " + qsTr("Accounts") text: "\uf2bb " + qsTr("Accounts")
MouseArea{ MouseArea{
anchors.fill:parent anchors.fill:parent
onClicked:{rootstackView.push("qrc:qml/configqml/AccountPage.qml"); onClicked:{
rootstackView.push("qrc:qml/configqml/AccountPage.qml");
if(!wideScreen){leftDrawerAndroid.close()} if(!wideScreen){leftDrawerAndroid.close()}
} }
} }
} }
Label{y: 4*root.fontFactor*osSettings.bigFontSize Label{
y: 4*root.fontFactor*osSettings.bigFontSize
width:implicitWidth width:implicitWidth
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
text: "\uf08b " +qsTr("Quit") text: "\uf08b " +qsTr("Quit")
@ -83,31 +87,38 @@ ScrollView{
Service.cleanNews(root.db,function(){ Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){ Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){ Service.cleanContacts(root.login,root.db,function(){
Qt.quit()}) Qt.quit()
})})
})
})
})
} }
} }
} }
} }
Component.onCompleted:{ Component.onCompleted:{
Service.readAllLogins(db,function(accounts){ Service.readAllLogins(db,function(accounts){
var i, accountComponent, accountQml;
if (accounts.length>0 && bar.currentIndex==0){ if (accounts.length>0 && bar.currentIndex==0){
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*17*root.fontFactor*osSettings.bigFontSize leftDrawerColumn.height=(4.5+accounts.length*17)*root.fontFactor*osSettings.bigFontSize
for(var i = 0; i < accounts.length; i++) { for(i = 0; i < accounts.length; i++) {
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponent.qml"); accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponent.qml");
var accountQml = accountComponent.createObject(leftDrawerColumn,{ accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*17*root.fontFactor*osSettings.bigFontSize, "y":(4.5+i*17)*root.fontFactor*osSettings.bigFontSize,
"currentnewstabstatus":currentnewstabstatus, "currentnewstabstatus":currentnewstabstatus,
"account":accounts[i]}); "account":accounts[i]
});
} }
}else if(accounts.length>0 && bar.currentIndex==1){ }else if(accounts.length>0 && bar.currentIndex==1){
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*8*root.fontFactor*osSettings.bigFontSize leftDrawerColumn.height=(4.5+accounts.length*8)*root.fontFactor*osSettings.bigFontSize
for(var i = 0; i < accounts.length; i++) { for(i = 0; i < accounts.length; i++) {
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponentContacts.qml"); accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponentContacts.qml");
var accountQml = accountComponent.createObject(leftDrawerColumn,{ accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*8*root.fontFactor*osSettings.bigFontSize, "y":(4.5+i*8)*root.fontFactor*osSettings.bigFontSize,
"account":accounts[i]}); "account":accounts[i]
});
} }
} }
})} })
}
} }

View File

@ -32,56 +32,49 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQuick.Layouts 1.11
import "qrc:/qml/configqml" import "qrc:/qml/configqml"
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
Rectangle{ Item{
color: Material.dialogColor
property string adapter: "" property string adapter: ""
width: parent.width width: parent.width
height: 4*root.fontFactor*osSettings.bigFontSize height: childrenRect.height
Label{ Column {
x: mm width: parent.width
y: 0.5*mm Label{
font.pointSize: osSettings.systemFontSize text: qsTr(adapter)
text: qsTr(adapter)
}
CheckBox{
id: syncCheckbox
x: mm
y: root.fontFactor*osSettings.bigFontSize
width: 10*root.fontFactor*osSettings.bigFontSize
checked:(globaloptions["sync_"+adapter]==1)?true:false
//style: CheckBoxStyle {
text: qsTr("sync")
font.pointSize: osSettings.bigFontSize
onClicked: {
toggle();
if(syncCheckbox.checked==true){
Service.updateglobaloptions(root.db,"sync_"+adapter,0);syncCheckbox.checked=false;
}
else{
Service.updateglobaloptions(root.db,"sync_"+adapter,1);syncCheckbox.checked=true;
}
}
}
CheckBox{
id: notifyCheckbox
x: 10*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 10*root.fontFactor*osSettings.bigFontSize
enabled: adapter!="Notifications"
checked:(globaloptions["notify_"+adapter]==1)?true:false
text: qsTr("notify")
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
onClicked: { }
toggle(); RowLayout {
if(notifyCheckbox.checked==true){ width: parent.width
Service.updateglobaloptions(root.db,"notify_"+adapter,0);notifyCheckbox.checked=false; CheckBox{
id: syncCheckbox
checked:globaloptions["sync_"+adapter]==1
text: qsTr("sync")
onClicked: {
if(checked){
Service.updateglobaloptions(root.db,"sync_"+adapter,0);
}
else{
Service.updateglobaloptions(root.db,"sync_"+adapter,1);
}
}
}
CheckBox{
id: notifyCheckbox
enabled: adapter!="Notifications"
checked:globaloptions["notify_"+adapter]==1
text: qsTr("notify")
onClicked: {
if(checked){
Service.updateglobaloptions(root.db,"notify_"+adapter,0);
}
else{
Service.updateglobaloptions(root.db,"notify_"+adapter,1);
}
} }
else{
Service.updateglobaloptions(root.db,"notify_"+adapter,1);notifyCheckbox.checked=true;
} }
} }
} }

View File

@ -31,69 +31,50 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/configqml" import "qrc:/qml/configqml"
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
Page{ Page{
//color:"white" anchors.fill: parent
width:root.width
height: root.height
//height:root.height
Label {
text: qsTr("Sync Interval (0=None)")
font.pointSize: osSettings.bigFontSize
//visible: false
x: root.fontFactor*osSettings.bigFontSize; y: root.fontFactor*osSettings.bigFontSize; //width:35*mm;wrapMode: Text.Wrap
}
Slider{ id: messageIntervalSlider
x:8*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
width: root.width-10*root.fontFactor*osSettings.bigFontSize;
height:2*root.fontFactor*osSettings.bigFontSize
value: globaloptions.hasOwnProperty("syncinterval")?globaloptions.syncinterval:0
from: 0;to:120; stepSize: 15
}
Rectangle{
x: root.fontFactor*osSettings.bigFontSize; y:4*root.fontFactor*osSettings.bigFontSize;
width: 4*root.fontFactor*osSettings.bigFontSize; height: 2*root.fontFactor*osSettings.bigFontSize;
color: Material.dialogColor
radius: 0.5*mm
TextEdit{
id: messageIntervalField
anchors.fill: parent
font.pointSize: osSettings.bigFontSize
verticalAlignment:TextEdit.AlignRight
color: Material.primaryTextColor
text:messageIntervalSlider.value
focus: true
selectByMouse: true
onTextChanged: {
Service.updateglobaloptions(root.db,"syncinterval",text);
if(osSettings.osType=="Android"){
alarm.setAlarm(text);
} else if(osSettings.osType=="Linux" && text !=0){
root.updateSyncinterval(parseInt(text))
}
}
}
}
Label{x: 6*root.fontFactor*osSettings.bigFontSize; y: 4*root.fontFactor*osSettings.bigFontSize;
width: 2*root.fontFactor*osSettings.bigFontSize; height: 1.5*root.fontFactor*osSettings.bigFontSize;
font.pointSize: osSettings.bigFontSize
text:qsTr("Min.")
}
ScrollView{ ScrollView{
width: root.width anchors.fill: parent
height: root.height - 10*root.fontFactor*osSettings.bigFontSize;
y:7*root.fontFactor*osSettings.bigFontSize
clip:true clip:true
Column{
width: parent.width Column {
spacing:mm Label {
text: qsTr("Sync Interval (0=None)")
font.pointSize: osSettings.bigFontSize
}
Row {
Label {
id:messageIntervalField
text:messageIntervalSlider.value
}
Slider{
id: messageIntervalSlider
width: root.width - messageIntervalField.width - mm * 2 - closeButton.width
from: 0;to:120; stepSize: 15
value: globaloptions.hasOwnProperty("syncinterval")?globaloptions.syncinterval:0
onMoved: {
Service.updateglobaloptions(root.db,"syncinterval",value);
if(osSettings.osType=="Android"){
alarm.setAlarm(value);
} else if(osSettings.osType=="Linux" && value !=0){
root.updateSyncinterval(parseInt(value))
}
}
}
}
Label {
font.pointSize: osSettings.bigFontSize
text:qsTr("Min.")
}
SyncComponent{adapter:"Timeline"} SyncComponent{adapter:"Timeline"}
SyncComponent{adapter:"Replies"} SyncComponent{adapter:"Replies"}
SyncComponent{ adapter:"DirectMessages"} SyncComponent{ adapter:"DirectMessages"}
@ -102,16 +83,4 @@ Page{
SyncComponent{adapter: "FriendRequests"} SyncComponent{adapter: "FriendRequests"}
} }
} }
// MButton{
// id:closeButton
// anchors.top: parent.top
// anchors.topMargin: osSettings.bigFontSize
// anchors.right: parent.right
// anchors.rightMargin: 1*mm
// width: 2*root.fontFactor*osSettings.bigFontSize;
// text: "\uf057"
// font.pointSize: osSettings.bigFontSize
// onClicked:{rootstackView.pop()}
// }
} }

View File

@ -32,17 +32,15 @@
// List of people // List of people
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQml.Models 2.14
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Rectangle { Item {
id:contactlistRectangle id:contactlistRectangle
property var contacts:[] property var contacts:[]
property var possibleUsers: [] property var possibleUsers: []
//y:8*mm //y:8*mm
color: "white"
border.color: "light grey"
radius:0.5*mm
width:groupListView.width width:groupListView.width
height:groupListView.height height:groupListView.height
@ -61,10 +59,7 @@ Rectangle {
ListModel{id: contactModel} ListModel{id: contactModel}
Component { id:listContact Component { id:listContact
Rectangle{ Item{
border.color: "#EEEEEE"
border.width: 1
radius:0.5*mm
width:contactView.width width:contactView.width
height:6*mm height:6*mm
Image { Image {
@ -76,13 +71,13 @@ Rectangle {
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"} onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
} }
Text{ Label{
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
anchors.left: contactImage.right anchors.left: contactImage.right
anchors.margins: 1*mm anchors.margins: 1*mm
text:Qt.atob(contact.name) text:Qt.atob(contact.name)
} }
Text { Label {
id:selected id:selected
anchors.right:parent.right anchors.right:parent.right
visible: contactlist.indexOf(contact)>-1 visible: contactlist.indexOf(contact)>-1
@ -90,7 +85,6 @@ Rectangle {
text: "\u2713" text: "\u2713"
width: 5*mm width: 5*mm
anchors.top: parent.top anchors.top: parent.top
color: "green"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
} }
@ -110,13 +104,12 @@ Rectangle {
} }
} }
MButton { Button {
id: closeButton id: closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1*mm anchors.topMargin: 1*mm
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 1*mm anchors.rightMargin: 1*mm
//color:"white"
text: "\uf057" text: "\uf057"
onClicked: { onClicked: {
groupModelAppend(contacts,function(){ groupModelAppend(contacts,function(){

View File

@ -31,7 +31,6 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0 import QtQuick.LocalStorage 2.0
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
@ -99,7 +98,7 @@ Page{
} }
} }
MButton { Button {
id: closeButton id: closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize
@ -117,7 +116,6 @@ Page{
x:1.5*root.fontFactor*osSettings.systemFontSize; x:1.5*root.fontFactor*osSettings.systemFontSize;
width:root.width-(7*root.fontFactor*osSettings.systemFontSize+mm); width:root.width-(7*root.fontFactor*osSettings.systemFontSize+mm);
height: 2.5*root.fontFactor*osSettings.systemFontSize; height: 2.5*root.fontFactor*osSettings.systemFontSize;
color:Material.dialogColor
selfdestroying:false selfdestroying:false
} }
@ -131,13 +129,11 @@ Page{
Component { Component {
id: sectionHeading id: sectionHeading
Rectangle { Item {
width: contactsSearchView.width width: contactsSearchView.width
height: childrenRect.height height: childrenRect.height
color: Material.backgroundColor
required property string section required property string section
Text { Label{
color: Material.secondaryTextColor
text: parent.section text: parent.section
font.bold: true font.bold: true
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize

View File

@ -31,7 +31,6 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0 import QtQuick.LocalStorage 2.0
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
@ -112,7 +111,7 @@ Item{
} }
} }
MButton { Button {
id: updateFriendsButton id: updateFriendsButton
text: "\uf021" text: "\uf021"
anchors.top: parent.top anchors.top: parent.top
@ -143,16 +142,13 @@ Item{
value: friendsGridTab.currentContact/root.newContacts.length value: friendsGridTab.currentContact/root.newContacts.length
} }
Rectangle { Item {
id:searchComponent id:searchComponent
x: mm; y:mm x: mm; y:mm
color: Material.backgroundColor
radius:0.5*mm
width: 10*root.fontFactor*osSettings.bigFontSize width: 10*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
TextField { TextField {
id: searchText id: searchText
color: Material.primaryTextColor
focus: true focus: true
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
wrapMode: Text.Wrap wrapMode: Text.Wrap
@ -170,15 +166,12 @@ Item{
anchors.left: searchComponent.right anchors.left: searchComponent.right
anchors.leftMargin: root.fontFactor*osSettings.bigFontSize anchors.leftMargin: root.fontFactor*osSettings.bigFontSize
y: mm y: mm
width: 6*root.fontFactor*osSettings.bigFontSize
height: 1.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
model: [qsTr("Friends"), qsTr("All"), qsTr("Blocked")] model: [qsTr("Friends"), qsTr("All"), qsTr("Blocked")]
onCurrentIndexChanged:{ onCurrentIndexChanged:{
if (currentIndex === 0) { if (currentIndex === 0) {
showFriends(root.login.username); showFriends(root.login.username);
} else } else if (currentIndex===1){
if (currentIndex===1){
showContacts() showContacts()
} else if (currentIndex===2){ } else if (currentIndex===2){
showBlocked() showBlocked()
@ -190,13 +183,11 @@ Item{
Component { Component {
id: sectionHeading id: sectionHeading
Rectangle { Item {
width: friendsView.width width: friendsView.width
height: childrenRect.height height: childrenRect.height
color: Material.backgroundColor
required property string section required property string section
Text { Label{
color: Material.secondaryTextColor
text: parent.section text: parent.section
font.bold: true font.bold: true
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
@ -207,12 +198,10 @@ Item{
Component { id:headerComponent Component { id:headerComponent
Rectangle{ Item{
color: Material.dialogColor
width:friendsView.width width:friendsView.width
height:6*mm height:6*mm
Text{ Label{
color: Material.primaryTextColor
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
anchors.centerIn: parent anchors.centerIn: parent
text:"\uf234" text:"\uf234"

View File

@ -31,7 +31,6 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0 import QtQuick.LocalStorage 2.0
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
@ -40,9 +39,8 @@ import "qrc:/js/service.js" as Service
import "qrc:/qml/contactqml" import "qrc:/qml/contactqml"
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Rectangle { Item {
y:1 y:1
color: Material.backgroundColor//"white"
function showContactdetails(contact){ function showContactdetails(contact){
// rootstack.currentIndex=0; // rootstack.currentIndex=0;
@ -53,10 +51,7 @@ Rectangle {
BlueButton{ BlueButton{
z:2 z:2
visible: !wideScreen visible: !wideScreen
fontColor: "grey"
border.color: "transparent"
text: "\uf0c9" text: "\uf0c9"
font.pointSize: osSettings.bigFontSize
onClicked:{ onClicked:{
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()} leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
} }

View File

@ -31,7 +31,6 @@
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/news.js" as Newsjs import "qrc:/js/news.js" as Newsjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
@ -48,35 +47,29 @@ Item {
callback() callback()
} }
Rectangle { Item {
id: wrapper id: wrapper
x:0.5*mm x:0.5*mm
y:0.5*mm y:0.5*mm
width:parent.width-mm width:parent.width-mm
height: parent.height-mm height: parent.height-mm
radius: 0.5*mm
border.color: "grey"
color:Material.backgroundColor
Rectangle{ Item{
id:namelabelRect id:namelabelRect
x: 1 x: 1
y: 1 y: 1
width: wrapper.width-2 width: wrapper.width-2
height: 3*root.fontFactor*osSettings.bigFontSize height: 3*root.fontFactor*osSettings.bigFontSize
//border.color: "light grey"
color:Material.backgroundColor
TextInput { TextInput {
id: namelabel id: namelabel
anchors.fill: parent anchors.fill: parent
readOnly: true readOnly: true
text: group.new?"":group.groupname text: group.new?"":group.groupname
color: Material.secondaryTextColor//"#303030"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
} }
} }
MButton{ Button{
id: closeButton id: closeButton
visible: false visible: false
anchors.right: parent.right anchors.right: parent.right
@ -89,7 +82,7 @@ Item {
} }
} }
MButton{ Button{
id:infobutton id:infobutton
text:"?" text:"?"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
@ -119,10 +112,9 @@ Item {
} }
} }
Rectangle{ Item{
id: detailsrectangle id: detailsrectangle
anchors.top: namelabelRect.bottom anchors.top: namelabelRect.bottom
color: Material.backgroundColor
//anchors.topMargin: mm //anchors.topMargin: mm
x:mm x:mm
width: parent.width-2*mm width: parent.width-2*mm

View File

@ -74,7 +74,7 @@ Item{
} }
} }
} }
// MButton {//requestGroups() not working with Friendica 02/2022 // Button {//requestGroups() not working with Friendica 02/2022
// id: updateGroupsButton // id: updateGroupsButton
// text: "\uf021" // text: "\uf021"
// anchors.top: parent.top // anchors.top: parent.top

View File

@ -31,15 +31,14 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQml.Models 2.14
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
Rectangle { Item {
// width:parent.width-2*mm // width:parent.width-2*mm
// height:parent.height-14*mm // height:parent.height-14*mm
anchors.fill:parent anchors.fill:parent
color: Material.backgroundColor//color:"white"
property var profile:({}) property var profile:({})
property var attachImageURLs:[] property var attachImageURLs:[]
property var createdAtDate: new Date(profile.friendica_owner.created_at) property var createdAtDate: new Date(profile.friendica_owner.created_at)
@ -115,7 +114,7 @@ Rectangle {
callback(profiletext) callback(profiletext)
} }
MButton { Button {
id: update id: update
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: mm anchors.topMargin: mm
@ -165,9 +164,8 @@ Rectangle {
} }
} }
} }
Rectangle{ Item{
id:phototextRectangle id:phototextRectangle
color:"black"
z:3 z:3
opacity: 0.5 opacity: 0.5
width:6*mm width:6*mm
@ -175,18 +173,17 @@ Rectangle {
anchors.top: photoImage.top anchors.top: photoImage.top
anchors.right: photoImage.right anchors.right: photoImage.right
} }
Text { Label{
id:phototext id:phototext
z:4 z:4
text: "\uf040" text: "\uf040"
width:5*mm width:5*mm
anchors.top: photoImage.top anchors.top: photoImage.top
anchors.right:photoImage.right anchors.right:photoImage.right
color: "white"
font.pointSize: 1.2*osSettings.bigFontSize font.pointSize: 1.2*osSettings.bigFontSize
} }
MButton{ Button{
id:updatebutton id:updatebutton
width: 8*root.fontFactor*osSettings.bigFontSize width: 8*root.fontFactor*osSettings.bigFontSize
visible: "file://"+profile.friendica_owner.profile_image!= photoImage.source visible: "file://"+profile.friendica_owner.profile_image!= photoImage.source
@ -208,7 +205,6 @@ Rectangle {
anchors.topMargin: 0 anchors.topMargin: 0
anchors.left: photoImage.left anchors.left: photoImage.left
wrapMode: Text.Wrap wrapMode: Text.Wrap
color: Material.secondaryTextColor//"#303030"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
anchors.top: photoImage.bottom anchors.top: photoImage.bottom
} }
@ -216,18 +212,16 @@ Rectangle {
ListModel{id:profileModel} ListModel{id:profileModel}
Component{ Component{
id:profileItem id:profileItem
Rectangle{ Item{
id:profileRect id:profileRect
width:profileView.width width:profileView.width
color: Material.backgroundColor
height: 5*mm+profiletextfield.height height: 5*mm+profiletextfield.height
Text{ Label{
y:mm y:mm
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
text:"<b>"+qsTr("profile id")+": </b> "+profileid+"<br>" text:"<b>"+qsTr("profile id")+": </b> "+profileid+"<br>"
color:Material.primaryTextColor//"black"
} }
Text{ Label{
id:profiletextfield id:profiletextfield
x:2*mm x:2*mm
y:4.5*mm y:4.5*mm
@ -235,16 +229,14 @@ Rectangle {
wrapMode: Text.Wrap wrapMode: Text.Wrap
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
text:profiletext text:profiletext
color:Material.primaryTextColor
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
} }
} }
} }
Component{ Component{
id:textcomponent id:textcomponent
Text{ Label{
id:namelabeltext id:namelabeltext
color:Material.primaryTextColor
width: namelabelflickable.width width: namelabelflickable.width
height: implicitHeight height: implicitHeight
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize

View File

@ -33,8 +33,8 @@ import QtQuick 2.5
import QtQuick.LocalStorage 2.0 import QtQuick.LocalStorage 2.0
import QtQuick.Window 2.0 import QtQuick.Window 2.0
import QtQuick.Controls 2.4 import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11 import QtQuick.Layouts 1.11
import QtQuick.Controls.Material 2.12
import QSystemTrayIcon 1.0 import QSystemTrayIcon 1.0
import "qrc:/js/news.js" as Newsjs import "qrc:/js/news.js" as Newsjs
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
@ -75,10 +75,6 @@ ApplicationWindow{
property var contactposts:[] property var contactposts:[]
property bool imagePicking: false property bool imagePicking: false
Material.theme: Material.System
color: Material.backgroundColor
function onLoginChanged(login){ function onLoginChanged(login){
if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")} if(login==""){rootstackView.push("qrc:/qml/configqml/AccountPage.qml")}
else{ else{
@ -187,65 +183,37 @@ ApplicationWindow{
else {rootstack.currentIndex=0;close.accepted=false} else {rootstack.currentIndex=0;close.accepted=false}
} }
header: TabBar {
Rectangle{ id: bar
anchors.fill: parent onCurrentIndexChanged: {
color: Material.backgroundColor rootstack.currentIndex=bar.currentIndex;
} try{while(rootstackView.depth>1){rootstackView.pop()}}catch(e){}
header: ToolBar{
background: Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor
} }
RowLayout{ TabButton {
anchors.fill: parent width: root.width / 4
onDoubleClicked: {newstypeSignal("refresh")}
TabBar { text: "\uf03a"
id: bar }
Layout.fillWidth: true TabButton {
onCurrentIndexChanged: { width: root.width / 4
rootstack.currentIndex=bar.currentIndex; text: "\uf0c0"
try{while(rootstackView.depth>1){rootstackView.pop()}}catch(e){} }
} TabButton {
TabButton { width: root.width / 4
text: "\uf03a" text: "\uf03e"
background:Rectangle{ }
anchors.fill: parent TabButton {
color: Material.backgroundDimColor width: root.width / 4
} text: "\uf073"
onDoubleClicked: {newstypeSignal("refresh")}
}
TabButton {
text: "\uf0c0"
background:Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor
}
}
TabButton {
text: "\uf03e"
background:Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor
}
}
TabButton {
text: "\uf073"
background:Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor
}
}
}
} }
} }
StackView{id:rootstackView StackView{
width:root.width id:rootstackView
height: root.height width:root.width
initialItem: StackLayout{ height: root.height - bar.height
initialItem: StackLayout{
id:rootstack id:rootstack
width:rootstackView.width width:rootstackView.width
height: rootstackView.height height: rootstackView.height
@ -275,6 +243,7 @@ StackView{id:rootstackView
} }
} }
SystemPalette { id: palette; colorGroup: SystemPalette.Active }
QSystemTrayIcon { QSystemTrayIcon {
id: systemTray id: systemTray
@ -291,7 +260,7 @@ StackView{id:rootstackView
} }
} }
Component.onCompleted: { Component.onCompleted: {
icon = iconTray icon = root.color<palette.text?iconTrayWhite:iconTrayBlack
toolTip = qsTr("Click to open Friendiqa") toolTip = qsTr("Click to open Friendiqa")
//&hide() //&hide()
} }
@ -301,23 +270,21 @@ StackView{id:rootstackView
Component.onCompleted: { Component.onCompleted: {
onLoginChanged(login); onLoginChanged(login);
globaloptions=Service.readGO(db); globaloptions=Service.readGO(db);
if(globaloptions.view_darkmode==1){Material.theme=Material.Dark} if(globaloptions.view_darkmode==1){Material.theme=Material.System;}
else if (globaloptions.view_darkmode==2){Material.theme=Material.Light} else if (globaloptions.view_darkmode==2){Material.theme=Material.Dark;}
else {Material.theme=Material.System} else if (globaloptions.view_darkmode==3){Material.theme=Material.Light;}
if(!filesystem.Visibility){ if(!filesystem.Visibility){
systemTray.icon = iconTray; systemTray.visible=true;
// systemTray.toolTip = qsTr("Click to open Friendiqa");
systemTray.visible=true
systemTray.show(); systemTray.show();
} }
var component;
if(osSettings.osType=="Android"){ if(osSettings.osType=="Android"){
var component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml"); component = Qt.createComponent("qrc:/qml/genericqml/IntentReceiver.qml");
var IntentReceiverQml = component.createObject(root); var IntentReceiverQml = component.createObject(root);
} }
else if (osSettings.osType=="Linux"){ else if (osSettings.osType=="Linux"){
if (login!=""){newstypeSignal("refresh")} if (login!=""){newstypeSignal("refresh")}
var component = Qt.createComponent("qrc:/qml/genericqml/LinuxSync.qml"); component = Qt.createComponent("qrc:/qml/genericqml/LinuxSync.qml");
var LinuxSyncQml = component.createObject(root); var LinuxSyncQml = component.createObject(root);
} }
} }

View File

@ -30,25 +30,21 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls.Material 2.12 import QtQuick.Controls 2.12
Rectangle{
Item{
id: blueButton id: blueButton
width: Math.max(mainText.width+2*mm,5*mm) width: Math.max(mainText.width+2*mm,5*mm)
height: 5*mm height: 5*mm
border.color: "light blue"
color:"transparent"//"#EFEAEA" "sky blue"
property alias fontColor: mainText.color property alias fontColor: mainText.color
border.width:1
radius: mm
property alias text: mainText.text property alias text: mainText.text
property alias font: mainText.font property alias font: mainText.font
property alias fontSize: mainText.font.pointSize property alias fontSize: mainText.font.pointSize
signal clicked signal clicked
state:"" state:""
Text{ Label{
id:mainText id:mainText
color: Material.primaryTextColor//"black"
anchors.centerIn: parent anchors.centerIn: parent
width: contentWidth width: contentWidth
height: contentHeight height: contentHeight
@ -56,21 +52,23 @@ Rectangle{
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
text: "" text: ""
elide: Text.ElideNone elide: Text.ElideNone
} }
MouseArea{ MouseArea{
id:buttonArea id:buttonArea
anchors.fill:parent anchors.fill:parent
onPressed: blueButton.state="Pressed" onPressed: blueButton.state="Pressed"
onReleased: blueButton.state="" onReleased: blueButton.state=""
onClicked: {parent.clicked()} onClicked: {parent.clicked()}
} }
states: [ states: [
State { name: "Pressed" State { name: "Pressed"
PropertyChanges { target: blueButton; color: Material.buttonColor} } PropertyChanges { target: blueButton;} }
] ]
transitions: [
Transition { to:"*" transitions: [
Transition { to:"*"
ColorAnimation { target: blueButton; duration: 100} } ColorAnimation { target: blueButton; duration: 100} }
] ]
} }

View File

@ -28,18 +28,19 @@
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.6
import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
Button{ Button{
id: mButton id: closeButton
property alias color: bg.color width: height
width: Math.max(text.width+2*mm,2*root.fontFactor*osSettings.bigFontSize) anchors.topMargin: mm
//radius: mm anchors.right: parent.right
height: 2*root.fontFactor*osSettings.bigFontSize anchors.rightMargin: mm
//color: Material.grey text: "\uf057"
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
//highlighted:true onClicked: {
background: Rectangle{id:bg;color: Material.dialogColor//"#F3F3F3"; rootstackView.pop()
radius: 0.5*mm} }
} }

View File

@ -31,7 +31,6 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Item { Item {
@ -41,13 +40,10 @@ Item {
property var createdAtDate: new Date(contact.created_at) property var createdAtDate: new Date(contact.created_at)
property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>") property string connectUrl: (contact.network!=="dfrn")||(contact.isFriend==1)?"":( "<a href='"+contact.url.replace("profile","dfrn_request") +"'>"+qsTr("Connect")+"</a><br>")
Rectangle { Item {
id: wrapper id: wrapper
width:parent.width width:parent.width
height: parent.height height: parent.height
radius: 0.5*mm
border.color: Material.backgroundDimColor
color: Material.backgroundColor
Image { Image {
id: photoImage id: photoImage
x:0.5*mm x:0.5*mm
@ -70,7 +66,6 @@ Item {
height: 1.1*root.fontFactor*osSettings.bigFontSize height: 1.1*root.fontFactor*osSettings.bigFontSize
text: contact.name text: contact.name
elide: contentWidth>wrapper.width-4*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone elide: contentWidth>wrapper.width-4*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
} }
Label { Label {
@ -79,7 +74,6 @@ Item {
height: 1.1*root.fontFactor*osSettings.bigFontSize height: 1.1*root.fontFactor*osSettings.bigFontSize
text: "(@"+contact.screen_name+")" text: "(@"+contact.screen_name+")"
elide: contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone elide: contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
} }
Label { Label {
@ -89,7 +83,6 @@ Item {
maximumLineCount:2 maximumLineCount:2
text: Qt.atob(contact.description)!=""?contact.description:"" text: Qt.atob(contact.description)!=""?contact.description:""
elide:Text.ElideRight elide:Text.ElideRight
color: Material.secondaryTextColor
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
} }
} }

View File

@ -31,27 +31,24 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/configqml" import "qrc:/qml/configqml"
Rectangle{ Item{
// id: leftDrawer // id: leftDrawer
// width: osSettings.systemFontSize*30 // width: osSettings.systemFontSize*30
// height: root.height-bar.height // height: root.height-bar.height
//y: bar.height //y: bar.height
signal opened() signal opened()
color: Material.backgroundColor
LeftDrawerScrollview{ LeftDrawerScrollview{
width:parent.width-mm width:parent.width-mm
height:parent.height height:parent.height
x:mm x:mm
} }
Rectangle{ Item{
width: 1 width: 1
height: leftDrawer.height height: leftDrawer.height
anchors.right: leftDrawer.right anchors.right: leftDrawer.right
color: Material.dialogColor//"#EEEEEE"
} }
//Component.onCompleted: {opened();} //Component.onCompleted: {opened();}
} }

View File

@ -30,14 +30,13 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.11 import QtQuick 2.11
import QtQuick.Controls.Material 2.12 import QtQuick.Controls 2.12
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Rectangle{ Item{
id:permissionDialog id:permissionDialog
color: Material.backgroundColor
// x: mm // x: mm
width: parent.width-5*mm width: parent.width-5*mm
height:root.height/3 height:root.height/3
@ -63,10 +62,9 @@ Rectangle{
} }
} }
Text{ //cid not working in Friendica 02/2022 Label{ //cid not working in Friendica 02/2022
x:0.5*mm x:0.5*mm
y:0.5*mm y:0.5*mm
color: Material.primaryTextColor
text: qsTr("Friends") text: qsTr("Friends")
} }
ListView { ListView {
@ -84,20 +82,16 @@ Rectangle{
ListModel{id: contactModel} ListModel{id: contactModel}
Component{ Component{
id:contactItem id:contactItem
Rectangle{ Item{
id:contactitemRect id:contactitemRect
color: Material.backgroundColor
width:contactView.width width:contactView.width
height: 5*mm height: 5*mm
radius: 0.5*mm
property string contactstatus property string contactstatus
onContactstatusChanged:{ onContactstatusChanged:{
if(contactstatus=="positive"){contactitemRect.color="light green"} if(contactstatus=="positive"){contactitemRect.color="light green"}
else if (contactstatus=="negative"){contactitemRect.color= "red"} else if (contactstatus=="negative"){contactitemRect.color= "red"}
else{contactitemRect.color= Material.backgroundColor}} /*else{}*/}
border.color:Material.frameColor Label{
Text{
color: Material.primaryTextColor
text:contact.screen_name text:contact.screen_name
} }
MouseArea{ MouseArea{
@ -125,8 +119,7 @@ Rectangle{
else {contactstatus="neutral"} } else {contactstatus="neutral"} }
} }
} }
Text{ Label{
color: Material.primaryTextColor
x:contactView.width+2*mm x:contactView.width+2*mm
y:0.5*mm y:0.5*mm
text: qsTr("Groups") text: qsTr("Groups")
@ -146,20 +139,16 @@ Rectangle{
ListModel{id: groupModel} ListModel{id: groupModel}
Component{ Component{
id:groupItem id:groupItem
Rectangle{ Item{
id:groupitemRect id:groupitemRect
width:groupView.width width:groupView.width
radius: 0.5*mm
height: 5*mm height: 5*mm
property string groupstatus:"neutral" property string groupstatus:"neutral"
onGroupstatusChanged: onGroupstatusChanged:
{if(groupstatus=="positive"){groupitemRect.color="light green"} {if(groupstatus=="positive"){groupitemRect.color="light green"}
else if (groupstatus=="negative"){groupitemRect.color= "red"} else if (groupstatus=="negative"){groupitemRect.color= "red"}
else{groupitemRect.color= Material.backgroundColor}} /*else{}*/}
color: Material.backgroundColor Label{
border.color: Material.frameColor
Text{
color: Material.primaryTextColor
text:group.groupname text:group.groupname
} }
MouseArea{ MouseArea{
@ -183,7 +172,7 @@ Rectangle{
else {groupstatus="neutral"} } else {groupstatus="neutral"} }
} }
} }
MButton{ Button{
x:0.5*mm x:0.5*mm
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin:1 anchors.bottomMargin:1
@ -195,7 +184,7 @@ Rectangle{
Service.savePermissions(db,perms) Service.savePermissions(db,perms)
} }
} }
MButton{ Button{
x:contactView.width+2*mm x:contactView.width+2*mm
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.bottomMargin:1 anchors.bottomMargin:1

View File

@ -31,13 +31,10 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Rectangle { Item {
id:searchComponent id:searchComponent
color: Material.backgroundColor
radius:0.5*mm
property bool selfdestroying:false property bool selfdestroying:false
/* anchors.left: parent.left /* anchors.left: parent.left
anchors.leftMargin:mm anchors.leftMargin:mm
@ -48,7 +45,6 @@ Rectangle {
TextInput { TextInput {
id: searchText id: searchText
color: Material.primaryTextColor
focus: true focus: true
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
wrapMode: Text.Wrap wrapMode: Text.Wrap

View File

@ -32,7 +32,7 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12 import QtQml.Models 2.14
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/news.js" as Newsjs import "qrc:/js/news.js" as Newsjs
import "qrc:/js/service.js" as Service import "qrc:/js/service.js" as Service
@ -138,10 +138,7 @@ Page {
} }
Component { id: contactHeader Component { id: contactHeader
Rectangle{ Item{
border.color: Material.backgroundDimColor
border.width: 1
color: Material.backgroundColor
width:contactView.width width:contactView.width
height: contactView.width<35*root.fontFactor*osSettings.systemFontSize?(profileImage.height+namelabel.height+detailtext.height+7*mm):Math.max(profileImage.height,(buttonflow.height+namelabel.height+detailtext.height))+7*mm height: contactView.width<35*root.fontFactor*osSettings.systemFontSize?(profileImage.height+namelabel.height+detailtext.height+7*mm):Math.max(profileImage.height,(buttonflow.height+namelabel.height+detailtext.height))+7*mm
property var createdAtDate: new Date(contact.created_at) property var createdAtDate: new Date(contact.created_at)
@ -168,7 +165,7 @@ Page {
y: mm y: mm
spacing:4 spacing:4
MButton{ Button{
id:photobutton id:photobutton
height: 6*mm height: 6*mm
width: 8*mm width: 8*mm
@ -185,7 +182,7 @@ Page {
} }
} }
MButton{ Button{
id:dmbutton id:dmbutton
height: 6*mm height: 6*mm
width: 8*mm width: 8*mm
@ -198,7 +195,7 @@ Page {
} }
} }
MButton{ Button{
id:eventbutton id:eventbutton
visible:(contact.network=="dfrn") visible:(contact.network=="dfrn")
height: 6*mm height: 6*mm
@ -212,7 +209,7 @@ Page {
rootstackView.pop() rootstackView.pop()
} }
} }
MButton{ Button{
id:approvebutton id:approvebutton
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact) visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm height: 6*mm
@ -227,7 +224,7 @@ Page {
rootstackView.pop() rootstackView.pop()
} }
} }
MButton{ Button{
id:rejectbutton id:rejectbutton
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact) visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm height: 6*mm
@ -242,7 +239,7 @@ Page {
rootstackView.pop() rootstackView.pop()
} }
} }
MButton{ Button{
id:ignorebutton id:ignorebutton
visible:(contact.hasOwnProperty("acct")&&!contact.searchContact) visible:(contact.hasOwnProperty("acct")&&!contact.searchContact)
height: 6*mm height: 6*mm
@ -257,7 +254,7 @@ Page {
rootstackView.pop() rootstackView.pop()
} }
} }
MButton{ Button{
id:followbutton id:followbutton
visible:(contact.isFriend==0 || !contact.hasOwnProperty("isFriend")) visible:(contact.isFriend==0 || !contact.hasOwnProperty("isFriend"))
height: 6*mm height: 6*mm
@ -274,7 +271,7 @@ Page {
} }
} }
MButton{ Button{
id:unfollowbutton id:unfollowbutton
visible:(contact.isFriend==1) visible:(contact.isFriend==1)
height: 6*mm height: 6*mm
@ -328,14 +325,13 @@ Page {
height: implicitHeight height: implicitHeight
text:contact.name+" (@"+contact.screen_name+")" text:contact.name+" (@"+contact.screen_name+")"
wrapMode: Text.Wrap wrapMode: Text.Wrap
color: Material.primaryTextColor
font.pointSize: 1.2*osSettings.bigFontSize font.pointSize: 1.2*osSettings.bigFontSize
font.family: "Noto Sans" font.family: "Noto Sans"
anchors.top: contactView.width<35*root.fontFactor*osSettings.systemFontSize?profileImage.bottom:buttonflow.bottom anchors.top: contactView.width<35*root.fontFactor*osSettings.systemFontSize?profileImage.bottom:buttonflow.bottom
anchors.margins: mm anchors.margins: mm
anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right
} }
Text{ Label{
id:detailtext id:detailtext
anchors.top: namelabel.bottom anchors.top: namelabel.bottom
anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right anchors.left: contactView.width<35*root.fontFactor*osSettings.systemFontSize?contactView.left:profileImage.right
@ -346,7 +342,6 @@ Page {
font.family: "Noto Sans" font.family: "Noto Sans"
textFormat:Text.RichText textFormat:Text.RichText
wrapMode: Text.Wrap wrapMode: Text.Wrap
color: Material.primaryTextColor
text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(contact.description)!=""?contact.description:"")+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+ text:"<b>"+qsTr("Description")+": </b> "+(Qt.atob(contact.description)!=""?contact.description:"")+"<br> <b>"+qsTr("Location")+":</b> "+contact.location+"<br> <b>"+qsTr("Posts")+":</b> "+contact.statuses_count+
"<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+ "<br> <b>"+qsTr("URL")+":</b> <a href='"+ contact.url+"'>"+contact.url+"</a><br>"+
"<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())+"<br>"+ "<b>"+qsTr("Created at")+":</b> "+createdAtDate.toLocaleString(Qt.locale())+"<br>"+
@ -389,7 +384,7 @@ Page {
source: "qrc:/js/newsworker.js" source: "qrc:/js/newsworker.js"
} }
MButton { Button {
id: closeButton id: closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize anchors.topMargin: 0.5*root.fontFactor*osSettings.bigFontSize

View File

@ -32,6 +32,7 @@
// ConversationView with button // ConversationView with button
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQml.Models 2.14
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/qml/newsqml" import "qrc:/qml/newsqml"
@ -39,7 +40,6 @@ import "qrc:/qml/newsqml"
Page { Page {
id:conversationList id:conversationList
property var news:[] property var news:[]
// color: "white"
//function backRequested(){pageStack.pop()} //function backRequested(){pageStack.pop()}
// width:root.width // width:root.width
// height: root.height-7*mm // height: root.height-7*mm
@ -131,7 +131,7 @@ Page {
source: "qrc:/js/newsworker.js" source: "qrc:/js/newsworker.js"
} }
MButton { Button {
id: closeButton id: closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1*mm anchors.topMargin: 1*mm

View File

@ -31,16 +31,14 @@
// List of people from Friendica Activities // List of people from Friendica Activities
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls.Material 2.12 import QtQuick.Controls 2.12
import QtQml.Models 2.14
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Rectangle { Item {
id:activitiesRectangle id:activitiesRectangle
property var activitymembers property var activitymembers
color: Material.dialogColor
border.color: Material.frameColor
radius:0.5*mm
width:root.width/2 width:root.width/2
height:Math.min(root.height/2,(10*mm+6*activitymembers.length*mm)) height:Math.min(root.height/2,(10*mm+6*activitymembers.length*mm))
@ -60,11 +58,7 @@ Rectangle {
Component { Component {
id:activitiesContact id:activitiesContact
Rectangle{ Item{
border.color: Material.frameColor
color: Material.backgroundColor
border.width: 1
radius:0.5*mm
width:parent.width width:parent.width
height:6*mm height:6*mm
Image { Image {
@ -76,8 +70,7 @@ Rectangle {
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"} onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
} }
Text{ Label{
color: Material.primaryTextColor
font.pointSize: osSettings.bigFontSize font.pointSize: osSettings.bigFontSize
anchors.left: contactImage.right anchors.left: contactImage.right
anchors.margins: 1*mm anchors.margins: 1*mm
@ -91,13 +84,12 @@ Rectangle {
} }
} }
MButton { Button {
id: closeButton id: closeButton
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1*mm anchors.topMargin: 1*mm
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 1*mm anchors.rightMargin: 1*mm
//color:"white"
text: "\uf057" text: "\uf057"
onClicked: { onClicked: {
activitiesRectangle.destroy() activitiesRectangle.destroy()

View File

@ -30,24 +30,21 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls.Material 2.12 import QtQuick.Controls 2.12
Rectangle { Item {
id:hashtagRectangle id:hashtagRectangle
color:Material.dialogColor
property alias text: hashtagText.text property alias text: hashtagText.text
radius:0.3*mm
width:hashtagText.contentWidth+mm width:hashtagText.contentWidth+mm
height:root.fontFactor*osSettings.bigFontSize height:root.fontFactor*osSettings.bigFontSize
Text{ Label{
id:hashtagText id:hashtagText
font.pointSize: osSettings.systemFontSize font.pointSize: osSettings.systemFontSize
color: Material.secondaryTextColor
anchors.centerIn: parent anchors.centerIn: parent
anchors.margins: 0.5*mm anchors.margins: 0.5*mm
} }
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
onClicked:{root.searchSignal(hashtagText.text.replace("#",""))} onClicked:{root.searchSignal(hashtagText.text.replace("#",""))}
} }
} }

View File

@ -267,7 +267,6 @@ Page{
BlueButton{ BlueButton{
width: 5*root.fontFactor*osSettings.bigFontSize width: 5*root.fontFactor*osSettings.bigFontSize
height:imageUploadView.height-3*root.fontFactor*osSettings.bigFontSize height:imageUploadView.height-3*root.fontFactor*osSettings.bigFontSize
color: Material.backgroundColor
text:"\u002b" text:"\u002b"
fontSize: 3*osSettings.bigFontSize fontSize: 3*osSettings.bigFontSize
onClicked:{attach()} onClicked:{attach()}

View File

@ -33,15 +33,13 @@
// message with buttons // message with buttons
import QtQuick 2.4 import QtQuick 2.4
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/helper.js" as Helperjs import "qrc:/js/helper.js" as Helperjs
import "qrc:/js/smiley.js" as Smileyjs import "qrc:/js/smiley.js" as Smileyjs
import "qrc:/js/news.js" as Newsjs import "qrc:/js/news.js" as Newsjs
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
import "qrc:/qml/newsqml" import "qrc:/qml/newsqml"
Rectangle{ Item{
color:Material.dialogColor
width:parent.width width:parent.width
height: messageColumn.height+2*mm height: messageColumn.height+2*mm
id:messageSend id:messageSend
@ -194,10 +192,6 @@ Rectangle{
anchors.leftMargin: 2*root.fontFactor*osSettings.bigFontSize anchors.leftMargin: 2*root.fontFactor*osSettings.bigFontSize
visible: newsSwipeview.currentIndex!=0 visible: newsSwipeview.currentIndex!=0
text:"\uf053" text:"\uf053"
fontColor: Material.hintTextColor
border.color: "transparent"
color:"transparent"
radius:0
onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex-1} onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex-1}
} }
@ -208,10 +202,6 @@ Rectangle{
anchors.rightMargin: 2*root.fontFactor*osSettings.bigFontSize anchors.rightMargin: 2*root.fontFactor*osSettings.bigFontSize
visible: newsSwipeview.currentIndex!=newsSwipeview.length-1 visible: newsSwipeview.currentIndex!=newsSwipeview.length-1
text:"\uf054" text:"\uf054"
fontColor: Material.hintTextColor
border.color: "transparent"
color:"transparent"
radius:0
onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex+1} onClicked: {newsSwipeview.currentIndex=newsSwipeview.currentIndex+1}
} }
} }
@ -238,9 +228,7 @@ Rectangle{
} }
} }
Rectangle{ Item{
color: Material.backgroundColor
radius: 0.5*mm
visible:(conversation || (newsSwipeview.stacktype!="Notifications")) visible:(conversation || (newsSwipeview.stacktype!="Notifications"))
x:mm x:mm
width: parent.width-2*mm width: parent.width-2*mm
@ -294,12 +282,13 @@ Rectangle{
if (text!=""){ if (text!=""){
var plaintext=getText(0,cursorPosition) var plaintext=getText(0,cursorPosition)
var regex1 = /@[a-z]+/;var regex2 = /\![a-z]+/;var regex3 = /\s/; var regex1 = /@[a-z]+/;var regex2 = /\![a-z]+/;var regex3 = /\s/;
var letter;
if (regex1.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText)){ if (regex1.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)+preeditText)){
var letter=(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)).match(/[a-z]+/); letter=(getText(plaintext.lastIndexOf('@',cursorPosition),cursorPosition)).match(/[a-z]+/);
contactprefix="@"; contactprefix="@";
contactmenu(letter.toString()) contactmenu(letter.toString())
} else if( regex2.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) ){ } else if( regex2.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) && !regex3.test(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)+preeditText) ){
var letter=(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)).match(/[a-z]+/); letter=(getText(plaintext.lastIndexOf('!',cursorPosition),cursorPosition)).match(/[a-z]+/);
contactprefix="!"; contactprefix="!";
contactmenu(letter.toString()) contactmenu(letter.toString())
}else {contactSelector.visible=false} }else {contactSelector.visible=false}
@ -350,7 +339,7 @@ Rectangle{
bodyField.cursorPosition=bodyField.cursorPosition+hashtag.length+1 bodyField.cursorPosition=bodyField.cursorPosition+hashtag.length+1
tagSelector.visible=false tagSelector.visible=false
} }
delegate: MButton {text:tag;onClicked: tagSelector.processTagSelection(tag)} delegate: Button {text:tag;onClicked: tagSelector.processTagSelection(tag)}
} }
ListModel{id:tagModel} ListModel{id:tagModel}
@ -361,15 +350,15 @@ Rectangle{
height: 2.5*root.fontFactor*osSettings.bigFontSize height: 2.5*root.fontFactor*osSettings.bigFontSize
x: 0.5*mm x: 0.5*mm
// MButton{id:permButton //Permissions not working in Friendica 02/2022 // Button{id:perButton //Permissions not working in Friendica 02/2022
// visible: !conversation && (newsSwipeview.stacktype!=="DirectMessages") // visible: !conversation && (newsSwipeview.stacktype!="DirectMessages")
// height: 2*root.fontFactor*osSettings.bigFontSize // height: 2*root.fontFactor*osSettings.bigFontSize
// width: 2*root.fontFactor*osSettings.bigFontSize // width: 2*root.fontFactor*osSettings.bigFontSize
// text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023" // text: ((contact_allow.length==0)&&(contact_deny.length==0)&&(group_allow.length==0)&&(group_deny.length==0))?"\uf09c":"\uf023"
// onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}} // onClicked: { if (permissionDialog.visible==false){permissionDialog.visible=true} else{permissionDialog.visible=false}}
// } // }
MButton{ Button{
id:smileyButton id:smileyButton
text: "\uf118" text: "\uf118"
height: 2*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
@ -377,14 +366,14 @@ Rectangle{
onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}} onClicked: {if (smileyDialog.visible==false){smileyDialog.visible=true} else{smileyDialog.visible=false}}
} }
MButton{ Button{
id:hastagButton id:hastagButton
text: "\uf292" text: "\uf292"
height: 2*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize width: 2*root.fontFactor*osSettings.bigFontSize
onClicked: {if (tagSelector.visible==false){hashtagmenu()} else{tagSelector.visible=false}} onClicked: {if (tagSelector.visible==false){hashtagmenu()} else{tagSelector.visible=false}}
} }
MButton{ Button{
id:imagesButton id:imagesButton
visible:(newsSwipeview.stacktype!="DirectMessages") visible:(newsSwipeview.stacktype!="DirectMessages")
text: "\uf03e" text: "\uf03e"
@ -398,7 +387,7 @@ Rectangle{
else{imageUploadDialog.visible=false}} else{imageUploadDialog.visible=false}}
} }
MButton { Button {
id: cancelButton id: cancelButton
height: 2*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize width: 2*root.fontFactor*osSettings.bigFontSize
@ -417,7 +406,7 @@ Rectangle{
} }
} }
} }
MButton { Button {
id: sendButton id: sendButton
height: 2*root.fontFactor*osSettings.bigFontSize height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize width: 2*root.fontFactor*osSettings.bigFontSize

View File

@ -30,21 +30,18 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls.Material 2.12 import QtQuick.Controls 2.12
Rectangle{
Item{
id: moreComments id: moreComments
width: parent.width width: parent.width
height: 5*mm height: 5*mm
color:Material.background//"white"
property int comments:0 property int comments:0
// border.color:"grey"
// border.width:1
signal clicked signal clicked
state:"" state:""
Text{ Label{
id:mainText id:mainText
color: "grey"
anchors.right: parent.right anchors.right: parent.right
anchors.margins: mm anchors.margins: mm
width: contentWidth width: contentWidth

View File

@ -30,6 +30,8 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.12
AnimatedImage {id:gif; AnimatedImage {id:gif;
width:toprow.width; width:toprow.width;
cache:false cache:false
@ -37,19 +39,17 @@ AnimatedImage {id:gif;
//property string mimetype:"" //property string mimetype:""
fillMode: Image.PreserveAspectFit; fillMode: Image.PreserveAspectFit;
onStatusChanged: {playing = (status == AnimatedImage.Ready)} onStatusChanged: {playing = (status == AnimatedImage.Ready)}
Rectangle{ Item{
visible: (model.newsitemobject.imageAttachmentList.length>1)&&(gif.status==Image.Ready) visible: (model.newsitemobject.imageAttachmentList.length>1)&&(gif.status==Image.Ready)
opacity: 0.5 opacity: 0.5
color: "black"
width:imageCountText.contentWidth+mm width:imageCountText.contentWidth+mm
height: imageCountText.contentHeight+mm height: imageCountText.contentHeight+mm
x: (gif.width-gif.paintedWidth)/2+gif.paintedWidth-width x: (gif.width-gif.paintedWidth)/2+gif.paintedWidth-width
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
Text { Label{
anchors.centerIn: parent anchors.centerIn: parent
id: imageCountText id: imageCountText
text: "+ " + (model.newsitemobject.imageAttachmentList.length-1).toString() text: "+ " + (model.newsitemobject.imageAttachmentList.length-1).toString()
color: "white"
} }
} }
MouseArea {anchors.fill:parent; MouseArea {anchors.fill:parent;

View File

@ -32,7 +32,6 @@
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml" import "qrc:/qml/genericqml"
Page{ Page{
@ -41,9 +40,8 @@ Page{
height:root.height//-7*mm height:root.height//-7*mm
property var photolistarray: [] property var photolistarray: []
Rectangle{ Item{
anchors.fill: newsphotolistView anchors.fill: newsphotolistView
color: "black"
} }
ListView{ ListView{
id: newsphotolistView id: newsphotolistView
@ -58,14 +56,13 @@ Page{
id: photolistModel id: photolistModel
} }
MButton { Button {
id: closeButton id: closeButton
z:2 z:2
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 1*mm anchors.topMargin: 1*mm
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 1*mm anchors.rightMargin: 1*mm
color: Material.dialogColor
text: "\uf057" text: "\uf057"
onClicked: { onClicked: {
if (rootstackView.depth>1){ if (rootstackView.depth>1){
@ -110,10 +107,6 @@ Page{
anchors.left: newsphotolistView.left anchors.left: newsphotolistView.left
visible: newsphotolistView.currentIndex!=0 visible: newsphotolistView.currentIndex!=0
text:"\uf053" text:"\uf053"
fontColor:"grey"
border.color: "transparent"
color:"transparent"
radius:0
onClicked: {newsphotolistView.currentIndex=newsphotolistView.currentIndex-1} onClicked: {newsphotolistView.currentIndex=newsphotolistView.currentIndex-1}
} }
@ -123,10 +116,6 @@ Page{
anchors.right: newsphotolistView.right anchors.right: newsphotolistView.right
visible: newsphotolistView.currentIndex!=photolistarray.length-1 visible: newsphotolistView.currentIndex!=photolistarray.length-1
text:"\uf054" text:"\uf054"
fontColor:"grey"
border.color: "transparent"
color:"transparent"
radius:0
onClicked: {newsphotolistView.currentIndex=newsphotolistView.currentIndex+1} onClicked: {newsphotolistView.currentIndex=newsphotolistView.currentIndex+1}
} }

Some files were not shown because too many files have changed in this diff Show More