add move window to hyprland service
This commit is contained in:
15
include/widgets/controlCenter/controlCenter.hpp
Normal file
15
include/widgets/controlCenter/controlCenter.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include "components/popover.hpp"
|
||||
#include "gtkmm/box.h"
|
||||
#include "widgets/controlCenter/mediaControl.hpp"
|
||||
|
||||
class ControlCenter : public Popover {
|
||||
public:
|
||||
ControlCenter(std::string icon, std::string name);
|
||||
|
||||
private:
|
||||
Gtk::Box container;
|
||||
MediaControlWidget mediaControlWidget;
|
||||
|
||||
};
|
||||
52
include/widgets/controlCenter/mediaControl.hpp
Normal file
52
include/widgets/controlCenter/mediaControl.hpp
Normal file
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
#include "gtkmm/box.h"
|
||||
#include "gtkmm/button.h"
|
||||
#include "gtkmm/label.h"
|
||||
#include "gtkmm/overlay.h"
|
||||
#include "gtkmm/picture.h"
|
||||
#include "gtkmm/scale.h"
|
||||
#include "gtkmm/scrolledwindow.h"
|
||||
|
||||
#include "services/dbus/mpris.hpp"
|
||||
|
||||
class MediaControlWidget : public Gtk::Box {
|
||||
public:
|
||||
MediaControlWidget();
|
||||
|
||||
private:
|
||||
std::shared_ptr<MprisController> mprisController = MprisController::getInstance();
|
||||
|
||||
int64_t currentPositionUs = 0;
|
||||
int64_t totalLengthUs = 0;
|
||||
sigc::connection seekTimerConnection;
|
||||
|
||||
void setCurrentPosition(int64_t position_us);
|
||||
void setTotalLength(int64_t length_us);
|
||||
void resetSeekTimer(int64_t start_position_us);
|
||||
bool onSeekTick();
|
||||
|
||||
Gtk::Box spotifyContainer;
|
||||
|
||||
// image as background, artist, title
|
||||
Gtk::Overlay topContainer;
|
||||
Gtk::Picture backgroundImage;
|
||||
Gtk::Box infoContainer;
|
||||
Gtk::Label artistLabel;
|
||||
Gtk::Label titleLabel;
|
||||
|
||||
//
|
||||
Gtk::Box seekBarContainer;
|
||||
Gtk::Label currentTimeLabel;
|
||||
Gtk::Scale seekBar;
|
||||
Gtk::Label totalTimeLabel;
|
||||
|
||||
// playback controls
|
||||
Gtk::Box bottomContainer;
|
||||
Gtk::Button previousButton;
|
||||
Gtk::Button playPauseButton;
|
||||
Gtk::Button nextButton;
|
||||
|
||||
Gtk::ScrolledWindow imageWrapper;
|
||||
|
||||
void onSpotifyMprisUpdated(const MprisPlayer2Message &message);
|
||||
};
|
||||
Reference in New Issue
Block a user