Hi,
It seems that the width of the ribbongroup does not change when a button of the group is hidden (even with setAutoWidth() applied on the ribbon group).
Setting the width of the ribbongroup manually and/or redrawing has no effect either.
Is this supposed to work like this or can we change something to make it work as we would need (ribbon group adapts his size).
This is on SNAPSHOT_v9.0d_2013-06-04/Pro Deployment*(built*2013-06-04) with all current browser versions.
thanks.
PS: when initially adding the button to the group in hidden state (button.hide()) the width is adjusted in a proper matter.
It seems that the width of the ribbongroup does not change when a button of the group is hidden (even with setAutoWidth() applied on the ribbon group).
Setting the width of the ribbongroup manually and/or redrawing has no effect either.
Is this supposed to work like this or can we change something to make it work as we would need (ribbon group adapts his size).
Code:
public Canvas getViewPanel() { String ICON_SKIN_ACTION_ADD = "[SKINIMG]/actions/add.png"; // Ribbon bar init and group setting RibbonBar bar = new RibbonBar(); final RibbonGroup group = new RibbonGroup(); group.setNumRows(1); group.setTitle("Ribbon Group"); group.setRowHeight(76); group.setAutoWidth(); // Large button IconButton button = new IconButton("A very long title"); button.setAlign(Alignment.CENTER); button.setDisabled(false); button.setIcon(ICON_SKIN_ACTION_ADD); button.setLargeIcon(ICON_SKIN_ACTION_ADD); button.setOrientation("vertical"); group.addControl(button); // Small button final IconButton button2 = new IconButton("Add"); button2.setIcon(ICON_SKIN_ACTION_ADD); group.addControl(button2); // The hide button Button hideAddButton = new Button("Hide addbutton"); hideAddButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { button2.hide(); group.setWidth(100); // even setting group width manual does nothing group.redraw();// redraw has no effect } }); bar.addMember(group); //Layouting final VLayout main = new VLayout(); main.setOverflow(Overflow.VISIBLE); final VLayout v = new VLayout(); v.setOverflow(Overflow.VISIBLE); v.addMember(bar); final VLayout v2 = new VLayout(); v2.setOverflow(Overflow.VISIBLE); v2.addMember(hideAddButton); main.addMember(v); main.addMember(v2); return main; }
thanks.
PS: when initially adding the button to the group in hidden state (button.hide()) the width is adjusted in a proper matter.
Comment