"Labels" widget

This commit is contained in:
furrtek 2017-02-12 07:23:31 +00:00
parent 0102a34286
commit d12cd0d8af
11 changed files with 52 additions and 74 deletions

View file

@ -352,27 +352,26 @@ void Text::paint(Painter& painter) {
/* Labels ****************************************************************/
Labels::Labels(
std::vector<Label> * labels
std::initializer_list<Label> labels
) : labels_ { labels }
{
}
void Labels::set_labels(std::vector<Label> * const labels) {
void Labels::set_labels(std::initializer_list<Label> labels) {
labels_ = labels;
set_dirty();
}
void Labels::paint(Painter& painter) {
/*const auto rect = screen_rect();
const auto s = style();
painter.fill_rectangle(rect, s.background);
painter.draw_string(
rect.location(),
s,
text
);*/
for (auto &label : labels_) {
painter.draw_string(
label.pos + screen_pos(),
style().font,
label.color,
style().background,
label.text
);
}
}
/* BigFrequency **********************************************************/