mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-12 03:34:58 -04:00
RecentEntriesView: Extract duplicate focus+selection style code.
This commit is contained in:
parent
1e0d452f57
commit
c6f7d7f844
4 changed files with 9 additions and 18 deletions
|
@ -80,11 +80,8 @@ void RecentEntriesView<ERTRecentEntries>::draw(
|
|||
const Entry& entry,
|
||||
const Rect& target_rect,
|
||||
Painter& painter,
|
||||
const Style& style,
|
||||
const bool is_selected
|
||||
const Style& style
|
||||
) {
|
||||
const auto& draw_style = is_selected ? style.invert() : style;
|
||||
|
||||
std::string line = ert::format::id(entry.id) + " " + ert::format::commodity_type(entry.commodity_type) + " " + ert::format::consumption(entry.last_consumption);
|
||||
|
||||
if( entry.received_count > 999 ) {
|
||||
|
@ -94,7 +91,7 @@ void RecentEntriesView<ERTRecentEntries>::draw(
|
|||
}
|
||||
|
||||
line.resize(target_rect.width() / 8, ' ');
|
||||
painter.draw_string(target_rect.pos, draw_style, line);
|
||||
painter.draw_string(target_rect.pos, style, line);
|
||||
}
|
||||
|
||||
ERTAppView::ERTAppView(NavigationView&) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue