working timer
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "components/button/tabButton.hpp"
|
||||
#include "components/popover.hpp"
|
||||
#include "widgets/controlCenter/mediaWidget.hpp"
|
||||
#include "widgets/controlCenter/timer.hpp"
|
||||
#include "widgets/weather.hpp"
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
@@ -29,6 +30,7 @@ class ControlCenter : public Popover {
|
||||
|
||||
std::unique_ptr<WeatherWidget> weatherWidget;
|
||||
std::unique_ptr<MediaWidget> mediaControlWidget;
|
||||
std::unique_ptr<TimerWidget> timerWidget;
|
||||
|
||||
void addPlayerWidget(const std::string &bus_name);
|
||||
void removePlayerWidget(const std::string &bus_name);
|
||||
|
||||
22
include/widgets/controlCenter/timer.hpp
Normal file
22
include/widgets/controlCenter/timer.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <sys/types.h>
|
||||
#include "components/timer.hpp"
|
||||
#include "services/timerService.hpp"
|
||||
#include "gtkmm/box.h"
|
||||
|
||||
class TimerWidget : public Gtk::Box {
|
||||
public:
|
||||
TimerWidget();
|
||||
void addTimer(const std::string &duration, uint64_t timerId);
|
||||
void removeTimer(uint64_t timerId);
|
||||
void activateTimer(uint64_t timerId);
|
||||
|
||||
private:
|
||||
std::shared_ptr<TimerService> timerService = TimerService::getInstance();
|
||||
bool updatingText = false;
|
||||
std::string rawDigits;
|
||||
|
||||
std::map<uint64_t, std::unique_ptr<Timer>> activeTimers;
|
||||
};
|
||||
Reference in New Issue
Block a user