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;
|
||||
};
|
||||
16
include/widgets/wallpaperWindow.hpp
Normal file
16
include/widgets/wallpaperWindow.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtk4-layer-shell/gtk4-layer-shell.h>
|
||||
#include <gtkmm.h>
|
||||
#include <string>
|
||||
|
||||
class WallpaperWindow : public Gtk::Window {
|
||||
public:
|
||||
WallpaperWindow(GdkMonitor *monitor, const std::string &imagePath);
|
||||
|
||||
private:
|
||||
Gtk::Picture picture;
|
||||
|
||||
static std::string expand_user_path(const std::string &path);
|
||||
static Glib::RefPtr<Gdk::Texture> load_texture(const std::string &path);
|
||||
};
|
||||
Reference in New Issue
Block a user