mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2024-12-13 03:34:35 +00:00
* Disallow Focus positioning to Empty lists #1097 * Disallow Focus positioning to Empty lists #1097
This commit is contained in:
parent
e5728b3501
commit
4f768140c1
@ -128,7 +128,6 @@ class RecentEntriesTable : public Widget {
|
||||
RecentEntriesTable(
|
||||
Entries& recent)
|
||||
: recent{recent} {
|
||||
set_focusable(true);
|
||||
}
|
||||
|
||||
void paint(Painter& painter) override {
|
||||
@ -138,6 +137,8 @@ class RecentEntriesTable : public Widget {
|
||||
Rect target_rect{r.location(), {r.width(), s.font.line_height()}};
|
||||
const size_t visible_item_count = r.height() / s.font.line_height();
|
||||
|
||||
set_focusable(!recent.empty());
|
||||
|
||||
auto selected = find(recent, selected_key);
|
||||
if (selected == std::end(recent)) {
|
||||
selected = std::begin(recent);
|
||||
|
Loading…
Reference in New Issue
Block a user