refacor media widget, apply clang format rule

This commit is contained in:
2026-02-07 14:14:50 +01:00
parent 64b3babd3d
commit d9ac353a0d
54 changed files with 642 additions and 878 deletions

View File

@@ -1,35 +1,36 @@
#pragma once
#include <memory>
#include "components/button/iconButton.hpp"
#include "components/button/tabButton.hpp"
#include "components/popover.hpp"
#include "widgets/controlCenter/mediaWidget.hpp"
#include "widgets/weather.hpp"
#include "gtkmm/box.h"
#include "gtkmm/scrolledwindow.h"
#include "gtkmm/stack.h"
#include "widgets/controlCenter/mediaControl.hpp"
#include "widgets/weather.hpp"
#include <memory>
#include <unordered_map>
class ControlCenter : public Popover {
public:
ControlCenter(Icon::Type icon, std::string name);
private:
Gtk::ScrolledWindow scrollview;
Gtk::Box container;
Gtk::Box tabRow;
Gtk::Stack contentStack;
Gtk::Box controlCenterContainer;
WeatherWidget weatherWidget;
std::unique_ptr<TabButton> mediaControl;
std::unique_ptr<TabButton> testTabButton;
std::shared_ptr<MprisController> mprisController = MprisController::getInstance();
std::unordered_map<std::string, MediaControlWidget*> mediaWidgets;
public:
ControlCenter(Icon::Type icon, std::string name);
void addPlayerWidget(const std::string &bus_name);
void removePlayerWidget(const std::string &bus_name);
void setActiveTab(const std::string &tab_name);
private:
Gtk::ScrolledWindow scrollview;
Gtk::Box container;
Gtk::Box tabRow;
Gtk::Stack contentStack;
std::unique_ptr<TabButton> mediaTabButton;
std::unique_ptr<TabButton> infoTabButton;
std::unique_ptr<TabButton> timerButton;
std::unique_ptr<WeatherWidget> weatherWidget;
std::unique_ptr<MediaWidget> mediaControlWidget;
void addPlayerWidget(const std::string &bus_name);
void removePlayerWidget(const std::string &bus_name);
void setActiveTab(const std::string &tab_name);
};