Skip to content

Commit

Permalink
Gets rid of the blind usage of WorkbenchHelper.getSheet();
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisDrogoul committed Sep 17, 2021
1 parent 1eb390f commit 7741c68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Expand Up @@ -35,7 +35,6 @@
import ummisco.gama.ui.resources.GamaIcons;
import ummisco.gama.ui.resources.IGamaColors;
import ummisco.gama.ui.utils.PlatformHelper;
import ummisco.gama.ui.utils.WorkbenchHelper;
import ummisco.gama.ui.views.toolbar.GamaToolbarFactory.ToggleAction;

/**
Expand Down Expand Up @@ -138,7 +137,7 @@ public void createToolbars() {
data.horizontalAlignment = SWT.RIGHT;
data.minimumWidth = height * 2;
right.setLayoutData(data);
setBackgroundColor(isDark() ? WorkbenchHelper.getShell().getBackground() : IGamaColors.WHITE.color());
setBackgroundColor(isDark() ? getShell().getBackground() : IGamaColors.WHITE.color());
}

@Override
Expand All @@ -154,13 +153,9 @@ 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); }
ToolItem item = new ToolItem(side == SWT.LEFT ? left : right, SWT.SEPARATOR );

// item.setWidth(width);
return item;
return new ToolItem(side == SWT.LEFT ? left : right, SWT.SEPARATOR);
}

/**
Expand Down
Expand Up @@ -30,7 +30,6 @@
import ummisco.gama.ui.resources.GamaColors;
import ummisco.gama.ui.resources.GamaIcons;
import ummisco.gama.ui.resources.IGamaColors;
import ummisco.gama.ui.utils.WorkbenchHelper;

/**
* The class GamaToolbarFactory.
Expand Down Expand Up @@ -288,7 +287,7 @@ public static Composite createToolbarComposite(final Composite composite) {
toolbarComposite.setLayout(layout);
// toolbarComposite.setBackground(IGamaColors.WHITE.color());
GamaColors.setBackground(toolbarComposite,
isDark() ? WorkbenchHelper.getShell().getBackground() : IGamaColors.WHITE.color());
isDark() ? composite.getShell().getBackground() : IGamaColors.WHITE.color());
return toolbarComposite;

}
Expand Down

0 comments on commit 7741c68

Please sign in to comment.