#2405 closed enhancement (fixed)
[PATCH] Allow OList headings to be clickable and add sorting abillity
Reported by: | scythetwirler | Owned by: | Vladislav Belov |
---|---|---|---|
Priority: | Should Have | Milestone: | Alpha 19 |
Component: | UI & Simulation | Keywords: | patch |
Cc: | Patch: |
Description
OList headings should be clickable like buttons so that implementing sorting on OLists will be possible in a user-friendly manner.
Attachments (14)
Change History (31)
comment:1 by , 10 years ago
Milestone: | Alpha 16 → Backlog |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Store both what entry and what column was selected. For what was selected just use an index.
comment:4 by , 9 years ago
Keywords: | review patch added |
---|---|
Summary: | Allow OList headings to be clickable. → [PATCH] Allow OList headings to be clickable. |
by , 9 years ago
Attachment: | COList_cpp_add_event_header_selection.patch added |
---|
by , 9 years ago
Attachment: | lobby_game_list_sorting_without_arrows.patch added |
---|
Sort by columnt, if click on heading
by , 9 years ago
Attachment: | colist_handler_lobby_sortable_game_list.patch added |
---|
by , 9 years ago
Attachment: | colist_handler_lobby_sortable_game_and_player_list.patch added |
---|
comment:5 by , 9 years ago
About the last patch:
-Playerlist now sortable too -Added comment to COList.cpp -Sorts gamelist by mapsize according to actual mapsize, not to translated string. -Some simplifications.
Todo if time permits: (1) Add an arrow icon to the column header as in #3278 (2) The stuff in updatePlayerListOrderSelection and updateGameListOrderSelection could be done in c++ (so that its done only once and we dont need to repeat identical code in JS).
The patch works for both a18 and svn. You should test it in a18, since there are multiple games and players online.
The patch should be combined with #3244.
by , 9 years ago
Attachment: | colist_handler_lobby_sortable_game_player_list_with_arrow.zip added |
---|
by , 9 years ago
Attachment: | Cost_js_fix_population_cost_and_bonus_v2.patch added |
---|
by , 9 years ago
Attachment: | colist_handler_lobby_sortable_game_and_player_list_with_arrows_v2.patch added |
---|
comment:6 by , 9 years ago
Could you revert the space-tab changes? It makes the patch hard to review and for XML files, the only rule is to be consistent in the file (see Coding_Conventions#XML).
The JS sorting functions can probably be done a bit nicer. You know that object.attr is the same as objattr. So it should at least be possible to catch the name, mapSize and mapType in one case
The rest looks fine to me.
by , 9 years ago
Attachment: | colist_handler_lobby_sortable_game_and_player_list_with_arrows_v3.patch added |
---|
comment:7 by , 9 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
Summary: | [PATCH] Allow OList headings to be clickable. → [PATCH] Allow OList headings to be clickable and add sorting abillity |
follow-up: 9 comment:8 by , 9 years ago
You should also modify the RelaxNG templates (gui.rnc and gui.rng) as the XML format has been changed.
The position of the arrows is also a bit strange IMO, they're closer to the next column header than to the header they modify. I would try to put them before on the left side of the column header, and use a circle or square when that column isn't the one used for sorting (instead of just hiding the arrow).
comment:9 by , 9 years ago
Replying to sanderd17:
I would try to put them before on the left side of the column header
If we go with an arrow that should be to the right of the column heading (as it is for every other gui I've encountered).
comment:10 by , 9 years ago
Having a "not-sorted" icon would help with determining for which column the arrow is valid.
Next to that, most GUIs that do sorting also have column separators (different background colours, or small lines). With a column separator, the value of whitespace as a separator is less important.
Since whitespace is currently our only separator, the icon should be as close to the text as possible (unless you add a line).
by , 9 years ago
Attachment: | arrow-down.png added |
---|
by , 9 years ago
Attachment: | arrow-up.png added |
---|
by , 9 years ago
Attachment: | arrows-up-down.png added |
---|
by , 9 years ago
Attachment: | colist_handler_lobby_sortable_game_and_player_list_with_arrows_v4.patch added |
---|
comment:11 by , 9 years ago
I still get Relax NG error reports when loading the lobby.xml
Also, that dropup sprite is no longer needed I suppose?
by , 9 years ago
comment:13 by , 9 years ago
Keywords: | review removed |
---|---|
Milestone: | Backlog → Alpha 19 |
Thanks for your work. Your patch had some annoying windows line endings for the xml and js files, but I removed those manually.
Apart from that, it was a nice patch.
I have realized feature from #2405. But there is very interesting moment of naming: What we selected: heading, columnt or def? Now I just set "selected_def" (olist attribute) to def id, which was selected.