#pragma once #include #include #include #include "drawtypes/icon.hpp" class Builder; namespace drawtypes { class Bar { protected: std::unique_ptr builder; std::vector colors; bool gradient = false; unsigned int width; std::string format; std::unique_ptr fill; std::unique_ptr empty; std::unique_ptr indicator; public: Bar(int width, std::string fmt, bool lazy_builder_closing = true); Bar(int width, bool lazy_builder_closing = true) : Bar(width, "", lazy_builder_closing){} void set_fill(std::unique_ptr &&icon); void set_empty(std::unique_ptr &&icon); void set_indicator(std::unique_ptr &&icon); void set_gradient(bool mode); void set_colors(std::vector &&colors); std::string get_output(float percentage, bool floor_percentage = false); }; std::unique_ptr get_config_bar(std::string config_path, std::string bar_name = "bar", bool lazy_builder_closing = true); }