Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Problem with theming Label font
Problem with theming Label font [message #125539] Wed, 18 March 2009 11:47 Go to next message
Eclipse UserFriend
Originally posted by: info.dp4.de

Hello,

I'm trying to theme a RAP Label, but it works only for some color
properties, not for the font:


creation:

import org.eclipse.swt.widgets.Label;

Label label = new Label(parent, SWT.LEFT);
label.setData(WidgetUtil.CUSTOM_VARIANT, "Header");
label.setText("some important text");


theme css:

Label.Header {
font: Arial 24px bold ;
background-color: blue;
}

so the background color is applied, but not the font information.

Is this a limitation or am I doing something wrong here?

Regards,
Stephan
Germany
Re: Problem with theming Label font [message #125566 is a reply to message #125539] Wed, 18 March 2009 13:55 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Stephan,

> Label.Header {
> font: Arial 24px bold ;

the font value is invalid CSS. Try this instead:

font: bold 24px Arial;

See also http://www.w3.org/TR/CSS21/fonts.html#font-shorthand

Regards, Ralf
Re: Problem with theming Label font [message #125580 is a reply to message #125566] Wed, 18 March 2009 14:41 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: info.dp4.de

Thanks Ralf,

but this does not help.

Using the font statement for all Controls with

* {
font: <attributes in any order>
}

works well, but not for "Label" or "Label.subclass" statements :(


> Hi Stephan,
>
>> Label.Header {
>> font: Arial 24px bold ;
>
> the font value is invalid CSS. Try this instead:
>
> font: bold 24px Arial;
>
> See also http://www.w3.org/TR/CSS21/fonts.html#font-shorthand
>
> Regards, Ralf
Re: Problem with theming Label font [message #125617 is a reply to message #125580] Wed, 18 March 2009 15:07 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Stephan Scholz wrote:
> Thanks Ralf,
>
> but this does not help.
>
> Using the font statement for all Controls with
>
> * {
> font: <attributes in any order>
> }
>
> works well, but not for "Label" or "Label.subclass" statements :(

It works here. Please check with a stylesheet that contains only the one
Label.Header { font: ... } rule. If this works then there is probably
another matching rule with a higher specificity in your stylesheet.

Ralf
Re: Problem with theming Label font [message #125680 is a reply to message #125617] Wed, 18 March 2009 17:55 Go to previous message
Eclipse UserFriend
Originally posted by: info.dp4.de

thanks again, I fixed the problem now.

I was using RAP in version 1.1.1.200809xx instead of 1.2.0.200812xx.

The old version doesn't contain the "font" style in the label.theme.xml
description file.

Using the new RAP in my target platform, it works as expected :)

Regards,
Stephan

> Stephan Scholz wrote:
>> Thanks Ralf,
>>
>> but this does not help.
>>
>> Using the font statement for all Controls with
>>
>> * {
>> font: <attributes in any order>
>> }
>>
>> works well, but not for "Label" or "Label.subclass" statements :(
>
> It works here. Please check with a stylesheet that contains only the one
> Label.Header { font: ... } rule. If this works then there is probably
> another matching rule with a higher specificity in your stylesheet.
>
> Ralf
Previous Topic:plots and moving graphics: BIRT or custom Flash widget?
Next Topic:Tree selection
Goto Forum:
  


Current Time: Thu Mar 28 17:09:59 GMT 2024

Powered by FUDForum. Page generated in 0.04732 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top