tidy&format(all): all files formatted and relevant warnings resolved
C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
C++ / build (pull_request) Failing after 15s
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 28s
Python / lint-format (pull_request) Successful in 45s
Python / test (pull_request) Successful in 38s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m45s
This commit is contained in:
+19
-10
@@ -6,7 +6,13 @@
|
||||
|
||||
namespace ZShell {
|
||||
|
||||
Toast::Toast(const QString& title, const QString& message, const QString& icon, Type type, int timeout, QObject* parent)
|
||||
Toast::Toast(
|
||||
const QString& title,
|
||||
const QString& message,
|
||||
const QString& icon,
|
||||
Type type,
|
||||
int timeout,
|
||||
QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_closed(false)
|
||||
, m_title(title)
|
||||
@@ -94,22 +100,25 @@ void Toast::unlock(QObject* sender) {
|
||||
}
|
||||
}
|
||||
|
||||
Toaster::Toaster(QObject* parent)
|
||||
: QObject(parent) {
|
||||
}
|
||||
Toaster::Toaster(QObject* parent) : QObject(parent) {}
|
||||
|
||||
QQmlListProperty<Toast> Toaster::toasts() {
|
||||
return QQmlListProperty<Toast>(this, &m_toasts);
|
||||
}
|
||||
|
||||
void Toaster::toast(const QString& title, const QString& message, const QString& icon, Toast::Type type, int timeout) {
|
||||
void Toaster::toast(
|
||||
const QString& title,
|
||||
const QString& message,
|
||||
const QString& icon,
|
||||
Toast::Type type,
|
||||
int timeout) {
|
||||
auto* toast = new Toast(title, message, icon, type, timeout, this);
|
||||
QObject::connect(toast, &Toast::finishedClose, this, [toast, this]() {
|
||||
if (m_toasts.removeOne(toast)) {
|
||||
emit toastsChanged();
|
||||
toast->deleteLater();
|
||||
}
|
||||
});
|
||||
if (m_toasts.removeOne(toast)) {
|
||||
emit toastsChanged();
|
||||
toast->deleteLater();
|
||||
}
|
||||
});
|
||||
m_toasts.push_front(toast);
|
||||
emit toastsChanged();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user