deine cousine 4. grades
This commit is contained in:
@@ -4,13 +4,14 @@
|
||||
#include <gtkmm.h>
|
||||
|
||||
#include "icons.hpp"
|
||||
#include "widgets/battery.hpp"
|
||||
#include "widgets/clock.hpp"
|
||||
#include "widgets/controlCenter.hpp"
|
||||
#include "widgets/date.hpp"
|
||||
#include "widgets/tray.hpp"
|
||||
#include "widgets/volumeWidget.hpp"
|
||||
#include "widgets/webWidget.hpp"
|
||||
#include "widgets/workspaceIndicator.hpp"
|
||||
#include "widgets/controlCenter.hpp"
|
||||
|
||||
class Bar : public Gtk::Window {
|
||||
public:
|
||||
@@ -32,6 +33,7 @@ class Bar : public Gtk::Window {
|
||||
WorkspaceIndicator *workspaceIndicator = nullptr;
|
||||
TrayWidget *trayWidget = nullptr;
|
||||
VolumeWidget *volumeWidget = nullptr;
|
||||
BatteryWidget *batteryWidget = nullptr;
|
||||
|
||||
|
||||
void setup_ui();
|
||||
|
||||
26
include/widgets/battery.hpp
Normal file
26
include/widgets/battery.hpp
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <filesystem>
|
||||
#include <gtkmm/box.h>
|
||||
#include <gtkmm/label.h>
|
||||
#include <sigc++/connection.h>
|
||||
|
||||
class BatteryWidget : public Gtk::Box {
|
||||
public:
|
||||
BatteryWidget();
|
||||
~BatteryWidget();
|
||||
|
||||
private:
|
||||
Gtk::Label iconLabel;
|
||||
Gtk::Label label;
|
||||
sigc::connection timeoutConn;
|
||||
std::filesystem::path batteryPath;
|
||||
std::string currentStateClass;
|
||||
|
||||
void update();
|
||||
bool on_timeout();
|
||||
void find_battery_path();
|
||||
void set_state_class(const std::string &stateClass);
|
||||
std::string build_icon(int capacity, bool hasBattery, bool charging, bool full) const;
|
||||
std::string build_text(int capacity, const std::string &status, bool hasBattery, bool charging, bool full) const;
|
||||
};
|
||||
Reference in New Issue
Block a user