Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#4254 closed defect (fixed)

[PATCH] GUI List should focus selected element on selectionchange

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 22
Component: UI & Simulation Keywords: patch
Cc: Patch:


If one watches a replay from the replay menu and returns to that screen, the previously selected element will be selected again in the replay list. However the element isn't focused, so the user will have to scroll to find the selection.

Attachments (1)

focus_on_selected_gui_list_element_v1.patch (551 bytes ) - added by elexis 6 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by wraitii, 6 years ago

Edit: nevermind, segfault. Changing to "if (!scrollbar
selected >= (int)m_ItemsYPositions.size())" the check above fixes it, not sure if it's a good idea.
Last edited 6 years ago by wraitii (previous) (diff)

comment:2 by elexis, 6 years ago

Keywords: review removed

That's what I thought, but nope:

Thread 1 "pyrogenesis" received signal SIGSEGV, Segmentation fault.
0x00000000008864e5 in CList::UpdateAutoScroll (this=this@entry=0x1cca7c0) at ../../../source/gui/CList.cpp:500
500		if (m_ItemsYPositions[selected] < scroll)

which occurs in the gamesetup when something out of bounds is selected.

comment:3 by elexis, 6 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 18935:

Scroll to the selected element after the selection changes. Fixes #4254, refs #3742.

comment:4 by elexis, 5 years ago

In 20958:

Implement an auto-scroll setting for GUI lists.

Patch By: fpre / ffffffff
Fixes #4987, refs #4254

This allows the replay menu and lobby to focus the selected element if, but only if it is expected by the user.
Replaces rP18935 which scrolled the selected player into view every single time a new playerlist was received by the lobby server.

Note: See TracTickets for help on using tickets.