refacor media widget, apply clang format rule
This commit is contained in:
@@ -1,33 +1,32 @@
|
||||
#include "widgets/notification/notificationWindow.hpp"
|
||||
|
||||
#include <cstdint>
|
||||
#include <sys/types.h>
|
||||
#include "components/button/iconButton.hpp"
|
||||
|
||||
#include "components/button/textButton.hpp"
|
||||
#include "helpers/string.hpp"
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
#include "gtkmm/button.h"
|
||||
#include "gtkmm/image.h"
|
||||
#include "gtkmm/label.h"
|
||||
|
||||
NotificationWindow::NotificationWindow(uint64_t notificationId, std::shared_ptr<Gdk::Monitor> monitor, NotifyMessage notify) : BaseNotification(notificationId, monitor) {
|
||||
set_title(notify.summary);
|
||||
|
||||
|
||||
// Main vertical box
|
||||
auto vbox = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::VERTICAL, 8);
|
||||
vbox->set_halign(Gtk::Align::FILL);
|
||||
|
||||
switch (notify.urgency) {
|
||||
case NotificationUrgency::CRITICAL:
|
||||
add_css_class("notification-critical");
|
||||
break;
|
||||
case NotificationUrgency::NORMAL:
|
||||
add_css_class("notification-normal");
|
||||
break;
|
||||
case NotificationUrgency::LOW:
|
||||
add_css_class("notification-low");
|
||||
break;
|
||||
case NotificationUrgency::CRITICAL:
|
||||
add_css_class("notification-critical");
|
||||
break;
|
||||
case NotificationUrgency::NORMAL:
|
||||
add_css_class("notification-normal");
|
||||
break;
|
||||
case NotificationUrgency::LOW:
|
||||
add_css_class("notification-low");
|
||||
break;
|
||||
}
|
||||
|
||||
auto header_box = Gtk::make_managed<Gtk::Box>(Gtk::Orientation::HORIZONTAL);
|
||||
@@ -77,16 +76,16 @@ NotificationWindow::NotificationWindow(uint64_t notificationId, std::shared_ptr<
|
||||
btn->add_css_class("notification-button");
|
||||
|
||||
switch (notify.urgency) {
|
||||
case NotificationUrgency::CRITICAL:
|
||||
btn->add_css_class("notification-critical");
|
||||
break;
|
||||
case NotificationUrgency::NORMAL:
|
||||
btn->add_css_class("notification-normal");
|
||||
break;
|
||||
case NotificationUrgency::LOW:
|
||||
btn->add_css_class("notification-low");
|
||||
break;
|
||||
}
|
||||
case NotificationUrgency::CRITICAL:
|
||||
btn->add_css_class("notification-critical");
|
||||
break;
|
||||
case NotificationUrgency::NORMAL:
|
||||
btn->add_css_class("notification-normal");
|
||||
break;
|
||||
case NotificationUrgency::LOW:
|
||||
btn->add_css_class("notification-low");
|
||||
break;
|
||||
}
|
||||
|
||||
btn->signal_clicked().connect([this, action_id, cb = notify.on_action, guard = notify.actionInvoked]() {
|
||||
if (cb && guard && !*guard) {
|
||||
|
||||
Reference in New Issue
Block a user