[haiku-commits] Re: haiku: hrev50428 - src/apps/deskcalc

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: "haiku-commits@xxxxxxxxxxxxx" <haiku-commits@xxxxxxxxxxxxx>
  • Date: Wed, 20 Jul 2016 11:18:01 -0700

On Tue, Jul 19, 2016 at 10:41 PM, Humdinger <dmarc-noreply@xxxxxxxxxxxxx> wrote:

On 19 July 2016 at 23:38, looncraz <looncraz@xxxxxxxxxxx> wrote:
  void
  CalcView::_Colorize()
  {
-       fBaseColor = ui_color(B_PANEL_BACKGROUND_COLOR);
-
I fear you have likely prevented all live color updates from occurring.  You
may need to use a flag to prevent refreshing fBaseColor on _Colorize() only
if a color has been dropped in order to preserve live color updates.

Okay, I have committed a fix in hrev50438. See that commit for more details.

I added a fHasCustomBaseColor flag that gets set to true when you drop
a color, that way the live color updating won't override your custom
base color if you've set one.

Why should DeskCalc be special and use its own B_PANEL_BACKGROUND_COLOR?
IMO, that feature only makes sense in case DeskCalc is used as a
Replicant, to better fit into the user's Desktop background.

The custom base color is a feature that the program has had since
before it was part of Haiku. It's a little silly but I imagine there
are people out there who use it and it doesn't hurt (much).

I tried that with adding a conditional that is used elsewhere in the code [1]:

if (Parent() && (Parent()->Flags() & B_DRAW_ON_CHILDREN) == 0) {
/* update to the current system background color,
  if we aren't a replicant on the desktop */
fBaseColor = ui_color(B_PANEL_BACKGROUND_COLOR);
}

But that doesn't work for some reason...

I'm not sure why that didn't work.

Other related posts: