Inherited Styles in Sub Components

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Inherited Styles in Sub Components

Ripgiblet
SUMMARY:
Should Styles of subcomponents inherit from their parent components in Apache pivot?
If not why not? and can we do this in the future?

DETAILS:
This is maybe a problem, or maybe a feature request.

Currently my styles don't seem to be inherited to SubComponents, so I have to set the styles manually for all sub components... Is this the way it is supposed to work?

If this is the case I would recommend adding an inherited style model like HTML etc. So all styles are inherited from parent objects, unless they are overridden.

regards,
Mark.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Inherited Styles in Sub Components

Sandro Martini
Hi Mark,
styles in Pivot are different than css styles in HTML, this is feature
discussed since the beginning of Pivot :-) .
But the visual appearance of components is handled by the Skin (where
for example there is a pre-defined color palette), and any Component
has a related skin visual counterpart ... there are some global
settings (color palette, fonts, etc) in the skin but components draw
themselves.

I agree that we could improve this, so be free to add a JIRA as
Improvement, or write/attach some test/idea/sample code.


Some old discussion here:
http://apache-pivot-users.399431.n3.nabble.com/can-we-use-css-style-sheet-in-pivot-td3415299.html

Maybe using inline styles could help in your case now, some info here
for example:
http://apache-pivot-users.399431.n3.nabble.com/Apache-pivot-color-scheme-td4022780.html


Tell us for more info.

Bye,
Sandro


2014/1/22 Ripgiblet <[hidden email]>:

> SUMMARY:
> Should Styles of subcomponents inherit from their parent components in
> Apache pivot?
> If not why not? and can we do this in the future?
>
> DETAILS:
> This is maybe a problem, or maybe a feature request.
>
> Currently my styles don't seem to be inherited to SubComponents, so I have
> to set the styles manually for all sub components... Is this the way it is
> supposed to work?
>
> If this is the case I would recommend adding an inherited style model like
> HTML etc. So all styles are inherited from parent objects, unless they are
> overridden.
>
> regards,
> Mark.
>
>
>
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/Inherited-Styles-in-Sub-Components-tp4022835.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Inherited Styles in Sub Components

Ripgiblet
Hi Sandro,

SUMMARY:
1) How do you set the font size for the tab label in a TabPane?
2) How to set the background color of a Boxpane?
3) Does anybody have a fully fleshed out .json file for most components
that we can use as a reference?
4) I would recommend using overloaded stylename constructors.

DETAILS:
It does seem like some fundamentals still need a bit of work in pivot, I am
continually finding things that don't seem intuitive.
Like for example:
1) How do you set the font size for the label in a TabPane?
2) How to set the background color of a Boxpane?

If anybody has a fully fleshed out .json file for most components that we
can use as a reference? I will finish filling it out and we can post it on
the Wiki somewhere.
Because currently that information is not available, it does not work in the
component explorer, and all of the tutorials and examples only show the
really basic stuff.. like color...

I would recommend using a standard approach to simple things like background
and foreground colors.
Also I would recommend using overloaded style constructors so that you can
add multiple styles to a component. So for example:
<BoxPane orientation="vertical" styleName="applicationstyle"
styleName="boxpanedefaultstyle" styles="{padding:4,
horizontalAlignment:'center'}">
Also since no inheritance allow things like this:
<bxml:script>
        importClass(java.lang.System);
        var vMainStyle = "applicationstyle";
</bxml:script>
<BoxPane orientation="vertical" styleName="$vMainStyle"
styleName="boxpanedefaultstyle" styles="{padding:4,
horizontalAlignment:'center'}">

So then you .json file would be relatively simple.
Currently you basically need a different .json entry for each component in
your gui fully fleshed out... which makes it almost no improvement in
efficiency.
Also you get a huge number of warnings if you apply a generic fully fleshed
out style sheet to all components.

You would expect to be able to apply some values to every single component
and container. For example color and backgroundcolor...

Regards,
Mark.
-----Original Message-----
From: Sandro Martini [mailto:[hidden email]]
Sent: Friday, 24 January 2014 5:30 AM
To: Users - Apache Pivot
Subject: Re: Inherited Styles in Sub Components

Hi Mark,
styles in Pivot are different than css styles in HTML, this is feature
discussed since the beginning of Pivot :-) .
But the visual appearance of components is handled by the Skin (where for
example there is a pre-defined color palette), and any Component has a
related skin visual counterpart ... there are some global settings (color
palette, fonts, etc) in the skin but components draw themselves.

I agree that we could improve this, so be free to add a JIRA as Improvement,
or write/attach some test/idea/sample code.


Some old discussion here:
http://apache-pivot-users.399431.n3.nabble.com/can-we-use-css-style-sheet-in
-pivot-td3415299.html

Maybe using inline styles could help in your case now, some info here for
example:
http://apache-pivot-users.399431.n3.nabble.com/Apache-pivot-color-scheme-td4
022780.html


Tell us for more info.

Bye,
Sandro


2014/1/22 Ripgiblet <[hidden email]>:

> SUMMARY:
> Should Styles of subcomponents inherit from their parent components in
> Apache pivot?
> If not why not? and can we do this in the future?
>
> DETAILS:
> This is maybe a problem, or maybe a feature request.
>
> Currently my styles don't seem to be inherited to SubComponents, so I
> have to set the styles manually for all sub components... Is this the
> way it is supposed to work?
>
> If this is the case I would recommend adding an inherited style model
> like HTML etc. So all styles are inherited from parent objects, unless
> they are overridden.
>
> regards,
> Mark.
>
>
>
> --
> View this message in context:
> http://apache-pivot-users.399431.n3.nabble.com/Inherited-Styles-in-Sub
> -Components-tp4022835.html Sent from the Apache Pivot - Users mailing
> list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Inherited Styles in Sub Components

Sandro Martini
Hi Mark,
sorry for the big delay but hadn't time since some day ago ... I'll
reply in a few to your new email.

Bye,
Sandro
Loading...