void Top5ChosenScreen::draw(unsigned char *buf, unsigned width, unsigned height)
{
scores_changed.reset_flag();
- fill_background(buf, width, height);
+ fill_background(buf, "top5chosenscreen", width, height);
set_screen_size(width, height);
// fetch the top 5 chosen songs
unsigned row = 1, y = 140;
for (std::vector<TopChosen>::const_iterator i = scores.begin(); i != scores.end(); ++i) {
+ std::string suffix;
+ if (row % 2 == 1) {
+ suffix = ".odd";
+ } else {
+ suffix = ".even";
+ }
+
char str[16];
- std::string theme_element = "data";
- std::string heading_theme_element = "rowheading";
+ std::string heading_theme_element = "top5chosensongs.rowheading" + suffix;
+ std::string songname_theme_element = "top5chosensongs.songname" + suffix;
+ std::string frequency_theme_element = "top5chosensongs.frequency" + suffix;
// print new entries in red
if (seen_topchosen.count(*i) == 0 && seen_topchosen.size() > 0) {
- theme_element = "freshdata";
- heading_theme_element = "freshrowheading";
+ heading_theme_element = "top5chosensongs.freshrowheading" + suffix;
+ songname_theme_element = "top5chosensongs.freshsongname" + suffix;
+ frequency_theme_element = "top5chosensongs.freshfrequency" + suffix;
}
std::sprintf(str, "%u", row++);
unsigned width = my_draw_text(str, NULL, 24.0, heading_theme_element);
my_draw_text(str, buf, 24.0, heading_theme_element, RANK_X - width/2, y);
- if (my_draw_text(i->title, NULL, 24.0, theme_element) > SONG_MAX_WIDTH) {
- my_draw_text(i->shorttitle, buf, 24.0, theme_element, SONG_X, y);
+ if (my_draw_text(i->title, NULL, 24.0, songname_theme_element) > SONG_MAX_WIDTH) {
+ my_draw_text(i->shorttitle, buf, 24.0, songname_theme_element, SONG_X, y);
} else {
- my_draw_text(i->title, buf, 24.0, theme_element, SONG_X, y);
+ my_draw_text(i->title, buf, 24.0, songname_theme_element, SONG_X, y);
}
std::sprintf(str, "%u", i->frequency);
- width = my_draw_text(str, NULL, 24.0, theme_element);
- my_draw_text(str, buf, 24.0, theme_element, FREQUENCY_X - width/2, y);
+ width = my_draw_text(str, NULL, 24.0, frequency_theme_element);
+ my_draw_text(str, buf, 24.0, frequency_theme_element, FREQUENCY_X - width/2, y);
y += 40;
}