close one notification to close all
This commit is contained in:
@@ -1,24 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <string>
|
||||
|
||||
#include "helpers/system.hpp"
|
||||
#include <csignal>
|
||||
#include <cstdint>
|
||||
|
||||
#include "gdkmm/monitor.h"
|
||||
#include "gtk4-layer-shell.h"
|
||||
#include "gtkmm/cssprovider.h"
|
||||
#include "gtkmm/window.h"
|
||||
|
||||
|
||||
#define DEFAULT_NOTIFICATION_TIMEOUT 7000
|
||||
|
||||
|
||||
class BaseNotification : public Gtk::Window {
|
||||
public:
|
||||
BaseNotification(std::shared_ptr<Gdk::Monitor> monitor);
|
||||
BaseNotification( uint64_t notificationId, std::shared_ptr<Gdk::Monitor> monitor);
|
||||
|
||||
sigc::signal<void(int)> signal_close;
|
||||
|
||||
virtual ~BaseNotification() = default;
|
||||
|
||||
uint64_t getNotificationId() const {
|
||||
return this->notificationId;
|
||||
}
|
||||
|
||||
private:
|
||||
void ensure_notification_css_loaded();
|
||||
|
||||
// onClose signal can be added here if needed
|
||||
protected:
|
||||
uint64_t notificationId;
|
||||
};
|
||||
@@ -1,11 +1,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include "services/dbus/messages.hpp"
|
||||
#include "widgets/notification/baseNotification.hpp"
|
||||
|
||||
class NotificationWindow : public BaseNotification {
|
||||
public:
|
||||
NotificationWindow(std::shared_ptr<Gdk::Monitor> monitor, NotifyMessage message);
|
||||
NotificationWindow(uint64_t notificationId, std::shared_ptr<Gdk::Monitor> monitor, NotifyMessage message);
|
||||
virtual ~NotificationWindow() = default;
|
||||
|
||||
};
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
#include "services/dbus/messages.hpp"
|
||||
@@ -9,7 +10,7 @@
|
||||
|
||||
class SpotifyNotification : public BaseNotification {
|
||||
public:
|
||||
SpotifyNotification(std::shared_ptr<Gdk::Monitor> monitor, MprisPlayer2Message message);
|
||||
SpotifyNotification(uint64_t notificationId, std::shared_ptr<Gdk::Monitor> monitor, MprisPlayer2Message message);
|
||||
virtual ~SpotifyNotification() = default;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user