add todo setup
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
#include "widgets/clock.hpp"
|
||||
#include "widgets/date.hpp"
|
||||
#include "widgets/tray.hpp"
|
||||
#include "widgets/volumeWidget.hpp"
|
||||
#include "widgets/webWidget.hpp"
|
||||
#include "widgets/workspaceIndicator.hpp"
|
||||
|
||||
class Bar : public Gtk::Window {
|
||||
public:
|
||||
Bar(GdkMonitor *monitor, HyprlandService &hyprlandService,
|
||||
TrayService &trayService, int monitorId);
|
||||
Bar(GdkMonitor *monitor, HyprlandService &hyprlandService, TrayService &trayService, int monitorId);
|
||||
|
||||
protected:
|
||||
Gtk::CenterBox main_box{};
|
||||
@@ -23,16 +23,18 @@ class Bar : public Gtk::Window {
|
||||
Gtk::Box right_box{Gtk::Orientation::HORIZONTAL};
|
||||
|
||||
private:
|
||||
int monitorId;
|
||||
|
||||
Clock clock;
|
||||
Date date;
|
||||
WebWidget homeAssistant{ICON_HOME, "Home Assistant",
|
||||
"https://home.rivercry.com"};
|
||||
TrayService &trayService;
|
||||
HyprlandService &hyprlandService;
|
||||
int monitorId;
|
||||
WebWidget homeAssistant{ICON_HOME, "Home Assistant", "https://home.rivercry.com"};
|
||||
|
||||
WorkspaceIndicator *workspaceIndicator = nullptr;
|
||||
TrayWidget *trayWidget = nullptr;
|
||||
class VolumeWidget *volumeWidget = nullptr;
|
||||
VolumeWidget *volumeWidget = nullptr;
|
||||
|
||||
TrayService &trayService;
|
||||
HyprlandService &hyprlandService;
|
||||
|
||||
void setup_ui();
|
||||
void setup_left_box();
|
||||
|
||||
18
include/components/todoEntry.hpp
Normal file
18
include/components/todoEntry.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "gtkmm/box.h"
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
class TodoEntry : public Gtk::Box {
|
||||
public:
|
||||
TodoEntry(int id, std::string text, sigc::signal<void(int)> signal_dismissed);
|
||||
~TodoEntry() override;
|
||||
|
||||
int get_id() const { return id; }
|
||||
private:
|
||||
int id;
|
||||
sigc::signal<void(int)> signal_dismissed;
|
||||
|
||||
void on_dismiss_clicked();
|
||||
};
|
||||
22
include/services/todo.hpp
Normal file
22
include/services/todo.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "components/todoEntry.hpp"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class TodoService {
|
||||
public:
|
||||
TodoService(sigc::signal<void()> refreshSignal);
|
||||
~TodoService();
|
||||
|
||||
std::map<int, TodoEntry *> getTodos();
|
||||
void init();
|
||||
void removeTodo(int id);
|
||||
TodoEntry *addTodo(std::string text, bool emitSignal = true);
|
||||
void updateTodo(int id, std::string text);
|
||||
|
||||
private:
|
||||
int nextId = 1;
|
||||
std::map<int, TodoEntry *> todos;
|
||||
sigc::signal<void()> refreshSignal;
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "components/popover.hpp"
|
||||
|
||||
class Todo : public Popover {
|
||||
public:
|
||||
Todo(std::string icon, std::string title);
|
||||
};
|
||||
19
include/widgets/todoPopover.hpp
Normal file
19
include/widgets/todoPopover.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include "components/popover.hpp"
|
||||
#include "services/todo.hpp"
|
||||
#include <string>
|
||||
|
||||
class TodoPopover : public Popover {
|
||||
|
||||
public:
|
||||
TodoPopover(std::string icon, std::string title);
|
||||
|
||||
void update();
|
||||
private:
|
||||
std::string name;
|
||||
TodoService* todoService = nullptr;
|
||||
Gtk::Box container;
|
||||
Gtk::Box inputArea;
|
||||
Gtk::Box* todoList = nullptr;
|
||||
};
|
||||
Reference in New Issue
Block a user