TGUI Forum

General Category => Feature requests => Topic started by: Kvaz1r on 04 September 2019, 17:15:16

Title: Clickable header cells for ListView.
Post by: Kvaz1r on 04 September 2019, 17:15:16
It would be great to have opportunity handle click on header cells. For example for sorting some data. 
Title: Re: Clickable header cells for ListView.
Post by: texus on 04 September 2019, 20:13:51
I'll look into adding a signal for a click on the header soon.
Title: Re: Clickable header cells for ListView.
Post by: texus on 07 September 2019, 11:36:36
I've added a HeaderClicked signal. Your callback function can have an int parameter which will contain the index of the clicked column.
Title: Re: Clickable header cells for ListView.
Post by: Kvaz1r on 07 September 2019, 12:32:20
Yes, it works perfect. Is there any way to change background color of column header on click?
I see that it possible to change text for them, so they are already separated and I think it would be good have opportunity work with columns headers as with usual widgets. 
Title: Re: Clickable header cells for ListView.
Post by: texus on 07 September 2019, 12:50:20
I currently don't have any plans for it. I implemented the clicking signal because I believe it is a necessity for sorting columns. Other things like different colors, showing a small arrow inside the column header or even supporting sorting in the widget itself are extras that I am at this moment not going to spend my time on. I would love to see these things supported too, but I can't do everything at the same time.

Btw, if you use ListBox or ComboBox widgets then you may want to download and rebuild TGUI again. Together with the change to ListView I also pushed another change online which had a bug that could lead to a crash when using ListBox or ComboBox. The issue has been fixed by now. It slipped through my linux test that I ran before making the code public, but luckily it was caught by my windows tests afterwards (which actually runs the exact same code as the passing linux test).
Title: Re: Clickable header cells for ListView.
Post by: Kvaz1r on 07 September 2019, 13:09:29
I currently don't have any plans for it. I implemented the clicking signal because I believe it is a necessity for sorting columns. Other things like different colors, showing a small arrow inside the column header or even supporting sorting in the widget itself are extras that I am at this moment not going to spend my time on. I would love to see these things supported too, but I can't do everything at the same time.
I understand, it's not really important things and there are enough ways around it. 

Btw, if you use ListBox or ComboBox widgets then you may want to download and rebuild TGUI again.

Yeah, thanks, I seen it.