8

I would like to hide the minimize/maximize buttons for views in Eclipse RCP.

Currently I'm running an RCP 3 product in RCP 4 (Compatability mode).

This is the top bar of the view containing all of the buttons. (I've covered up the logos etc)

Before

One method of removing the buttons is to create a style.css file and to specify that the buttons shouldn't be visible.

.MPartStack 
{
    swt-maximize-visible: false;
    swt-minimize-visible: false;
}

This results in this.

enter image description here

This is successfully removing the minimize/maximise buttons but is also shifting down the drop down button to a row below.

What might be causing this?

Update
As an alternative I've tried removing addons.swt from the e4xmi file. This included CleanupAddon, DnDAddon and MinMaxAddon. The buttons still remained.

Michael
  • 3,411
  • 4
  • 25
  • 56
  • 1
    I can't reproduce this. The second row is used if the tab renderer thinks there isn't enough space for everything in one row. Possibly using the curved tab is causing this. – greg-449 Nov 02 '18 at 15:05
  • 1
    I didn't notice that! Why might one be using a curved one and the other not? They are both the same just with and without the css. – Michael Nov 02 '18 at 15:07
  • 1
    `swt-simple: false;` in the CSS gives the curved style, several of the standard styles specify this. – greg-449 Nov 02 '18 at 15:30
  • 1
    This was my mistake. I had `swt-simple` set to false in the second example. I've updated it with the css only containing what I mentioned. – Michael Nov 02 '18 at 15:38

1 Answers1

3

I fixed this by changing the perspectives and views to the e4xmi file instead of the plugin.xml and setting them to not be toolbars.

In the plugin.xml file you can't specify if the view is a toolbar. In the e4xmi you can specify whether the part is a toolbar or not.

Here is the part configuration.

enter image description here

Community
  • 1
  • 1
Michael
  • 3,411
  • 4
  • 25
  • 56