mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-02 09:35:20 -05: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(
|
RecentEntriesTable(
|
||||||
Entries& recent)
|
Entries& recent)
|
||||||
: recent{recent} {
|
: recent{recent} {
|
||||||
set_focusable(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void paint(Painter& painter) override {
|
void paint(Painter& painter) override {
|
||||||
@ -138,6 +137,8 @@ class RecentEntriesTable : public Widget {
|
|||||||
Rect target_rect{r.location(), {r.width(), s.font.line_height()}};
|
Rect target_rect{r.location(), {r.width(), s.font.line_height()}};
|
||||||
const size_t visible_item_count = r.height() / 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);
|
auto selected = find(recent, selected_key);
|
||||||
if (selected == std::end(recent)) {
|
if (selected == std::end(recent)) {
|
||||||
selected = std::begin(recent);
|
selected = std::begin(recent);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user