Bug 443185 - view's toolbar does not cope well with small views
Summary: view's toolbar does not cope well with small views
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.7 M1   Edit
Assignee: Eugen Neufeld CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 194595 258411 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-03 05:51 EDT by arne anka CLA
Modified: 2016-07-29 16:09 EDT (History)
7 users (show)

See Also:


Attachments
icons disappear (3.70 KB, image/png)
2014-09-03 05:52 EDT, arne anka CLA
no flags Details
icons shown if view far too wide (8.71 KB, image/png)
2014-09-03 05:52 EDT, arne anka CLA
no flags Details
icons cut off (4.35 KB, image/png)
2014-09-03 05:53 EDT, arne anka CLA
no flags Details
icons shown correctly after resizing view and switching abck to old size (5.28 KB, image/png)
2014-09-03 05:54 EDT, arne anka CLA
no flags Details
3x Behavior of the toolbar (6.04 KB, image/png)
2016-02-11 04:19 EST, Eugen Neufeld CLA
no flags Details
SWT Snippet (2.21 KB, application/octet-stream)
2016-02-11 04:25 EST, Eugen Neufeld CLA
no flags Details
Updated SWT Example showing the problem (1.94 KB, application/octet-stream)
2016-07-12 05:55 EDT, Eugen Neufeld CLA
no flags Details
ToolbarTest_Plain (1.65 KB, application/octet-stream)
2016-07-12 05:56 EDT, Eugen Neufeld CLA
no flags Details
Zip File with all 4 snippets (3.28 KB, application/x-zip-compressed)
2016-07-12 05:57 EDT, Eugen Neufeld CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description arne anka CLA 2014-09-03 05:51:48 EDT
se attached screenshots to display the issue:
bar1.png and bar2.png:
- Mylyn Task View
- if the view has a usable size, only the "View Menu" (downward pointing triangle) breaks, all other icons simply disappear without any indication that ther wmay be more than  shown
- only resizing to a size which is very inconvenient and completely inadequate shows all icons

bar1a.png and bar2a.png:
- Package Explorer View
- icons are cut-off although the space is sufficient
- changing the view's size and setting back to old size fixes that -- icons are shown correctly

not sure if it is the same issue in both cases, but it looks very similar to me.
second one (barXa.png) looks like #46025
Comment 1 arne anka CLA 2014-09-03 05:52:21 EDT
Created attachment 246655 [details]
icons disappear
Comment 2 arne anka CLA 2014-09-03 05:52:56 EDT
Created attachment 246656 [details]
icons shown if view far too wide
Comment 3 arne anka CLA 2014-09-03 05:53:25 EDT
Created attachment 246657 [details]
icons cut off
Comment 4 arne anka CLA 2014-09-03 05:54:12 EDT
Created attachment 246658 [details]
icons shown correctly after resizing view and switching abck to old size
Comment 5 Daniel Rolka CLA 2014-09-03 09:43:21 EDT
Moved to SWT for preliminary investigation

Daniel
Comment 6 Eugen Neufeld CLA 2016-02-11 04:17:02 EST
I checked this issue in more detail.
In 3x the toolbar actions also break one by one, or if there was a separator they were moved to the next line from the separator on. I will attach a screenshot do demonstrate this behavior.
With the introduction of Eclipse 4 this behavior was broken. So this issue exists from Juno on.

My investigation shows that this is not a SWT problem.
In order to rebuild the behavior of a view with its toolbar you have to create a CTabFolder and add a CTabItem as a child. Then you have to create a Toolbar and add this to the tabfolder tabFolder.setTopRight(toolBar,SWT.RIGHT | SWT.WRAP);
If you do so everything works just like in 3x. 

The problems start if you don't add the toolbar directly but wrap it into a composite. If you do so you have to set obviously a layout. And in 3x and in 4x an intermediate composite is created for the toolbar.
In 3x the PaneFolder did a lot of magic. 
In 4x now a simple RowLayout is used. The problem with the RowLayout is, that it needs enough vertical space from the start in order to be able to do the wrap. You can see this in the SWT LayoutExamples if you change whether to use the "preferred size" or not. 
In my opinion there are two solutions for this. 
- Change the RowLayout to grab the vertical space it need in order to wrap.
- Change the used Layout for the intermediate composite, eg use a GridLayout. The GridLayout is kind of a hack that works as long as there is only one child in the composite.

I will attach screenshots for the old 3x behavior and the swt snippet without the intermediate composite.
Comment 7 Eugen Neufeld CLA 2016-02-11 04:19:16 EST
Created attachment 259700 [details]
3x Behavior of the toolbar
Comment 8 Eugen Neufeld CLA 2016-02-11 04:25:57 EST
Created attachment 259701 [details]
SWT Snippet
Comment 9 Eclipse Genie CLA 2016-02-11 06:22:03 EST
New Gerrit change created: https://git.eclipse.org/r/66380
Comment 10 Andreas Sewe CLA 2016-03-25 10:56:33 EDT
FYI, I think Bug 480386 (filed by me a few month ago) may be a duplicate of this older issue.
Comment 11 Eugen Neufeld CLA 2016-04-11 09:36:06 EDT
Is there a chance, that this will be accepted for Neon?
Can I do something to help the process?
Comment 12 Eric Williams CLA 2016-04-13 15:38:47 EDT
(In reply to Eugen Neufeld from comment #11)
> Is there a chance, that this will be accepted for Neon?
> Can I do something to help the process?

Hi Eugene -- I'll be happy to review your patch sometime this week.
Comment 13 Sravan Kumar Lakkimsetti CLA 2016-05-04 05:45:14 EDT
We are unable to identify the actual problem here. Please provide us a reproducible scenario.
Moving to 4.6.1.
Comment 14 arne anka CLA 2016-07-01 04:54:51 EDT
*** Bug 258411 has been marked as a duplicate of this bug. ***
Comment 15 arne anka CLA 2016-07-01 04:57:36 EDT
- open the JUnit view or Mylyn Task view (or any other view with sufficently man icons in tool bar) to appear left or right of the editor area
- make smaller
- see icons disappear instead of being moved to the next line
Comment 16 Eugen Neufeld CLA 2016-07-12 05:55:13 EDT
Created attachment 263046 [details]
Updated SWT Example showing the problem

ToolbarTest_Plain, ToolbarTest_FillLayout and ToolbarTest_GridLayout work already without any patches.
ToolbarTest_RowLayout doesn't wrap on windows and doesn't produce a dropdown menu on GTK.
The ToolbarTest_RowLayout is relevant for the broken behavior of view menus as a RowLayout is used in the StackRenderer in 4x instead of a specialized layout as it was used in the part renderer in 3.x .
Comment 17 Eugen Neufeld CLA 2016-07-12 05:56:04 EDT
Created attachment 263047 [details]
ToolbarTest_Plain
Comment 18 Eugen Neufeld CLA 2016-07-12 05:57:22 EDT
Created attachment 263048 [details]
Zip File with all 4 snippets

Sorry for the spam, this attachment now contains all four snippets
Comment 20 Eric Williams CLA 2016-07-18 15:09:54 EDT
(In reply to Eclipse Genie from comment #19)
> Gerrit change https://git.eclipse.org/r/66380 was merged to [master].
> Commit:
> http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/
> ?id=0fe0e41c717b6a94e20a817c11162c04acaa2ca8

In master now, thanks for the patch!
Comment 21 Eric Williams CLA 2016-07-29 16:09:26 EDT
*** Bug 194595 has been marked as a duplicate of this bug. ***