[haiku-development] Re: RoundRect ButtonFrame

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 24 Mar 2012 08:02:32 +0100

Am 24.03.2012 01:36, schrieb John Scipione:
On Fri, Mar 23, 2012 at 1:31 PM, pulkomandy<pulkomandy@xxxxxxxxxxxxx>  wrote:
IIRC, the plan for BControlLook was to make it replaceable like
decorators. A rounded version might be a good way to experiment with
that. I'm not sure I'd make it a default, but maybe some people that
keep saying the UI looks "dated" would like it.

Interesting, I wasn't aware of this plan, I thought ControlLook was
just a convenient place to store a bunch of control draw code.

You are correct, the main intention of BControlLook was to separate the drawing code from the controls and make individual functions reusable across controls. Like drawing a label within a rectangle with certain alignment, truncation and making sure it has contrast against the background color... or drawing the button background gradient. :-) That the implementation becomes exchangeable is just a more or less welcome side effect.

Well,
I'd rather not concentrate my efforts on flushing out a theming system
right now.

Perfectly fine by me. :-)

I see some graphic improvements are possible, too :
  * The shadow under 'probe device' is not rounded, which looks bad

I vacillated on whether or not to round the default button indicator
or not. I can round the default button indicator corners in the case
that the button has rounded corners.

It should be rounded, that was my first thought when seeing the screen shot you posted.

Does StrokeRoundRect() stroke a regular rectangle if the stroke radius
is<=0? That would make implementing this a bit cleaner.

It should handle that case, just try it and if not, it should be fixed in the app_server.

  * To me, these buttons look either very flat or like they are already
pressed. Maybe it's a problem with the border color, or ?

Ah, yes, this is an issue that I've now fixed, it is a little
complicated to explain why it was this way. Basically, I was drawing
the corners in the button background method instead of the button
frame method because I had access to certain variables there. As a
consequence of working in the button background method I didn't have
access to the background color (the color outside the button) and so
the corners didn't match the top and right edges. So, I made the top
and right edges the base color instead. This fixed the problem in that
it made the colors match but also created a softer look to those
edges. Since yesterday I've done a fairly sizable refactoring of the
code and consequently put the drawing of the corner edge, frame, and
bevel in the button frame method. Since I have access to the
background color in the frame method I brought back the harder look
again. It is amazing how 1px tall differences can change the look so
drastically.

Well, there may be a problem with that. The intention was that the "frame" only includes the dark border and anything outside of that. While the background includes the very slight inner bevel. You can see the problem already in your screen shot with the scroll bars. Those look different now (missing the bevel). I haven't thought about what the best solution would be.

Best regards,
-Stephan

Other related posts: