Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort column highlighting should only be done when there is a header #347

Closed
afalkenhahn opened this issue Jul 14, 2021 · 9 comments
Closed

Comments

@afalkenhahn
Copy link

Take a look at the attached example. It sets column 2 as the sort column. The listview doesn't have any header. Still, it highlights column 2 as the sort column. I think this should only be done when there is a header because otherwise it looks weird.
main.txt

@tboeckel
Copy link
Contributor

The next nightly build will highlight columns with the SORTABLE attribute set only.

@mrupp12bit
Copy link

I would like to seconds sofwarefailure's request, that the sort column should only be highlighted if column-headers are set to be visible. Is that also already fixed in the nightly build?

@tboeckel
Copy link
Contributor

I would like to seconds sofwarefailure's request, that the sort column should only be highlighted if column-headers are set to be visible. Is that also already fixed in the nightly build?

My solution is slightly different, but the result should be the same. The highlighting will be applied for column with the SORTABLE attribute set, no matter whether there is a column title or not. If an application sets SORTABLE without MUIA_List_Title, then this is the fault of the application.

@mrupp12bit
Copy link

mrupp12bit commented Jul 16, 2021

If an application sets SORTABLE without MUIA_List_Title, then this is the fault of the application.

Not necessarily. Have a look at this:
OS4-SortColumn-ListBox
This is a listview with only one column and without any headers but the sortable flag set. The equivalent on Windows (sorry for the comparison ;-) ) would be a ListBox with sorted flag set. Meaning when inserting an item, it is automatically inserted at the correct position.
But this looks somewhat strange, imho. Wouldn't you agree?

But that was just an example for theory. I am currently working on a SonosController for Amiga using Hollywood. Here I have 2 columns, 1st for the icons, 2nd for the room names and I want it to be sorted always by room name (I use 2 columns on purpose, when using only 1, the 2nd line of text would be placed below the icon which doesn't look too good).
OS4-SortColumn
Again: it looks strange, having that column highlighted...

Don't get me wrong: the highlighting of the sorted column is a great feature and I like it a lot. But it makes only sense if the user has something to click (meaning: headers) to change the sorting, imho.

Cheers,
Michael

@tboeckel
Copy link
Contributor

The SORTABLE attribute makes absolutely no sense when you don't have a list title. SORTABLE just defines that a column's sort order can be changed by clicking its title button. So if you use SORTABLE without a list title then it is used wrong, because it cannot offer you the feature it implements.

@mrupp12bit
Copy link

OK, thanks for clarifying this.
Could you point me to the correct implementation for a listview that is sorted by default without the user being able to change the sort order, please? Like mentioned in my examples above...

@tboeckel
Copy link
Contributor

Just don't set SORTABLE and do set ORDER to your preferred sort order, either ASC (default) or DESC. That's all. There is not as much magic as you might expect here. If you don't want the first column to be sorted you need to set MUIA_List_SortColumn to the desired column as well. The string supplied to MUIA_List_Format cannot transfer this information, it can only define how a column is sorted IF it is the current sort column.

@afalkenhahn
Copy link
Author

Just don't set SORTABLE and do set ORDER to your preferred sort order

The problem is that this will crash on OS4. On a headerless listview, leaving out SORTABLE but setting ORDER will lead to a crash. See here: #348 Adding SORTABLE fixes the crash but of course SORTABLE should only be set when there's a header. Still, setting SORTABLE can be used as a workaround to prevent that crash which is why RapaGUI currently sets SORTABLE even if there is no header. Leaving out SORTABLE on a headerless listview will cause lots of trouble when using ORDER! Once again, see here: #348

@mrupp12bit
Copy link

@tboeckel Thanks for clarifying how this is supposed to be done.

@tboeckel tboeckel added this to the MUI 5.0-2021R1 milestone Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants