refactor notifications

This commit is contained in:
2026-02-01 16:10:42 +01:00
parent 17aef717b7
commit 178a4451d4
18 changed files with 449 additions and 236 deletions

View File

@@ -0,0 +1,24 @@
#pragma once
#include <filesystem>
#include <string>
#include "helpers/system.hpp"
#include "gdkmm/monitor.h"
#include "gtk4-layer-shell.h"
#include "gtkmm/cssprovider.h"
#include "gtkmm/window.h"
#define DEFAULT_NOTIFICATION_TIMEOUT 4000
class BaseNotification : public Gtk::Window {
public:
BaseNotification(std::shared_ptr<Gdk::Monitor> monitor);
virtual ~BaseNotification() = default;
private:
void ensure_notification_css_loaded();
};

View File

@@ -0,0 +1,11 @@
#pragma once
#include "services/dbus/messages.hpp"
#include "widgets/notification/baseNotification.hpp"
class NotificationWindow : public BaseNotification {
public:
NotificationWindow(std::shared_ptr<Gdk::Monitor> monitor, NotifyMessage message);
virtual ~NotificationWindow() = default;
};

View File

@@ -0,0 +1,16 @@
#pragma once
#include <memory>
#include <type_traits>
#include "services/dbus/messages.hpp"
#include "widgets/notification/baseNotification.hpp"
#include "gtkmm/box.h"
#include "gtkmm/centerbox.h"
class SpotifyNotification : public BaseNotification {
public:
SpotifyNotification(std::shared_ptr<Gdk::Monitor> monitor, MprisPlayer2Message message);
virtual ~SpotifyNotification() = default;
private:
std::unique_ptr<Gtk::CenterBox> createButtonBox(MprisPlayer2Message mpris);
};