Bug 563086 - Cannot flag the visible flag von a Toolbar in a Trimbar
Summary: Cannot flag the visible flag von a Toolbar in a Trimbar
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.16   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Rolf Theunissen CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-12 05:25 EDT by Lars Vogel CLA
Modified: 2021-06-04 00:55 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot (44.96 KB, image/png)
2020-05-12 05:26 EDT, Lars Vogel CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2020-05-12 05:25:56 EDT
Looks like I cannot trigger the visible flag via the model editor on a toolbar in a trimbar.

Is this a bug in the model editor or a limitation of our model?
Comment 1 Lars Vogel CLA 2020-05-12 05:26:45 EDT
Created attachment 282792 [details]
Screenshot
Comment 2 Lars Vogel CLA 2020-05-12 05:27:12 EDT
(In reply to Lars Vogel from comment #0)
> Is this a bug in the model editor or a limitation of our model?

Rolf, do you know this?
Comment 3 Rolf Theunissen CLA 2020-05-12 15:40:07 EDT
(In reply to Lars Vogel from comment #2)
> (In reply to Lars Vogel from comment #0)
> > Is this a bug in the model editor or a limitation of our model?
> 
> Rolf, do you know this?

There is a hack in org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout#hideManagedTB that insists on changing back the visibility flag when you try to toggle it.
Comment 4 Lars Vogel CLA 2020-05-29 09:38:10 EDT
(In reply to Rolf Theunissen from comment #3)
> (In reply to Lars Vogel from comment #2)
> > (In reply to Lars Vogel from comment #0)
> > > Is this a bug in the model editor or a limitation of our model?
> > 
> > Rolf, do you know this?
> 
> There is a hack in
> org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout#hideManagedTB that
> insists on changing back the visibility flag when you try to toggle it.

Do you think this is required or is this a bug?
Comment 5 Rolf Theunissen CLA 2020-05-29 09:54:53 EDT
I think it is a bug. The method is called hideManagedTB, and is supposed to mark empty toolbars as invisible. However, it also marks non-empty toolbars as visible.

Moreover, the code checks widgets to update the visibility of the model. The model should always drive the widgets, not the other way around. This one of the things to fix in the overall visibility story. I am thinking to introduce a visibility processor addon to manage all the visibility attributes. This addon would mark the toolbars invisible based on the child items (and tags) in the model. This code would then be obsolete.
Comment 6 Lars Vogel CLA 2020-06-15 09:02:00 EDT
Deleting the method hideManagedTB does not make a difference to me at runtime (AFAICS). Does you see new bugs if you delete this method? I push a Gerrit for testing and will mark it with -2 to ensure that this test Gerrit is not merged without sufficient testing.
Comment 7 Eclipse Genie CLA 2020-06-15 09:02:36 EDT
New Gerrit change created: https://git.eclipse.org/r/164915
Comment 8 Rolf Theunissen CLA 2020-08-18 16:30:39 EDT
I updated the Gerrit to ignore empty toolbars when calculating the size (and laying out the control). This removes the need to mark the toolbars hidden (or forcing to be shown) in the model.

If showing/hiding of the toolbars in the model is needed, it should be handled in the CleanupAddon. But it is explicitly disabled there, because otherwise toolbars will show up unexpectedly.
Comment 9 Lars Vogel CLA 2020-11-18 08:31:57 EST
Mass change to 4.19 M1, please update the target if you have other plans.
Comment 10 Alexander Kurtakov CLA 2021-01-07 03:07:31 EST
Mass move 4.19 M1 bugs to M3
Comment 11 Kalyan Prasad Tatavarthi CLA 2021-06-04 00:55:06 EDT
Mass Move out of 4.20