From f819cd831970bd5d1915170710af8e559be57bd0 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Sat, 26 Mar 2022 10:54:12 +0100 Subject: The help popup about shortcuts fits all text now - Also, a notification is now displayed when switching to offline mode (no sounds). --- qml/main.qml | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'qml/main.qml') diff --git a/qml/main.qml b/qml/main.qml index f254274..30595e0 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -2,6 +2,7 @@ import DeltaChat 1.0 import QtQuick 2.12 import QtQuick.Controls 2.12 as Controls import org.kde.kirigami 2.12 as Kirigami +import DcNotifications 1.0 Kirigami.ApplicationWindow { id: root @@ -91,33 +92,6 @@ Kirigami.ApplicationWindow { onActivated: helpPopup.open() } - Controls.Popup { - id: workNetwNotif - - modal: false - focus: activeFocus ? false : false - dim: false - width: 150 - height: 50 - x: Math.round((parent.width - width) / 2) - padding: 10 - contentChildren: [ - Text { - text: "Network status :" - bottomPadding: 10 - font.bold: true - font.pixelSize: 14 - }, - Text { - text: offlineSwitch.checked ? "We can work offline now." : "We can work online now." - font.pixelSize: 9 - topPadding: 20 - leftPadding: 10 - bottomPadding: 20 - } - ] - } - Controls.Popup { id: helpPopup @@ -125,7 +99,7 @@ Kirigami.ApplicationWindow { focus: true anchors.centerIn: parent width: 200 - height: 230 + height: 260 padding: 10 contentChildren: [ Text { @@ -200,14 +174,12 @@ Kirigami.ApplicationWindow { if (offlineSwitch.state == "on") { offlineSwitch.checked = false; offlineSwitch.state = "off"; - workNetwNotif.close(); - workNetwNotif.open(); + KNotif.send("workMode", ":/res/chat.delta.KDeltaChat.png", "KDeltaChat - Working online", "Switching to online mode..."); console.log("Work online"); } else { offlineSwitch.checked = true; offlineSwitch.state = "on"; - workNetwNotif.close(); - workNetwNotif.open(); + KNotif.send("workMode", ":/res/chat.delta.KDeltaChat.png", "KDeltaChat - Working offline", "Switching to offline mode..."); console.log("Work offline"); } } -- cgit v1.2.3-70-g09d2