Commit 83aceafa authored by helene ortiz's avatar helene ortiz
Browse files

Attribute width added to selector widget

parent a1691a55
......@@ -47,9 +47,17 @@ public class SWTPSelector extends PSelector {
if (selectorType.equals(PROPERTY_SELECTOR)) {
initialValue = Nomad.getAliasFromSetPoint(getControllerName(index), property.getValue());
}
if (widgetDescriptor.getWidth() > 0) {
buttonWidth = widgetDescriptor.getWidth();
}
button = (SWTPushButton)SWTPWidgetFactory.getInstance().createPushButton(parent, initialValue, buttonWidth);
button.setPreferredHeight(BUTTON_HEIGHT);
button.setPreferredWidth(buttonWidth);
initialFontSize = button.getButton().getFont().getFontData()[0].getHeight();
button.getButton().setLayoutData(SWTWidgetFactory.getInstance().getImageGridData(BUTTON_WIDTH, BUTTON_HEIGHT, !inSpy));
button.getButton().setLayoutData(SWTWidgetFactory.getInstance().getImageGridData(buttonWidth, BUTTON_HEIGHT, !inSpy));
button.getButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
......@@ -92,7 +100,7 @@ public class SWTPSelector extends PSelector {
Magnifier.getInstance().removeWidgetMagnifyListener(this);
} else {
SWTMagnifier.getInstance().magnifyControl(button.getButton(), initialFontSize);
button.setLayoutData(SWTWidgetFactory.getInstance().getImageGridData(Magnifier.getScaledValue(buttonWidth), Magnifier.getScaledValue(BUTTON_HEIGHT), true));
button.setLayoutData(SWTWidgetFactory.getInstance().getImageGridData(buttonWidth, BUTTON_HEIGHT, true));
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment