[haiku-commits] Re: BRANCH looncraz-github.setviewuicolor [7f350151385b] in src: apps/haikudepot/ui apps/haikudepot/ui_generic kits/interface

  • From: looncraz <looncraz@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 21 Oct 2015 09:08:07 -0500

On 10/21/2015 01:31, Axel Dörfler wrote:

Am 21/10/2015 um 00:47 schrieb looncraz-github.setviewuicolor:
7f350151385b: HaikuDepot colors

Not sure why HaikuDepot uses such a convoluted text handling system,
but using BTextView worked perfectly well for the summary view.

When you don't understand it, don't you think it would be a good idea to ask before removing it?
I can only assure you that this change won't be accepted to master, at least :-)

Bye,
Axel.




I should have been more clear - I know why it's used everywhere else, but not here :p The summary view in the list won't be using bullet points or any special formatting not supported by BTextView, and BTextView, contrary to the custom text handling, supports custom colors set by the app.

I actually spent much more time trying to add that capability to the text system before coming back to this simple solution.

I went so far as to set flags for each span to determine if it was using the default foreground color, but I could still never get it to work as expected so I dumped the changes. This required creating non-const methods in the custom List that's used and about six or seven classes receiving a SetDefaultForegroundColor() method... the text handling system in HaikuDepot just seems to be an overly complicated mess for what it is trying achieve that hampers having the text in the list actually use list colors or follow system standards... and considering it is something that should be a shining example of how to write a Haiku application, that just seems very out of place when built-in facilities are just as capable in a much more simple manner.

That said, my changes to a BTextView for the summary view makes no visible effect until you use custom list or panel text colors. Word wrapping and everything else works as expected. And short descriptions are certainly no place for any fancy formatting that BTextView can't support.

If I had the time, I'd completely get rid of the text system it uses just to show it could be done better without it. while maintaining proper system integration behavior.

--The loon

Other related posts: