Improvement notification

pull/15/head
reionwong 4 years ago
parent bf487ebb2d
commit 92b982cf53

@ -97,30 +97,39 @@ Window {
visible: text
elide: Text.ElideRight
Layout.fillWidth: true
rightPadding: FishUI.Units.smallSpacing
}
Label {
text: model.body
visible: text
rightPadding: FishUI.Units.smallSpacing
maximumLineCount: 2
elide: Text.ElideRight
wrapMode: Text.Wrap
Layout.fillWidth: true
// Layout.fillHeight: true
Layout.alignment: Qt.AlignVCenter
}
Item {
Layout.fillHeight: true
}
}
Image {
width: 24
height: 24
source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/close.svg"
sourceSize: Qt.size(width, height)
visible: _mouseArea.containsMouse
Layout.alignment: Qt.AlignTop
}
}
// Image {
// anchors.top: parent.top
// anchors.right: parent.right
// anchors.topMargin: FishUI.Units.smallSpacing / 2
// anchors.rightMargin: FishUI.Units.smallSpacing
// width: 24
// height: 24
// source: "qrc:/images/" + (FishUI.Theme.darkMode ? "dark" : "light") + "/close.svg"
// sourceSize: Qt.size(width, height)
// visible: _mouseArea.containsMouse
// }
Timer {
id: timer
interval: 5000

@ -20,6 +20,8 @@
#include "language.h"
#include "languageadaptor.h"
#include <QDBusInterface>
Language::Language(QObject *parent)
: QObject(parent)
, m_settings(new QSettings(QStringLiteral("cutefishos"), QStringLiteral("language")))
@ -40,7 +42,27 @@ QString Language::languageCode() const
void Language::setLanguage(const QString &code)
{
m_settings->setValue("language", code);
if (m_settings->value("language").toString() == code) {
return;
}
m_settings->setValue("language", code);
emit languageChanged();
}
QDBusInterface iface("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications",
QDBusConnection::sessionBus());
if (iface.isValid()) {
QList<QVariant> args;
args << "cutefish-settings";
args << ((unsigned int) 0);
args << "preferences-system";
args << "";
args << tr("The system language has been changed, please log out and log in");
args << QStringList();
args << QVariantMap();
args << (int) 10;
iface.asyncCallWithArgumentList("Notify", args);
}
}

@ -197,6 +197,23 @@ void ThemeManager::setDevicePixelRatio(qreal ratio)
m_settings->setValue("forceFontDPI", fontDpi);
m_settings->sync();
applyXResources();
QDBusInterface iface("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications",
QDBusConnection::sessionBus());
if (iface.isValid()) {
QList<QVariant> args;
args << "cutefish-settings";
args << ((unsigned int) 0);
args << "preferences-system";
args << "";
args << tr("Screen scaling needs to be re-login to take effect");
args << QStringList();
args << QVariantMap();
args << (int) 10;
iface.asyncCallWithArgumentList("Notify", args);
}
}
QString ThemeManager::wallpaper()

Loading…
Cancel
Save