|
|
|
Re: Styling tabs of MParts [message #1400591 is a reply to message #1400448] |
Mon, 14 July 2014 12:32 |
Marina Knieling Messages: 83 Registered: February 2013 |
Member |
|
|
Hi Eugen,
now I understand your problem. I reviewed my own code and realized that
I only added those tags to the PartStack and so all Tabs are handled in
the same way (which is not the behaviour YOU want).
However, I got a bit closer with the following idea:
In your Part implementation use
((CTabFolder)(part.getParent().getWidget())).setData("some-key","some-value");
where part is the injected MPart, and so part.getParent() is the
containing CTabFolder (as every PartStack is implemented as a CTabFolder).
In your CSS you can now use:
CTabFolder[some-key='some-value']{
swt-tab-renderer:
url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-tab-height: 30px;
swt-selected-tab-fill: #ff0000;
}
CTabFolder[some-key='some-value-2']{
swt-tab-renderer:
url('bundleclass://org.eclipse.e4.ui.workbench.renderers.swt/org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering');
swt-tab-height: 20px;
swt-selected-tab-fill: #00ff00;
}
The only problem I got is that when using two or more values, they get
overriden when switching tabs, so when all tabs have been selected once
they all look the same again. But maybe you can investigate that and
find a solution.
Cheers, Marina
On 14.07.2014 10:04, Eugen Neufeld wrote:
> Hi Marina, thanks for the hint. Here is my problem: I have one
> MPartStack and in this PartStack I have multiple Parts. Now I want to
> change the background color of the tab (not the color of the tab content).
> I can add a tag to the MPart but this will only influence the content of
> the tab, as the tabs are provided by the MPartStack.
> So is the MPartStack renderer able to render tabs with different colors?
> If I understood the code of the MPartStack renderer correctly, then it
> only can set a selectedColor and an unselectedColor.
> Cheers,
> Eugen
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04203 seconds