#3391 closed defect (fixed)
[PATCH] Lists are sorted when clicking on the first item
Reported by: | elexis | Owned by: | Itms |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 19 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
If you click 4 pixels below the header of a sortable OList, then the list will be sorted and the first item will be selected. But since you clicked below the header, it shouldn't sort - only select the first item.
The issue was introduced with the initial commit r16781 that implements sortable lists #2405 and is caused by adding those 4 pixels explicitly:
CPos leftTopCorner = m_CachedActualSize.TopLeft() + CPos(xpos, 4);
Setting that value to 0 solves the issue.
(Having greater or smaller column heights as defined in m_HeadingHeight(30.f)
doesn't change the bug)
You can easily reproduce the issue with the playerlist in the lobby. But also the visual replay menu #3258 will suffer from this flaw.
Attachments (2)
Change History (4)
by , 9 years ago
Attachment: | t3391_fix_sortable_list_column_header_v1.patch added |
---|
by , 9 years ago
Attachment: | t3391_fix_sortable_list_column_header_v2.patch added |
---|
comment:2 by , 9 years ago
Component: | Core engine → UI & Simulation |
---|---|
Keywords: | review removed |
Nice catch, thanks for fixing this bug :)
Added comments. Those 4 pixels were added because the column header text was drawn 4 pixels below the start of the list header. But that doesn't mean that we need to extend the area where clicks are registered, which is defined by
m_HeadingHeight(30.f)
, so removing those 4 pixels there is correct.