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{
background: Rectangle{
anchors.fill: parent
color: Material.backgroundDimColor

View File

@ -28,7 +28,7 @@ Page {
id: dialog
anchors.centerIn: parent
title: "Dialog"
Text {
Label {
text: "Demo"
}
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/Search.qml</file>
<file>qml/genericqml/IntentReceiver.qml</file>
<file>qml/genericqml/MButton.qml</file>
<file>qml/genericqml/LinuxSync.qml</file>
<file>qml/genericqml/BlueButton.qml</file>
<file>qml/genericqml/CloseButton.qml</file>
<file>qml/genericqml/ContactComponent.qml</file>
<file>qml/genericqml/PermissionDialog.qml</file>
<file>qml/calendarqml/CalendarTab.qml</file>
@ -224,7 +224,6 @@
<file>images/smileys/adult/finger.gif</file>
<file>images/smileys/adult/sperm.gif</file>
<file>images/smileys/adult/tits.gif</file>
<file>images/addImage.png</file>
<file>common/filesystem.cpp</file>
<file>common/filesystem.h</file>
<file>common/friendiqa.cpp</file>
@ -246,7 +245,8 @@
<file>translations/friendiqa-hu.qm</file>
<file>translations/friendiqa-hu.ts</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/ConfigStartPage.qml</file>
<file>qml/contactqml/ContactsSearchPage.qml</file>

View File

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

View File

@ -47,6 +47,7 @@
//#include <QQuickWidget>
#include <QSystemTrayIcon>
#include <QQmlContext>
#include <QQuickStyle>
// Declare a user-defined data type to work with an icon in QML
Q_DECLARE_METATYPE(QSystemTrayIcon::ActivationReason)
@ -105,11 +106,16 @@ int main(int argc, char *argv[]) {
ALARM* alarm = ALARM::instance();
view.rootContext()->setContextProperty("alarm", alarm);
UPDATENEWS* updatenews = UPDATENEWS::instance();
updatenews->setDatabase();
if(updatenews->getStyle() != 0){
QQuickStyle::setStyle("Material");
}
view.rootContext()->setContextProperty("updatenews", updatenews);
qmlRegisterType<QSystemTrayIcon>("QSystemTrayIcon", 1, 0, "QSystemTrayIcon");
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.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()
{

View File

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

View File

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

View File

@ -13,7 +13,7 @@
TEMPLATE = app
TARGET = friendiqa
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 \
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
// along with this program. If not, see <http://www.gnu.org/licenses/>.
import QtQuick.Controls 2.12
import QtQuick 2.11
import QtQuick.Controls.Material 2.12
//import QtQuick.Controls 2.4
Item {
@ -38,28 +38,27 @@ Item {
width: root.fontFactor*osSettings.bigFontSize*2
height: root.fontFactor*osSettings.bigFontSize*2
property int dateInt: Math.floor(model.date.valueOf()/86400000)
Rectangle {
id: placeHolder
color: model.today?'lightblue':'transparent';
border.color: 'lightblue'
border.width: 2
antialiasing: true
anchors.fill:parent
radius: 0.5*mm
}
Text {
opacity: (model.month==monthgrid.month)?1:0.2
Label {
id:daytext
anchors.right: parent.right
anchors.margins: 0.5*mm
color:(model.month==monthgrid.month)?Material.primaryTextColor:Material.secondaryTextColor
wrapMode: Text.WrapAnywhere
text: model.day
font.bold: model.today
font.pointSize: 1.2*osSettings.systemFontSize
}
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
color:"grey"
anchors.margins: 0.5*mm
anchors.bottom: calendarDay.bottom
width: parent.width-mm

View File

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

View File

@ -31,8 +31,8 @@
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Controls 1.4 as Oldcontrols
import QtQuick.Controls.Styles 1.4
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
@ -42,9 +42,9 @@ Flickable{
id:eventCreateBox
property date startDate: new Date()
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) {
var data = count === 12 ? modelData + 1 : modelData;
return data.toString().length < 2 ? "0" + data : data;
@ -52,339 +52,325 @@ Flickable{
boundsBehavior:Flickable.StopAtBounds
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{
x: 0.5*root.fontFactor*osSettings.bigFontSize
y: 2*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
//verticalAlignment: TextInput.AlignBottom
color: Material.primaryTextColor
text:qsTr("Start")
}
Button{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
width: height
text: "\uf057"
onClicked: {rootstackView.pop()}
}
TextField {
id: textStartDate
property string dateDay:(startDate.getDate()).toString().length<2?"0"+(startDate.getDate()):(startDate.getDate())
property string dateMonth: (startDate.getMonth()+1).toString().length<2?"0"+(startDate.getMonth()+1):(startDate.getMonth()+1)
x: 4*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 5*root.fontFactor*osSettings.bigFontSize
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
}
Label {
x: 0.5*root.fontFactor*osSettings.bigFontSize
y: 2*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
text:qsTr("Start")
}
MButton {
id: textStartDateDropdown
x: 9.5*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
text:"\uf0d7"
onClicked:{
cal.visible=true;
cal.curSelection="start"
}
}
TextField {
id: textStartDate
property string dateDay:(startDate.getDate()).toString().length<2?"0"+(startDate.getDate()):(startDate.getDate())
property string dateMonth: (startDate.getMonth()+1).toString().length<2?"0"+(startDate.getMonth()+1):(startDate.getMonth()+1)
x: 4*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 5*root.fontFactor*osSettings.bigFontSize
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
}
TextField {
id: textStartTime
x: 13*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
inputMask: "99:99"
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
Button {
id: textStartDateDropdown
x: 9.5*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
text:"\uf0d7"
onClicked:{
cal.visible=true;
cal.curSelection="start"
}
}
MButton {
id: textStartTimeDropdown
x: 16.5*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
text:"\uf0d7"
onClicked:{
onClicked: {timeTumbler.visible=true;timeTumbler.curSelection="start"}
}
}
TextField {
id: textStartTime
x: 13*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
inputMask: "99:99"
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{
x: 0.5*root.fontFactor*osSettings.bigFontSize
y: 4*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
color: Material.primaryTextColor
text:qsTr("End")
}
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
Button {
id: textStartTimeDropdown
x: 16.5*root.fontFactor*osSettings.bigFontSize
y: root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
text:"\uf0d7"
onClicked:{
onClicked: {timeTumbler.visible=true;timeTumbler.curSelection="start"}
}
}
MButton {
id: textEndDateDropdown
x: 9.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:{
cal.visible=true;
cal.curSelection="end"
}
}
Label{
x: 0.5*root.fontFactor*osSettings.bigFontSize
y: 4*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
text:qsTr("End")
}
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
}
TextField {
id: textEndTime
x: 13*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
enabled: false
horizontalAlignment: TextInput.AlignRight
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: textEndDateDropdown
x: 9.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:{
cal.visible=true;
cal.curSelection="end"
}
}
MButton {
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"}
}
TextField {
id: textEndTime
x: 13*root.fontFactor*osSettings.bigFontSize
y: 3*root.fontFactor*osSettings.bigFontSize
width: 3*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
enabled: false
horizontalAlignment: TextInput.AlignRight
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{
id: textColumn
x: 4*root.fontFactor*osSettings.bigFontSize
y: 6*root.fontFactor*osSettings.bigFontSize
width: parent.width-7*root.fontFactor*osSettings.bigFontSize
Oldcontrols.Calendar{
id:cal
property string curSelection: "start"
width: 12*root.fontFactor*osSettings.bigFontSize
height: 15*root.fontFactor*osSettings.bigFontSize
visible: false
selectedDate: new Date()
onClicked: {
if (curSelection=="start"){
textStartDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
}else{
textEndDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
}
cal.visible=false
Column{
x: 4*root.fontFactor*osSettings.bigFontSize
y: 6*root.fontFactor*osSettings.bigFontSize
width: parent.width-7*root.fontFactor*osSettings.bigFontSize
Oldcontrols.Calendar{
id:cal
property string curSelection: "start"
width: 12*root.fontFactor*osSettings.bigFontSize
height: 15*root.fontFactor*osSettings.bigFontSize
visible: false
selectedDate: new Date()
onClicked: {
if (curSelection=="start"){
textStartDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
}else{
textEndDate.text=Qt.formatDate(cal.selectedDate, "dd-MM-yyyy");
}
cal.visible=false
}
Frame {
id: timeTumbler
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
}
}
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
style: CalendarStyle {
dayDelegate: Rectangle {
color:"transparent"
opacity: styleData.visibleMonth ? 1 : 0.2
anchors.fill: parent
font.pointSize: osSettings.systemFontSize
font.family: "Noto Sans"
wrapMode: Text.Wrap
selectByMouse: true
placeholderText: qsTr("Event description (optional)")
textFormat: TextEdit.PlainText
text: eventInformation.hasOwnProperty("text")?eventInformation.text:""
onLinkActivated:{Qt.openUrlExternally(link)}
Label {
id: daytext
text: styleData.date.getDate()
anchors.centerIn: parent
}
border.width: 1
border.color: styleData.selected?'red':daytext.color;
}
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 {
id: locationField
width: parent.width-root.fontFactor*osSettings.bigFontSize
Frame {
id: timeTumbler
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
placeholderText: qsTr("Location (optional)")
font.family: "Noto Sans"
wrapMode: Text.Wrap
selectByMouse: true
placeholderText: qsTr("Event description (optional)")
onLinkActivated:{Qt.openUrlExternally(link)}
}
}
CheckBox{
id: chkbxPublish
width: 10*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
checked: true
font.pointSize: osSettings.systemFontSize
text: qsTr("Publish event?")
}
TextField {
id: locationField
width: parent.width-root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.systemFontSize
placeholderText: qsTr("Location (optional)")
}
BusyIndicator{
id: eventCreateBusy
anchors.horizontalCenter: eventCreateBox.horizontalCenter
anchors.top:eventCreateBox.top
anchors.topMargin: 2*root.fontFactor*osSettings.bigFontSize
width:3*root.fontFactor*osSettings.bigFontSize
height: 3*root.fontFactor*osSettings.bigFontSize
running: false
}
CheckBox{
id: chkbxPublish
width: 10*root.fontFactor*osSettings.bigFontSize
height: 2.5*root.fontFactor*osSettings.bigFontSize
checked: true
font.pointSize: osSettings.systemFontSize
text: qsTr("Publish event?")
}
MButton{
id:createEventButton
text: qsTr("Create event")
onClicked:{
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)
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)
}
}
Button{
id:createEventButton
text: qsTr("Create event")
onClicked:{
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)
}
}
@ -393,11 +379,18 @@ Flickable{
Label {
text: formatText(Tumbler.tumbler.count, modelData)
opacity: 1.0 - Math.abs(Tumbler.displacement) / (Tumbler.tumbler.visibleItemCount / 2)
color:Material.primaryTextColor
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
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.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQml.Models 2.14
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
import "qrc:/qml/calendarqml"
Rectangle{
Item{
id:eventList
color: Material.backgroundColor
property var daylist:[]
property int dayint: 0
property var events:[]
MButton{
Button{
id:closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
@ -54,7 +53,7 @@ Rectangle{
onClicked:{rootstackView.pop()}
}
MButton{
Button{
id: createNewEvent
anchors.top: parent.top
anchors.topMargin: 1*mm

View File

@ -31,22 +31,17 @@
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/service.js" as Service
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
import "qrc:/qml/calendarqml"
Rectangle{
Item{
id:eventItem
property string status: eventstatus
property var currEvent: event
width:parent.width
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 {
id:profileImage
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
onStatusChanged: if (profileImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
}
Text {
Label{
id:eventNameText
x: 8*mm
width:parent.width-8*mm
height:contentHeight
color: Material.primaryTextColor
textFormat: Text.RichText
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)
wrapMode:Text.Wrap
}
Text {
Label{
id:eventDetailsText
x:8*mm
z:4
width: parent.width-8*mm
height: contentHeight
color: Material.primaryTextColor
textFormat: Text.RichText
text: status!="large"?"":Qt.atob(event.desc) + (event.location==""?"":"<br><br>"+qsTr("Location")+": "+event.location)
anchors.top: eventNameText.bottom
@ -85,7 +78,7 @@ Rectangle{
MouseArea{
anchors.fill: parent
MButton{
Button{
id: deleteEvent
anchors.top: parent.top
anchors.topMargin: 0.5*mm

View File

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

View File

@ -33,188 +33,116 @@ import QtQuick 2.11
import QtQuick.Dialogs 1.2
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import "qrc:/js/service.js" as Service
import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
Page{
//anchors.fill: parent
width:root.width
height:root.height
anchors.fill: parent
Label {
text: qsTr("News as")
font.pointSize:osSettings.systemFontSize
x: root.fontFactor*osSettings.bigFontSize; y: 2*root.fontFactor*osSettings.bigFontSize
}
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 {
ColumnLayout{
anchors.fill: parent
Label {
text: qsTr("News as")
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");}
}
}
Label {
text: qsTr("Max. News")
font.pointSize: osSettings.systemFontSize
x: root.fontFactor*osSettings.bigFontSize; y:8*root.fontFactor*osSettings.bigFontSize
}
Slider{ id: maxNews
x:6*root.fontFactor*osSettings.bigFontSize; y: 10*root.fontFactor*osSettings.bigFontSize;
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);
ComboBox {
Layout.minimumWidth:root.width - mm * 3 - closeButton.width
model: [ qsTr("Timeline"), qsTr("Conversations") ]
currentIndex: globaloptions["newsViewType"] == "Timeline"?0:1
onCurrentIndexChanged: {
if(currentIndex == 0) {
Service.updateglobaloptions(root.db,"newsViewType","Timeline");
} else {
Service.updateglobaloptions(root.db,"newsViewType","Conversations");
}
}
}
}
CheckBox{
id: nsfwCheckbox
x: root.fontFactor*osSettings.bigFontSize
y: 14*root.fontFactor*osSettings.bigFontSize
font.pointSize: osSettings.bigFontSize
text: qsTr("Hide #nsfw?")
checked:(globaloptions["hide_nsfw"]==1)?true:false
onClicked: {
toggle();
if(nsfwCheckbox.checked==true){
Service.updateglobaloptions(root.db,"hide_nsfw",0);nsfwCheckbox.checked=false;
Label {
text: qsTr("Max. News")
font.pointSize: osSettings.bigFontSize
}
Row{
Label {
anchors.top: parent.top
anchors.bottom: parent.bottom
id:maxNewsText
text:maxNews.value
}
else{
Service.updateglobaloptions(root.db,"hide_nsfw",1);nsfwCheckbox.checked=true;
Slider{
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{
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{
text: qsTr("System")
checked: (globaloptions["view_darkmode"]==0 || globaloptions["view_darkmode"]==undefined)?true:false
font.pointSize: osSettings.bigFontSize
checked: globaloptions["view_darkmode"]==1
onClicked: {
if(checked==true){
Service.updateglobaloptions(root.db,"view_darkmode",0);
if(checked){
root.Material.theme=Material.System
}
systemTray.icon = root.color<palette.text?iconTrayWhite:iconTrayBlack
Service.updateglobaloptions(root.db,"view_darkmode",1);
}
}
}
RadioButton{
text: qsTr("Dark")
checked: (globaloptions["view_darkmode"]==1)?true:false
font.pointSize: osSettings.bigFontSize
checked: globaloptions["view_darkmode"]==2
onClicked: {
if(checked==true){
Service.updateglobaloptions(root.db,"view_darkmode",1);
if(checked){
root.Material.theme=Material.Dark
}
systemTray.icon = root.color<palette.text?iconTrayWhite:iconTrayBlack
Service.updateglobaloptions(root.db,"view_darkmode",2);
}
}
}
RadioButton{
text: qsTr("Light")
checked: (globaloptions["view_darkmode"]==2)?true:false
font.pointSize: osSettings.bigFontSize
checked: globaloptions["view_darkmode"]==3
onClicked: {
if(checked==true){
Service.updateglobaloptions(root.db,"view_darkmode",2);
if(checked){
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.Layouts 1.11
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/js/service.js" as Service
import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
Page{
//anchors.fill: parent
width:root.width
height:root.height
width: (parent != null)?parent.width:0
height: (parent != null)?parent.height:0
TabBar {
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
currentIndex: 0
TabButton {
text: qsTr("Appearance")
font.pointSize: osSettings.systemFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
width:6*root.fontFactor*osSettings.bigFontSize
width:root.width/3
}
TabButton {
text: qsTr("Sync")
font.pointSize: osSettings.systemFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
width:10*root.fontFactor*osSettings.bigFontSize
width:root.width/3
}
TabButton {
text: qsTr("Start")
visible:osSettings.osType=="Linux"
font.pointSize: osSettings.systemFontSize
height: 2*root.fontFactor*osSettings.bigFontSize
width:10*root.fontFactor*osSettings.bigFontSize
width:root.width/3
}
}
LeftDrawerLinux{
id:leftDrawer
visible: wideScreen&&rootstackView.depth<2
width: visible?osSettings.systemFontSize*15:0
height: root.height-bar.height
}
LeftDrawerAndroid{
id: leftDrawerAndroid
}
StackLayout{
id:configTabView
//anchors.fill: parent
width: wideScreen&&rootstackView.depth<2?parent.width-leftDrawer.width-mm:parent.width-mm//newstabitem.width/3*2:newstabitem.width
x: leftDrawer.width
y: configbar.height
height: parent.height-configbar.height-mm
anchors.right: parent.right
anchors.left: leftDrawer.right
anchors.top: configbar.bottom
anchors.bottom: parent.bottom
anchors.leftMargin: mm
currentIndex: configbar.currentIndex
// onCurrentIndexChanged:{
// if (currentIndex==1){
// contactsSignal("")
// }
// else if (currentIndex==2){
// contactsSignal("")
// }
// else if (currentIndex==3){groupsSignal(root.login.username)}
// }
Loader{
id: appearanceLoader
@ -116,16 +84,32 @@ Page{
source:(configTabView.currentIndex==2)? "qrc:/qml/configqml/ConfigStartPage.qml":""
}
}
MButton{
id:closeButton
// height: 2*root.fontFactor*osSettings.bigFontSize
width: 2*root.fontFactor*osSettings.bigFontSize;
anchors.top: parent.top
anchors.topMargin:2*root.fontFactor*osSettings.bigFontSize
anchors.right: parent.right
anchors.rightMargin: 1*mm
text: "\uf057"
LeftDrawerLinux{
id:leftDrawer
visible: wideScreen&&rootstackView.depth<2
width: visible?osSettings.systemFontSize*15:0
height: root.height-bar.height
}
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
onClicked:{rootstackView.pop()}
onClicked:{
rootstackView.push("qrc:/qml/configqml/InfoBox.qml");
}
}
}

View File

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

View File

@ -31,17 +31,15 @@
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml"
Page{
Text{id:infoBoxText
anchors.top:closeButton.bottom
anchors.topMargin: mm
Label{id:infoBoxText
anchors.left: parent.left
anchors.right: parent.right
anchors.top: closeButton.bottom
anchors.leftMargin: mm
textFormat: Text.RichText
width: root.width-mm
font.pointSize: osSettings.systemFontSize
color:Material.primaryTextColor
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
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>"+
@ -54,16 +52,12 @@ Page{
"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>)"
onLinkActivated:{
Qt.openUrlExternally(link)}
Qt.openUrlExternally(link)
}
}
MButton{
id:closeButton
CloseButton {
id: closeButton
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")
MouseArea{
anchors.fill:parent
onClicked:{rootstackView.push("qrc:qml/configqml/ConfigPage.qml");
onClicked:{
rootstackView.push("qrc:qml/configqml/ConfigPage.qml");
if(!wideScreen){leftDrawerAndroid.close()}
}
}
}
Label{y: 2*root.fontFactor*osSettings.bigFontSize
Label{
y: 2*root.fontFactor*osSettings.bigFontSize
width:implicitWidth
font.pointSize: osSettings.systemFontSize
text: "\uf2bb " + qsTr("Accounts")
MouseArea{
anchors.fill:parent
onClicked:{rootstackView.push("qrc:qml/configqml/AccountPage.qml");
onClicked:{
rootstackView.push("qrc:qml/configqml/AccountPage.qml");
if(!wideScreen){leftDrawerAndroid.close()}
}
}
}
Label{y: 4*root.fontFactor*osSettings.bigFontSize
Label{
y: 4*root.fontFactor*osSettings.bigFontSize
width:implicitWidth
font.pointSize: osSettings.systemFontSize
text: "\uf08b " +qsTr("Quit")
@ -83,31 +87,38 @@ ScrollView{
Service.cleanNews(root.db,function(){
Service.cleanHashtags(root.db,function(){
Service.cleanContacts(root.login,root.db,function(){
Qt.quit()})
})})
Qt.quit()
})
})
})
}
}
}
}
Component.onCompleted:{
Service.readAllLogins(db,function(accounts){
var i, accountComponent, accountQml;
if (accounts.length>0 && bar.currentIndex==0){
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*17*root.fontFactor*osSettings.bigFontSize
for(var i = 0; i < accounts.length; i++) {
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponent.qml");
var accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*17*root.fontFactor*osSettings.bigFontSize,
"currentnewstabstatus":currentnewstabstatus,
"account":accounts[i]});
leftDrawerColumn.height=(4.5+accounts.length*17)*root.fontFactor*osSettings.bigFontSize
for(i = 0; i < accounts.length; i++) {
accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponent.qml");
accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":(4.5+i*17)*root.fontFactor*osSettings.bigFontSize,
"currentnewstabstatus":currentnewstabstatus,
"account":accounts[i]
});
}
}else if(accounts.length>0 && bar.currentIndex==1){
leftDrawerColumn.height=4.5*root.fontFactor*osSettings.bigFontSize+accounts.length*8*root.fontFactor*osSettings.bigFontSize
for(var i = 0; i < accounts.length; i++) {
var accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponentContacts.qml");
var accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":4.5*root.fontFactor*osSettings.bigFontSize+i*8*root.fontFactor*osSettings.bigFontSize,
"account":accounts[i]});
leftDrawerColumn.height=(4.5+accounts.length*8)*root.fontFactor*osSettings.bigFontSize
for(i = 0; i < accounts.length; i++) {
accountComponent = Qt.createComponent("qrc:/qml/genericqml/DrawerAccountComponentContacts.qml");
accountQml = accountComponent.createObject(leftDrawerColumn,{
"y":(4.5+i*8)*root.fontFactor*osSettings.bigFontSize,
"account":accounts[i]
});
}
}
})}
})
}
}

View File

@ -32,56 +32,49 @@
import QtQuick 2.11
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import "qrc:/qml/configqml"
import "qrc:/js/service.js" as Service
Rectangle{
color: Material.dialogColor
Item{
property string adapter: ""
width: parent.width
height: 4*root.fontFactor*osSettings.bigFontSize
Label{
x: mm
y: 0.5*mm
font.pointSize: osSettings.systemFontSize
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")
height: childrenRect.height
Column {
width: parent.width
Label{
text: qsTr(adapter)
font.pointSize: osSettings.bigFontSize
onClicked: {
toggle();
if(notifyCheckbox.checked==true){
Service.updateglobaloptions(root.db,"notify_"+adapter,0);notifyCheckbox.checked=false;
}
RowLayout {
width: parent.width
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.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/configqml"
import "qrc:/qml/genericqml"
import "qrc:/js/service.js" as Service
Page{
//color:"white"
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.")
}
anchors.fill: parent
ScrollView{
width: root.width
height: root.height - 10*root.fontFactor*osSettings.bigFontSize;
y:7*root.fontFactor*osSettings.bigFontSize
anchors.fill: parent
clip:true
Column{
width: parent.width
spacing:mm
Column {
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:"Replies"}
SyncComponent{ adapter:"DirectMessages"}
@ -102,16 +83,4 @@ Page{
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
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQml.Models 2.14
import "qrc:/js/helper.js" as Helperjs
import "qrc:/qml/genericqml"
Rectangle {
Item {
id:contactlistRectangle
property var contacts:[]
property var possibleUsers: []
//y:8*mm
color: "white"
border.color: "light grey"
radius:0.5*mm
width:groupListView.width
height:groupListView.height
@ -61,10 +59,7 @@ Rectangle {
ListModel{id: contactModel}
Component { id:listContact
Rectangle{
border.color: "#EEEEEE"
border.width: 1
radius:0.5*mm
Item{
width:contactView.width
height:6*mm
Image {
@ -76,13 +71,13 @@ Rectangle {
source:(contact.profile_image!="")? "file://"+contact.profile_image : contact.profile_image_url
onStatusChanged: if (contactImage.status == Image.Error) {source="qrc:/images/defaultcontact.jpg"}
}
Text{
Label{
font.pointSize: osSettings.bigFontSize
anchors.left: contactImage.right
anchors.margins: 1*mm
text:Qt.atob(contact.name)
}
Text {
Label {
id:selected
anchors.right:parent.right
visible: contactlist.indexOf(contact)>-1
@ -90,7 +85,6 @@ Rectangle {
text: "\u2713"
width: 5*mm
anchors.top: parent.top
color: "green"
font.pointSize: osSettings.bigFontSize
}
@ -110,13 +104,12 @@ Rectangle {
}
}
MButton {
Button {
id: closeButton
anchors.top: parent.top
anchors.topMargin: 1*mm
anchors.right: parent.right
anchors.rightMargin: 1*mm
//color:"white"
text: "\uf057"
onClicked: {
groupModelAppend(contacts,function(){

View File

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

View File

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

View File

@ -31,7 +31,6 @@
import QtQuick 2.11
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import QtQuick.Layouts 1.11
import QtQuick.LocalStorage 2.0
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/genericqml"
Rectangle {
Item {
y:1
color: Material.backgroundColor//"white"
function showContactdetails(contact){
// rootstack.currentIndex=0;
@ -53,10 +51,7 @@ Rectangle {
BlueButton{
z:2
visible: !wideScreen
fontColor: "grey"
border.color: "transparent"
text: "\uf0c9"
font.pointSize: osSettings.bigFontSize
onClicked:{
leftDrawerAndroid.visible?leftDrawerAndroid.close():leftDrawerAndroid.open()}
}

View File

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

View File

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

View File

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

View File

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

View File

@ -28,18 +28,19 @@
//
// You should have received a copy of the GNU General Public License
// 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.Material 2.12
Button{
id: mButton
property alias color: bg.color
width: Math.max(text.width+2*mm,2*root.fontFactor*osSettings.bigFontSize)
//radius: mm
height: 2*root.fontFactor*osSettings.bigFontSize
//color: Material.grey
id: closeButton
width: height
anchors.topMargin: mm
anchors.right: parent.right
anchors.rightMargin: mm
text: "\uf057"
font.pointSize: osSettings.bigFontSize
//highlighted:true
background: Rectangle{id:bg;color: Material.dialogColor//"#F3F3F3";
radius: 0.5*mm}
onClicked: {
rootstackView.pop()
}
}

View File

@ -31,7 +31,6 @@
import QtQuick 2.0
import QtQuick.Controls 2.12
import QtQuick.Controls.Material 2.12
import "qrc:/qml/genericqml"
Item {
@ -41,13 +40,10 @@ Item {
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>")
Rectangle {
Item {
id: wrapper
width:parent.width
height: parent.height
radius: 0.5*mm
border.color: Material.backgroundDimColor
color: Material.backgroundColor
Image {
id: photoImage
x:0.5*mm
@ -70,7 +66,6 @@ Item {
height: 1.1*root.fontFactor*osSettings.bigFontSize
text: contact.name
elide: contentWidth>wrapper.width-4*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor
font.pointSize: osSettings.bigFontSize
}
Label {
@ -79,7 +74,6 @@ Item {
height: 1.1*root.fontFactor*osSettings.bigFontSize
text: "(@"+contact.screen_name+")"
elide: contentWidth>wrapper.width-4*root.fontFactor*osSettings.systemFontSize?Text.ElideRight:Text.ElideNone
color: Material.secondaryTextColor
font.pointSize: osSettings.bigFontSize
}
Label {
@ -89,7 +83,6 @@ Item {
maximumLineCount:2
text: Qt.atob(contact.description)!=""?contact.description:""
elide:Text.ElideRight
color: Material.secondaryTextColor
font.pointSize: osSettings.systemFontSize
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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