2016-05-30 23:58:58 -04:00
|
|
|
#pragma once
|
2016-05-19 10:41:06 -04:00
|
|
|
|
2016-06-14 23:32:35 -04:00
|
|
|
#include "common.hpp"
|
|
|
|
#include "components/config.hpp"
|
|
|
|
#include "drawtypes/label.hpp"
|
|
|
|
#include "utils/mixins.hpp"
|
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
namespace drawtypes {
|
|
|
|
class ramp : public non_copyable_mixin<ramp> {
|
|
|
|
public:
|
|
|
|
explicit ramp() = default;
|
2018-12-23 16:59:10 -05:00
|
|
|
explicit ramp(vector<label_t>&& icons) : m_icons(forward<decltype(icons)>(icons)) {}
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2018-12-23 16:59:10 -05:00
|
|
|
void add(label_t&& icon);
|
|
|
|
label_t get(size_t index);
|
|
|
|
label_t get_by_percentage(float percentage);
|
2020-10-09 08:05:50 -04:00
|
|
|
label_t get_by_percentage_with_borders(float percentage);
|
2016-11-02 15:22:45 -04:00
|
|
|
operator bool();
|
2016-06-14 23:32:35 -04:00
|
|
|
|
|
|
|
protected:
|
2018-12-23 16:59:10 -05:00
|
|
|
vector<label_t> m_icons;
|
2016-05-19 10:41:06 -04:00
|
|
|
};
|
|
|
|
|
2016-10-25 01:10:03 -04:00
|
|
|
using ramp_t = shared_ptr<ramp>;
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2016-11-25 07:55:15 -05:00
|
|
|
ramp_t load_ramp(const config& conf, const string& section, string name, bool required = true);
|
2016-05-19 10:41:06 -04:00
|
|
|
}
|
2016-06-14 23:32:35 -04:00
|
|
|
|
2016-11-19 00:22:44 -05:00
|
|
|
POLYBAR_NS_END
|