2016-05-31 03:58:58 +00:00
|
|
|
#pragma once
|
2016-05-19 14:41:06 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <memory>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "drawtypes/icon.hpp"
|
|
|
|
|
|
|
|
class Builder;
|
|
|
|
|
|
|
|
namespace drawtypes
|
|
|
|
{
|
|
|
|
class Bar
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
std::unique_ptr<Builder> builder;
|
|
|
|
std::vector<std::string> colors;
|
2016-05-31 03:58:58 +00:00
|
|
|
bool gradient = false;
|
2016-05-19 14:41:06 +00:00
|
|
|
unsigned int width;
|
|
|
|
std::string format;
|
|
|
|
|
|
|
|
std::unique_ptr<Icon> fill;
|
|
|
|
std::unique_ptr<Icon> empty;
|
|
|
|
std::unique_ptr<Icon> indicator;
|
|
|
|
|
|
|
|
public:
|
2016-06-21 01:59:43 +00:00
|
|
|
Bar(int width, std::string fmt, bool lazy_builder_closing = true);
|
2016-05-19 14:41:06 +00:00
|
|
|
Bar(int width, bool lazy_builder_closing = true)
|
|
|
|
: Bar(width, "<fill><indicator><empty>", lazy_builder_closing){}
|
|
|
|
|
|
|
|
void set_fill(std::unique_ptr<Icon> &&icon);
|
|
|
|
void set_empty(std::unique_ptr<Icon> &&icon);
|
|
|
|
void set_indicator(std::unique_ptr<Icon> &&icon);
|
|
|
|
|
|
|
|
void set_gradient(bool mode);
|
|
|
|
void set_colors(std::vector<std::string> &&colors);
|
|
|
|
|
|
|
|
std::string get_output(float percentage, bool floor_percentage = false);
|
|
|
|
};
|
|
|
|
|
2016-06-21 01:59:43 +00:00
|
|
|
std::unique_ptr<Bar> get_config_bar(std::string config_path, std::string bar_name = "bar", bool lazy_builder_closing = true);
|
2016-05-19 14:41:06 +00:00
|
|
|
}
|