From 63f454af249ce5a4ec79afb0ae79521094a04f16 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Tue, 12 Sep 2023 09:02:31 +0200 Subject: [PATCH] forgotten files --- .../gui/notifications/toastnotification.cpp | 25 +++++ .../gui/notifications/toastnotification.h | 28 +++++ .../gui/notifications/toastnotification.ui | 102 ++++++++++++++++++ 3 files changed, 155 insertions(+) create mode 100644 src/librssguard/gui/notifications/toastnotification.cpp create mode 100644 src/librssguard/gui/notifications/toastnotification.h create mode 100644 src/librssguard/gui/notifications/toastnotification.ui diff --git a/src/librssguard/gui/notifications/toastnotification.cpp b/src/librssguard/gui/notifications/toastnotification.cpp new file mode 100644 index 000000000..e3159ade5 --- /dev/null +++ b/src/librssguard/gui/notifications/toastnotification.cpp @@ -0,0 +1,25 @@ +// For license of this file, see /LICENSE.md. + +#include "gui/notifications/toastnotification.h" + +#include "miscellaneous/iconfactory.h" + +#ifdef Q_OS_MAC +#include +#endif + +ToastNotification::ToastNotification(Notification::Event event, + const GuiMessage& msg, + const GuiAction& action, + QWidget* parent) + : BaseToastNotification(parent) { + m_ui.setupUi(this); + + setupCloseButton(m_ui.m_btnClose); + loadNotification(event, msg, action); +} + +void ToastNotification::loadNotification(Notification::Event event, const GuiMessage& msg, const GuiAction& action) { + m_ui.m_lblTitle->setText(msg.m_title); + m_ui.m_lblBody->setText(msg.m_message); +} diff --git a/src/librssguard/gui/notifications/toastnotification.h b/src/librssguard/gui/notifications/toastnotification.h new file mode 100644 index 000000000..555d29c77 --- /dev/null +++ b/src/librssguard/gui/notifications/toastnotification.h @@ -0,0 +1,28 @@ +// For license of this file, see /LICENSE.md. + +#ifndef TOASTNOTIFICATION_H +#define TOASTNOTIFICATION_H + +#include "gui/notifications/basetoastnotification.h" + +#include "miscellaneous/application.h" + +#include "ui_toastnotification.h" + +class ToastNotification : public BaseToastNotification { + Q_OBJECT + + public: + explicit ToastNotification(Notification::Event event, + const GuiMessage& msg, + const GuiAction& action, + QWidget* parent = nullptr); + + private: + void loadNotification(Notification::Event event, const GuiMessage& msg, const GuiAction& action); + + private: + Ui::ToastNotification m_ui; +}; + +#endif // TOASTNOTIFICATION_H diff --git a/src/librssguard/gui/notifications/toastnotification.ui b/src/librssguard/gui/notifications/toastnotification.ui new file mode 100644 index 000000000..ea69e8e28 --- /dev/null +++ b/src/librssguard/gui/notifications/toastnotification.ui @@ -0,0 +1,102 @@ + + + ToastNotification + + + + 0 + 0 + 321 + 143 + + + + Dialog + + + + + + + + + + + Qt::AlignCenter + + + + + + + ... + + + + + + + + + + 0 + 0 + + + + 11 + + + Qt::AlignHCenter|Qt::AlignTop + + + + + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + + + + PushButton + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + PlainToolButton + QToolButton +
plaintoolbutton.h
+
+
+ + +