Improve hold browser keyboard behavior
Build and Test / build-linux (push) Has been cancelled
Build and Test / build-wayland (push) Has been cancelled
Build and Test / build-macos (push) Has been cancelled
Build and Test / build-windows (push) Has been cancelled

* unselected Up now selects the last *visible* item
* fix top selection warping regression
This commit is contained in:
Matthias Melcher
2026-05-19 17:05:07 +02:00
parent 08b6c9e6c0
commit 8cdaec8976
+8 -3
View File
@@ -731,11 +731,16 @@ int Fl_Browser_::handle(int event) {
}
return 1;
case FL_Up:
l = nullptr; // Preselected item is useless here
if (selection_)
// find the item before the selected one
l = item_prev(selection_);
if (!l)
l = item_last();
else {
// find the last visible item
l = find_item(y()+h()-incr_height()/2);
if (!l)
// if that fails, start from the end of the list
l = item_last();
}
while (l) {
if (item_height(l)>0) {
select_only(l, when() & ~FL_WHEN_NOT_CHANGED);