Decreasing the Height of the PinkMatter Flamingo Ribbon Bar
- by Geertjan
The one and only thing prohibiting wide adoption of PinkMatter's
amazing Flamingo ribbon bar integration for NetBeans Platform applications (watch the YouTube movie here and follow the tutorial here) is... the amount of real estate
taken up by the height of the taskpane:
I was Skyping with Bruce Schubert
about this and he suggested that a first step might me to remove the
application menu. OK, once that had been done there was still a lot of
height:
But then I configured a bit further and now have this, which is
pretty squishy but at least shows there are possibilities:
How to get to the above point? Get the PinkMatter Flamingo ribbon bar from java.net (http://java.net/projects/nbribbonbar),
which is now the official place where it is found, and then look in the
"Flaming Integration" module. There you'll find
com.pinkmatter.modules.flamingo.LayerRibbonComponentProvider.
Do the following:
Comment out "addAppMenu(ribbon);" in "createRibbon()". That's the end of the application menu.
Change the "addTaskPanes(JRibbon ribbon)" method from this...
private void addTaskPanes(JRibbon ribbon) {
RibbonComponentFactory factory = new RibbonComponentFactory();
for (ActionItem item : ActionItems.forPath("Ribbon/TaskPanes")) {// NOI18N
ribbon.addTask(factory.createRibbonTask(item));
}
}
...to the following:
private void addTaskPanes(JRibbon ribbon) {
RibbonComponentFactory factory = new RibbonComponentFactory();
for (ActionItem item : ActionItems.forPath("Ribbon/TaskPanes")) { // NOI18N
RibbonTask rt = factory.createRibbonTask(item);
List<AbstractRibbonBand<?>> bands = rt.getBands();
for (AbstractRibbonBand arb : bands) {
arb.setPreferredSize(new Dimension(40,60));
}
ribbon.addTask(rt);
}
}
Hurray, you're done. Not a very great result yet, but at least you've
made a start in decreasing the height of the PinkMatter Flamingo ribbon bar. If anyone gets further with this, I'd be very happy to hear about it!