[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: Thu, 22 Oct 2015 13:48:59 -0500

On 10/22/2015 13:30, Stephan Aßmus wrote:


Wow, I completely remembered that wrong. I certainly planned to implement inheritence, but I never did. What I said applies to what I wanted to do, not what is already implemented.

Sorry for the noise!


Happens to all of us :p

Anyway, I decided to start treating color_which as a first class citizen everywhere else, not sure why I didn't think of doing that here. I added Set*Color(color_which) to CharacterStyle/Data and the view now looks for the color_which first and uses it preferentially (any color setting operation will override the color_which, as in BView).

In one fell swoop the standard text colors now respond to system color changes. Still have to find a way to set it after-the-fact, but it seems the original data is not being referenced, so that TextDocument's default character style is just a copy. I'm going to have to try this away from HaikuDepot to get to the bottom of it, so it seems (I have verified that tons of CharacterStyleDatas are being created and destroyed, though, with over a hundred existing at one point). They do all get destroyed when the app closes, so there are no leaks ;-)

For now, I'd think using a BTextView for the list and the changes I'm currently finishing up for TextDocument should suffice as the application now perfectly fits into the system regardless of user color choices, which is my main goal...

--The loon

Other related posts: