Yesterday I published an article on new components with background and border gradients of colors, extending HBox, VBox and Box. These components were directly inspired by the GradientCanvas that I created a few month ago.
Directly inspired and even exactly the same… as only the parent class changed :roll: . So I wanted to refactor the code in order to share the 98% of common code. I have done this using include statements. This worked well and I tried to do more…
And the result of this is a set of container components that I call GradientComponents. All these components are just composed by the mandatory constructor and 3 includes :
- the imports that are necessary to build the gradients
- the styles that are used to configure the different gradients
- the "body", containing all functions and overrides.
I don’t know if the use of the include statement is considered as smart but it is very simple and seems to work well. It’s the first time I use it.
As a result, you will be able to download below a set of GradientComponent including:
- Box, Hbox, Vbox
- DividedBox, HDividedBox, VDividedBox
- Canvas (the famous one)
- Form, FormItem, FormHeading
- Panel
- Tile, TileList, ViewStack
- Accordion
- RichTextEditor, TextInput, TextArea
in a "gradient version" of the original Flex components.
I have quickly modified the GradientHBox Style Explorer to use some of these new GradientComponents. The result is not perfect and I will probably refine it later but the primary goal was just to test and to demonstrate the components with their new backgrounds and borders.
Here is the demo :
Licence:
This component is free for use, modification and distribution under the following condition: Just mention the name and the url of the author in a part of your product that is visible to the user (about section, documentation…)
Download
Version 2.3
Added the property positioning.
Version 2.1.2
Return to the version number of the last GradientCanvas
Fixed a bug when the component has only one borderColor
Version 1.0
First release based on the GradientCanvas v2.1.1
Downloaded a total of 7537 times
Have fun
Related posts
Comments are closed.