some refactore
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "widgets/notification/spotifyNotification.hpp"
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "components/button/iconButton.hpp"
|
||||
#include "helpers/string.hpp"
|
||||
#include "services/textureCache.hpp"
|
||||
|
||||
@@ -58,7 +59,7 @@ std::unique_ptr<Gtk::CenterBox> SpotifyNotification::createButtonBox(MprisPlayer
|
||||
buttonBox->set_hexpand(true);
|
||||
buttonBox->set_halign(Gtk::Align::CENTER);
|
||||
|
||||
auto backButton = Gtk::make_managed<Gtk::Button>("\ue045");
|
||||
auto backButton = Gtk::make_managed<IconButton>(Icon::SKIP_PREVIOUS);
|
||||
backButton->add_css_class("notification-icon-button");
|
||||
backButton->add_css_class("notification-button");
|
||||
backButton->signal_clicked().connect([this, mpris]() {
|
||||
@@ -68,7 +69,7 @@ std::unique_ptr<Gtk::CenterBox> SpotifyNotification::createButtonBox(MprisPlayer
|
||||
}
|
||||
});
|
||||
|
||||
auto playPauseButton = Gtk::make_managed<Gtk::Button>("\ue037");
|
||||
auto playPauseButton = Gtk::make_managed<IconButton>(Icon::PLAY_ARROW);
|
||||
playPauseButton->add_css_class("notification-icon-button");
|
||||
playPauseButton->add_css_class("notification-button");
|
||||
playPauseButton->signal_clicked().connect([playPauseButton, mpris]() {
|
||||
@@ -77,15 +78,15 @@ std::unique_ptr<Gtk::CenterBox> SpotifyNotification::createButtonBox(MprisPlayer
|
||||
|
||||
static bool isPlaying = false;
|
||||
if (isPlaying) {
|
||||
playPauseButton->set_label("\ue037");
|
||||
playPauseButton->setIcon(Icon::PLAY_ARROW);
|
||||
} else {
|
||||
playPauseButton->set_label("\ue034");
|
||||
playPauseButton->setIcon(Icon::PAUSE);
|
||||
}
|
||||
isPlaying = !isPlaying;
|
||||
}
|
||||
});
|
||||
|
||||
auto nextButton = Gtk::make_managed<Gtk::Button>("\ue044");
|
||||
auto nextButton = Gtk::make_managed<IconButton>(Icon::SKIP_NEXT);
|
||||
nextButton->add_css_class("notification-icon-button");
|
||||
nextButton->add_css_class("notification-button");
|
||||
nextButton->signal_clicked().connect([this, mpris]() {
|
||||
|
||||
Reference in New Issue
Block a user