[interfacekit] Drawing IDEA

Hello you hard working guys! :-)

    Listen, a fellow of us, Simon Taylor posted a message on openbeos mail
list about a new visual design for R1. I FULLY sustain his POV. So, I looked
at the images he showed us and decided myself to make a decorator based on
the GUI concept made by our CDT leader Stuart.

    While studying that concept, I observed it used gradients for almost all
the components. I do like that, gradient fills look nice. So, I began to
wonder, can BeOS API do gradients?
    Well... I looked into BeBook and, I was a bit surprised to find out that
BeAPI does not support gradients! Actually the Drawing API is very old and
lacks A LOT of features - that's why Marc said that we shall have a major
D.API redesign for R2.

    I want to make that decorator, and I REALLY want to see a new default
look in our new OS. That does not mean only a new Default Decorator, BUT a
new BButton, BCheckBox, BScrollBar, etc. look, also! And, in Stuart's GUI
*almost* all widgets use gradients.

    So, I thought we should add gradients as a supported feature of OBOS
API; because new widgets need them. Don't you?

    Let's see the method.
*****
Code:
    New methods:

    void SetGradient( rgb_color c1, rgb_color c2,
                orientation posture = B_HORIZONTAL );
                B_VERTICAL );

 void SetGradient( rgb_color c1, rgb_color c2, rgb_color c3, rgb_color c4,
                orientation posture = B_CORNER );
                B_MIDDLE );
====
    Fill/StrokeRoundRect( r, 2, 2, B_GRADIENT );
*****

The first method uses a 2 color gradient both horizontally and vertically

The second method a 4 color gradient witch in case of
    B_CORNER begins form corners - corners that not necessarily are in the
form to be rendered using this gradient - they are the min/max values on x/y
coords calculated form primitive's points.
    B_MIDDLE begins from the middle of the distance between min/max of x/y
coords calculated form primitive's points.

Some of you might think that this gradient painting is quite expensive,
well... it's not! The same thing is made when using regular patterns.


So... what do you think about this method!?!?!?


Adi.




Other related posts: