Skip to content
Snippets Groups Projects
Commit 910b17d0 authored by Alexander Diewald's avatar Alexander Diewald
Browse files

Apply 508e3bd8 to the current objective

parent ff3294b2
No related branches found
No related tags found
1 merge request!7Dev Objectives: Fix layout in toolbar
ApplicationActionBarAdvisor.java 3e7c0fd992586e6ca7724b871eb0b2cf59244028 GREEN
ApplicationWorkbenchAdvisor.java ef25d5783a4f75e88334fd679834a6e0421f8c2f GREEN
ApplicationWorkbenchWindowAdvisor.java da5cb38300b384579532c678fbc9faa961c2ca6b GREEN
CurrentObjectiveContributionItem.java 1a7fce591786a738c95ecfd79b2c508266a746d6 RED
CurrentObjectiveContributionItem.java ab53e877f1eb57f7904aed39f3c2d5ba8a6b74cd RED
UpcomingObjectiveContributionItem.java c4616313fc15b617fc47db2be180cd260ff90b8e RED
......@@ -38,6 +38,7 @@ import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Combo;
......@@ -75,6 +76,28 @@ import org.fortiss.tooling.kernel.ui.service.IConstraintUIService;
class CurrentObjectiveContributionItem extends WorkbenchWindowControlContribution
implements ISelectionListener, IResourceChangeListener {
/** Helper to align the upcoming objective combo with the current objective combo. */
public class SizedComposite extends Composite {
/** Constructor. */
public SizedComposite(Composite parent, int style) {
super(parent, style);
}
/** {@inheritDoc} */
@Override
public void setSize(Point size) {
super.setSize(computeSize(SWT.DEFAULT, SWT.DEFAULT, true));
}
/** {@inheritDoc} */
@Override
public void setSize(int width, int height) {
Point size = computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
super.setSize(size.x, size.y);
}
}
/** The initial objectives. */
private String[] initialSetOfObjectives = {};
......@@ -114,9 +137,9 @@ class CurrentObjectiveContributionItem extends WorkbenchWindowControlContributio
/** {@inheritDoc} */
@Override
protected Control createControl(Composite parent) {
composite = new Composite(parent, SWT.NONE);
composite = new SizedComposite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
composite.setLayout(layout);
Label label = new Label(composite, SWT.TRANSPARENT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment