close one notification to close all

This commit is contained in:
2026-02-02 21:47:47 +01:00
parent ed1a9a8605
commit 6d9f016350
9 changed files with 137 additions and 33 deletions

View File

@@ -1,4 +1,5 @@
#include "widgets/notification/spotifyNotification.hpp"
#include <sys/types.h>
#include "helpers/string.hpp"
#include "services/textureCache.hpp"
@@ -9,7 +10,7 @@
#include "gtkmm/image.h"
#include "gtkmm/label.h"
SpotifyNotification::SpotifyNotification(std::shared_ptr<Gdk::Monitor> monitor, MprisPlayer2Message mpris) : BaseNotification(monitor) {
SpotifyNotification::SpotifyNotification(uint64_t notificationId, std::shared_ptr<Gdk::Monitor> monitor, MprisPlayer2Message mpris) : BaseNotification(notificationId, monitor) {
auto container = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL, 10);
container->set_hexpand(true);
@@ -59,7 +60,7 @@ std::unique_ptr<Gtk::CenterBox> SpotifyNotification::createButtonBox(MprisPlayer
backButton->signal_clicked().connect([this, mpris]() {
if (mpris.previous) {
mpris.previous();
this->close();
this->signal_close.emit(this->notificationId);
}
});
@@ -86,7 +87,7 @@ std::unique_ptr<Gtk::CenterBox> SpotifyNotification::createButtonBox(MprisPlayer
nextButton->signal_clicked().connect([this, mpris]() {
if (mpris.next) {
mpris.next();
this->close();
this->signal_close.emit(this->notificationId);
}
});
buttonBox->set_start_widget(*backButton);