Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » How to style View header?(CSS related questions)
How to style View header? [message #900085] Fri, 03 August 2012 21:26 Go to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Hello,

I am trying to style the ViewPart Tab header. Which widget should I be theming?

http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.rap.help%2Fhelp%2Fhtml%2Freference%2Ftheming%2Findex.html

I tried TabItem and CTabItem but the colors don't change. I can change the Shell-Titlebar style but it changes the title bar of all shells (include the TitleAreaDialog).

Any pointers are greatly appreciated!

Ronald

[Updated on: Fri, 03 August 2012 21:27]

Report message to a moderator

Re: How to style View header? [message #900265 is a reply to message #900085] Mon, 06 August 2012 09:13 Go to previous messageGo to next message
Tim Buschtoens is currently offline Tim BuschtoensFriend
Messages: 396
Registered: July 2009
Senior Member
Hi.

> I am trying to style the View Tab header. Which widget should I be
> theming?

These are usually CTabItems, unless you are using a custom look and feel
(e.g. "buisness" or "fancy" from budle org.eclipse.rap.design.example),
in which case you need to look here:
http://help.eclipse.org/juno/topic/org.eclipse.rap.help/help/html/advanced/look-and-feel.html

> the Shell-Titlebar style but it changes the title bar of all shells
> (include the TitleAreaDialog).

To change the style of specific widget-instances, you need to use custom
variants:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.rap.help%2Fhelp%2Fhtml%2Freference%2Ftheming%2Findex.html

Greetings,
Tim

--
Tim Buschtöns

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to style View header? [message #900277 is a reply to message #900085] Mon, 06 August 2012 10:01 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Roland,
please note that Workbench has it's own theming capabilities which could
override the RAP theming. See DefaultTabFolder and PaneFolder classes.
Best,
Ivan

On 8/4/2012 12:26 AM, Ronald So wrote:
> Hello,
>
> I am trying to style the View Tab header. Which widget should I be
> theming?
>
> http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.rap.help%2Fhelp%2Fhtml%2Freference%2Ftheming%2Findex.html
>
>
> I tried TabItem and CTabItem but the colors don't change. I can
> change the Shell-Titlebar style but it changes the title bar of all
> shells (include the TitleAreaDialog).
> Any pointers are greatly appreciated!
>
> Ronald

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to style View header? [message #900424 is a reply to message #900277] Tue, 07 August 2012 03:48 Go to previous messageGo to next message
ocean xue is currently offline ocean xueFriend
Messages: 107
Registered: November 2011
Senior Member
Hi,Ivan

Can you provide some code?

thank a lot
Re: How to style View header? [message #900434 is a reply to message #900424] Tue, 07 August 2012 05:50 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
a fast web search for "Eclipse Workbench Theme" brings me to this article:
http://stackoverflow.com/questions/628726/how-to-change-the-color-of-eclipse-rcp-view-title-bar
Best,
Ivan

On 8/7/2012 6:48 AM, ocean xue wrote:
> Hi,Ivan
>
> Can you provide some code?
>
> thank a lot

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to style View header? [message #900607 is a reply to message #900434] Tue, 07 August 2012 18:32 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Ivan,

Thanks for the link but I am trying to keep all my settings in CSS. After trying the CTabItem style,

CTabItem {
    font: normal bold 15px Trebuchet, Arial, sans-serif;
    color: #ffffff;
    background-color: #005596;
    background-image: none;
    padding: 10px 25px;
    spacing: 0px;
    text-shadow: none;
}

CTabItem:selected {
    color: #005596;
    background-image: gradient(linear, left top, left bottom,
            from( #0000ff ),
            color-stop( 10%, #ffffff) ),
            to( #ffffff )
        );
}


It seems like RAP honors the font, padding, spacing, and text-shadow without a problem. However, "color", "background-color", and "background-image" are not being honored.

I have attached how the UI renders when the tabs are being selected with the code above.

Thanks,
Ronald
Re: How to style View header? [message #900617 is a reply to message #900607] Tue, 07 August 2012 19:20 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Roland,
that's true, because these properties are overrided by the Workbench
theme - set background, background (selection) gradient by code. If you
search somewhere in the DefaultTabFolder or PaneFolder classes you will
find the places where these properties are set. In RAP, the properties
set by the code always override the same properties set by RAP theming.
HTH,
Ivan

On 8/7/2012 9:32 PM, Ronald So wrote:
> Ivan,
>
> Thanks for the link but I am trying to keep all my settings in CSS. After trying the CTabItem style,
>
>
> CTabItem {
> font: normal bold 15px Trebuchet, Arial, sans-serif;
> color: #ffffff;
> background-color: #005596;
> background-image: none;
> padding: 10px 25px;
> spacing: 0px;
> text-shadow: none;
> }
>
> CTabItem:selected {
> color: #005596;
> background-image: gradient(linear, left top, left bottom,
> from( #0000ff ),
> color-stop( 10%, #ffffff) ),
> to( #ffffff )
> );
> }
>
>
> It seems like RAP honors the font, padding, spacing, and text-shadow without a problem. However, "color", "background-color", and "background-image" are not being honored.
>
> I have attached how the UI renders when the tabs are being selected with the code above.
>
> Thanks,
> Ronald

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: How to style View header? [message #900619 is a reply to message #900617] Tue, 07 August 2012 19:41 Go to previous messageGo to next message
Ronald So is currently offline Ronald SoFriend
Messages: 198
Registered: April 2011
Senior Member
Ivan,

I understand that the code will override CSS settings, but is it a desirable behavior? With this limitation, developers are pretty much handcuffed by whatever colors that the code is using, and the color may not go along with the rest of the CSS settings we set for other components. Is there a way to relax it, or is it a big fix that there is no hope to get in 1.5.1 time frame even if a bug is logged?

Thanks,
Ronald
Re: How to style View header? [message #900668 is a reply to message #900619] Wed, 08 August 2012 06:21 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Roland,
currently there is no workaround. If a property is set by the code it
takes precedence. From my point of view this is not a bug (this is how
workbench theming works) and there is no chance for improvement in this
direction for 1.5.1. Sorry.
Best,
Ivan

On 8/7/2012 10:41 PM, Ronald So wrote:
> Ivan,
>
> I understand that the code will override CSS settings, but is it a
> desirable behavior? With this limitation, developers are pretty much
> handcuffed by whatever colors that the code is using, and the color
> may not go along with the rest of the CSS settings we set for other
> components. Is there a way to relax it, or is it a big fix that there
> is no hope to get in 1.5.1 time frame even if a bug is logged?
>
> Thanks,
> Ronald
>

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:MongoDB IDE with RAP
Next Topic:How to style Scroll bar color?
Goto Forum:
  


Current Time: Thu Apr 25 07:40:18 GMT 2024

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

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

Back to the top