[haiku-bugs] Re: [Haiku] #7921: Control Look lost in child view

  • From: "stippi" <trac@xxxxxxxxxxxx>
  • Date: Wed, 17 Aug 2011 08:01:30 -0000

#7921: Control Look lost in child view
----------------------------------+-----------------------
   Reporter:  Pete                |      Owner:  axeld
       Type:  bug                 |     Status:  new
   Priority:  normal              |  Milestone:  R1
  Component:  Kits/Interface Kit  |    Version:  R1/alpha3
 Resolution:                      |   Keywords:
 Blocked By:                      |   Blocking:
Has a Patch:  0                   |   Platform:  All
----------------------------------+-----------------------

Comment (by stippi):

 First of all: Yes, I am fully aware that the BControl behavior in Haiku
 deviates from the BeOS behavior. I have made this decision consciously,
 and one of the simple reasons is that it wasn't consistent in BeOS anyway.
 Some controls would inherit the background color of their parent, some
 would not. In Haiku, I am not 100% sure that all controls have this
 implemented consistently, but the intention is that all controls inherit
 the background color of their parents. Why is this so? Because usually
 that is what you want, and the API should cater for the common case so
 that app developers usually have to write less code.

 For the odd situation in which you want a BButton or any other control to
 have another background, simply set it via SetLowColor(). That is really
 all you have to do. The background is, for obvious reasons, inherited from
 the parent in AttachedToWindow(). This was also the case on BeOS for the
 controls that behaved that way. If you want to set a background at
 construction time, you simply override AttachedToWindow(), call the super
 class version first, then set your own background color. Just what you had
 to do on BeOS.

 As for the fact that a BButton, when drawn with BControlLook against a
 white background does not show the edged frame... such is life. I would
 recommend marking the bug as invalid.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/7921#comment:9>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: