Coolbar cuts off text [message #10599] |
Wed, 21 March 2007 08:33  |
Eclipse User |
|
|
|
Hello,
if I have actions with text in the cool bar added as ActionContributionItem
with the property ActionContributionItem.MODE_FORCE_TEXT then the text of
the last action is cutted a little bit so that the text does not display
correctly. You can reproduce it, if You change the method createToolBar in
the action bar advisor of Your Demo to the code below. It seems that it cuts
more for every action that is added with text.
private void createToolBar( ICoolBarManager coolBar, final String name ) {
IToolBarManager toolbar = new ToolBarManager( RWT.FLAT | RWT.RIGHT );
coolBar.add( new ToolBarContributionItem( toolbar, name ) );
toolbar.add( exitAction );
int aboutActionAdded = 5;
for(int i = 0; i < aboutActionAdded; i++) {
ActionContributionItem contributionItem =
new ActionContributionItem(aboutAction);
contributionItem.setMode(ActionContributionItem.MODE_FORCE_T EXT);
toolbar.add(contributionItem);
}
}
Best regards,
Markus
|
|
|
Re: Coolbar cuts off text [message #11538 is a reply to message #10599] |
Thu, 22 March 2007 15:29  |
Eclipse User |
|
|
|
Hi Markus,
that looks sad. I added a two extra pixels in the size caluclation of
ToolItem when image and text are display together.
But don't expect this to work under all circumstances. The current text
size calculation (rather an estimation to be true) might add to this. We
will replace this with a proper calculation in the future. Some more
information on this can be found here:
http://wiki.eclipse.org/index.php/18_Fonts#Font_Size_Measure ments
Cheers,
Rüdiger
Markus Krüger wrote:
> Hello,
> if I have actions with text in the cool bar added as ActionContributionItem
> with the property ActionContributionItem.MODE_FORCE_TEXT then the text of
> the last action is cutted a little bit so that the text does not display
> correctly. You can reproduce it, if You change the method createToolBar in
> the action bar advisor of Your Demo to the code below. It seems that it cuts
> more for every action that is added with text.
>
> private void createToolBar( ICoolBarManager coolBar, final String name ) {
> IToolBarManager toolbar = new ToolBarManager( RWT.FLAT | RWT.RIGHT );
> coolBar.add( new ToolBarContributionItem( toolbar, name ) );
> toolbar.add( exitAction );
> int aboutActionAdded = 5;
> for(int i = 0; i < aboutActionAdded; i++) {
> ActionContributionItem contributionItem =
> new ActionContributionItem(aboutAction);
> contributionItem.setMode(ActionContributionItem.MODE_FORCE_T EXT);
> toolbar.add(contributionItem);
> }
> }
>
>
>
> Best regards,
>
> Markus
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03674 seconds