MostafaElAyoubi / Data-shapes

code for revit, dynamo
50 stars 12 forks source link

MultiInputForm++ ListView: Broken pattern in background colour #14

Closed andydandy74 closed 7 years ago

andydandy74 commented 7 years ago

Hi Mostafa, I just cam across a ListView where some adjacent rows had the same background colour. Haven't investigated yet but will post more info if I encounter it in other contexts as well. backgroundcolorlistviewbug

MostafaElAyoubi commented 7 years ago

Hi Adreas, I couldn't manage to reproduce this issue. Please let me know if you can provide a dummy example , I'd like to look Into it :)

andydandy74 commented 7 years ago

Okay, I'll try to create a minimal reproducible case and post it here.

andydandy74 commented 7 years ago

@MostafaElAyoubi - I came across this today again by pure chance. Here's a simple case that I can consistently reproduce on my machine using the latest code on the repo: https://www.dropbox.com/s/s7mofhv8j9m6l82/DataShapesListViewIssue.ZIP?dl=0 Let me know once you have downloaded the file so I can delete it.

MostafaElAyoubi commented 7 years ago

Great thanks, I downloaded the files

MostafaElAyoubi commented 7 years ago

@andydandy74 ok that was very valuable info :) It turns out I was using two different sorting methods: the method built in the ListView class and the default python sort() method. Both seem to not give the same result, which in some cases messed the color pattern. I solved it by sorting the items once and for all with the built in python method. I also seized the opportunity to make the sorting optional. I'm updating the package right now.

andydandy74 commented 7 years ago

Cool. I can think of a couple of cases where disabling sorting might come in handy ( e.g. Phases).