i have a lot of dockables and dont want to display the icons of the default actions in the titlebars.
When a dockable gains focus, i show the default actions with this piece of code:
All works fine but the problem is, that the titlebars height changes.
If there is no action in the titlebar the height is smaller. The active dockable with focus has a greater height.
Is there a way to change the height of the titlebar to a fixed value?
I tried using smaller Icons for the actions already
How about assigning an invisible icon to the Dockables? It could have a width of 0 or 1 pixels, but a height of something like 15-25 pixels. This would force titles to become larger and will work with any title. There are other (more professional) solutions, but this one is easy and should work everywhere.
Something like this
// you'll have to implement the InvisibleIcon, but javax.swing.Icon is a very simple interface
dockable.setTitleIcon( new InvisibleIcon( 1, 25 ));
With this solution i can only use the bigger height. But i would prefer to use the smaller one.
It seems that the buttons of the default actions have a fixed size? Would it possible to set the preferred size of these buttons to get a smaller height of titlebar? This looks a little bit better to me and save little space in the GUI Would be a nice little feature of your library
And I would like to give the user another possibility to configure the gui:
Is it possible to hide the default actions in the titlebar completly and keep it in the right-click context menu of the titlebar?
The buttons have a minimum size depending on the minimum size of an icon, but this minimum size can be changed using the property IconManager.MINIMUM_ICON_SIZE (CControl.putProperty…). At the moment it is 16x16, which means any icon smaller than 16x16 will be “filled up”. I actually only used this property to make the buttons bigger, but the other direction should work as well.
[Edit: I just saw you already did change the icons, together with the MINIMUM_ICON_SIZE this should result in a smaller title bars]
You will also need to replace the Icons, as they have usually a size of 16x16 pixels. The IconManager (CControl.getController().getIcons()) stores all Icons that are used by the framework. Call “setIconClient” and you can override an icon, the keys to the icons are written down in the “icons.ini” files.
[/Edit]
Ah cool! IconManager.MINIMUM_ICON_SIZE was exactly what i’m missing. I still worked with Version 1.1.0 and this property was introduced in v1.1.1p1. I just updated to the newest preview, set this new property to a smaller dimension and now my titlebar is smaller! Looks good