Skip to content

Commit

Permalink
Second fix for #3189 (regarding separators in other toolbars)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Sep 13, 2021
1 parent 93b1e0e commit 430c810
Showing 1 changed file with 9 additions and 6 deletions.
Expand Up @@ -154,10 +154,12 @@ protected void checkSubclass() {}
* @return the tool item
*/
public ToolItem sep(final int width, final int side /* SWT.LEFT or SWT.RIGHT */) {
final var icon = GamaIcons.createSizer(getBackground(), width, height);
final var item = create(icon.getCode(), null, null, null, SWT.NONE, false, null, side);
item.setDisabledImage(icon.image());
if (!PlatformHelper.isLinux()) { item.setEnabled(false); }
// final var icon = GamaIcons.createSizer(getBackground(), width, height);
// final var item = create(icon.getCode(), null, null, null, SWT.NONE, false, null, side);
// item.setDisabledImage(icon.image());
// if (!PlatformHelper.isLinux()) { item.setEnabled(false); }
ToolItem item = new ToolItem(side == SWT.LEFT ? left : right, SWT.SEPARATOR_FILL);
item.setWidth(width);
return item;
}

Expand Down Expand Up @@ -539,8 +541,9 @@ private ToolItem create(final String image, final String text, final String tip,
}
if (listener != null) { button.addSelectionListener(listener); }
if (control != null) {
//GamaColors.setBackground(control, getBackground());
button.setControl(control); }
// GamaColors.setBackground(control, getBackground());
button.setControl(control);
}
normalizeToolbars();

return button;
Expand Down

0 comments on commit 430c810

Please sign in to comment.