Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 365706 - [CSS] Allow definition of Toolbar-Style in our ToolBarManagerRenderer using CSS
Summary: [CSS] Allow definition of Toolbar-Style in our ToolBarManagerRenderer using CSS
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC All
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-06 06:38 EST by Thomas Schindl CLA
Modified: 2020-04-19 16:30 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schindl CLA 2011-12-06 06:38:14 EST
We are currently hardcoding the styles we use to setup the Toolbar (SWT.WRAP | SWT.FLAT | SWT.RIGHT) which e.g. makes the Image and Icons get aligned next to instead of on top each other.

I'd suggest we allow users to control this behavior using CSS.
Comment 1 Thomas Schindl CLA 2011-12-06 06:40:34 EST
Brian, I know you worked a lot lately with the CSS-Engine what do you think about adding an CSS-Property for this?
Comment 2 Wendell Beckwith CLA 2011-12-06 08:45:40 EST
CSS control of the label position would work great.  Another addition that could/should be added would be a property to control the maximum length of a label in a toolbar.  This will allow toolbar items to have a consistent spacing.
Comment 3 Brian de Alwis CLA 2011-12-06 11:44:42 EST
Adding a property is easy to do (see [1] for details), but I'm not certain if/how a toolbar can be configured to show both images and labels.  Remy has an example that does show both, but a cursory look through the javadocs for Toolbar and ToolItem didn't reveal anything to me, so it may be platform dependent.

[1] http://wiki.eclipse.org/E4/CSS/Add_Styleable_Property
Comment 4 Paul Webster CLA 2011-12-06 12:46:38 EST
isn't it just setting text on the ToolItem that makes the text visible?

In org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.updateToolItem() we appear to be setting the text if it is set in model.getLocalizedLabel();

PW
Comment 5 Thomas Schindl CLA 2011-12-06 12:54:34 EST
There are 2 different things you are mixing up:
a) ToolItems by default show image & text if both are set (and I think do this)
b) The displaying of Item and Text
   If one creates the Toolbar using SWT.RIGHT the label is displayed next to
   the icon, if you don't use that the label is displayed below! Please note the 
   setting does NOT occur on the ToolItem but on the Toolbar
Comment 6 Brian de Alwis CLA 2011-12-06 14:13:23 EST
(In reply to comment #5)
> There are 2 different things you are mixing up:
> a) ToolItems by default show image & text if both are set (and I think do this)
> b) The displaying of Item and Text

You're right Tom — I seem to have been misled from previous experiences adding Actions to a toolbar, where they are wrapped as ActionContributionItems and which suppress the text by default unless the ACI's mode is set to enable MODE_FORCE_TEXT.

>    If one creates the Toolbar using SWT.RIGHT the label is displayed next to
>    the icon, if you don't use that the label is displayed below! Please note
> the 
>    setting does NOT occur on the ToolItem but on the Toolbar

I don't believe we can change the style bits after creation, can we?  So we'd need to handle this via a new flag on MToolBar.

With that, we could potentially add a property handler that would get the modelled element and then toggle the flag.
Comment 7 Wendell Beckwith CLA 2012-01-03 22:04:34 EST
Will this still make the 4.2 release?  I hope so as the functionality exists in 3.x.
Comment 8 Paul Webster CLA 2012-01-04 07:37:20 EST
Brian, Tom, if you can agree on a property and show me what to call, we could add this.

In 3.x we differentiated between a view toolbar and a toolbar for the main coolbar.

PW
Comment 9 Bertrand K CLA 2013-10-16 04:52:32 EDT
Hello,

I really interested by this feature as we try to move from indigo to Kepler and the GUI  of our existing product is using it. Is this done ? or is this plan to be done ?

Thanks
Bertrand
Comment 10 Eclipse Genie CLA 2020-04-19 16:30:01 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.