1
0
Fork 0
mirror of https://github.com/polybar/polybar.git synced 2025-02-24 15:58:22 -05:00
polybar/include/drawtypes/ramp.hpp

31 lines
672 B
C++
Raw Normal View History

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