Labels/Icons are placed differently in vertical alignment

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Melanie Retter
2016-04-13 14:12:58 +02:00
parent 5e879ed80e
commit 993dab2eed
3 changed files with 8 additions and 9 deletions

View File

@@ -152,18 +152,18 @@ public abstract class AbstractTableDetailsLayout<T extends NamedEntity> extends
final HorizontalLayout nameEditLayout = new HorizontalLayout(); final HorizontalLayout nameEditLayout = new HorizontalLayout();
nameEditLayout.setWidth(100.0f, Unit.PERCENTAGE); nameEditLayout.setWidth(100.0f, Unit.PERCENTAGE);
nameEditLayout.addComponent(caption); nameEditLayout.addComponent(caption);
nameEditLayout.setComponentAlignment(caption, Alignment.MIDDLE_LEFT); nameEditLayout.setComponentAlignment(caption, Alignment.TOP_LEFT);
if (hasEditPermission()) { if (hasEditPermission()) {
nameEditLayout.addComponent(editButton); nameEditLayout.addComponent(editButton);
nameEditLayout.setComponentAlignment(editButton, Alignment.MIDDLE_RIGHT); nameEditLayout.setComponentAlignment(editButton, Alignment.TOP_RIGHT);
} }
nameEditLayout.setExpandRatio(caption, 1.0f); nameEditLayout.setExpandRatio(caption, 1.0f);
nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE); nameEditLayout.addStyleName(SPUIStyleDefinitions.WIDGET_TITLE);
addComponent(nameEditLayout); addComponent(nameEditLayout);
setComponentAlignment(nameEditLayout, Alignment.MIDDLE_CENTER); setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
addComponent(detailsTab); addComponent(detailsTab);
setComponentAlignment(nameEditLayout, Alignment.MIDDLE_CENTER); setComponentAlignment(nameEditLayout, Alignment.TOP_CENTER);
setSizeFull(); setSizeFull();
setHeightUndefined(); setHeightUndefined();

View File

@@ -44,7 +44,7 @@ import com.vaadin.ui.VerticalLayout;
public abstract class AbstractTableHeader extends VerticalLayout { public abstract class AbstractTableHeader extends VerticalLayout {
private static final long serialVersionUID = 4881626370291837175L; private static final long serialVersionUID = 4881626370291837175L;
@Autowired @Autowired
protected I18N i18n; protected I18N i18n;
@@ -53,7 +53,6 @@ public abstract class AbstractTableHeader extends VerticalLayout {
@Autowired @Autowired
protected transient EventBus.SessionEventBus eventbus; protected transient EventBus.SessionEventBus eventbus;
private Label headerCaption; private Label headerCaption;
@@ -83,7 +82,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
restoreState(); restoreState();
eventbus.subscribe(this); eventbus.subscribe(this);
} }
@PreDestroy @PreDestroy
void destroy() { void destroy() {
eventbus.unsubscribe(this); eventbus.unsubscribe(this);
@@ -195,7 +194,7 @@ public abstract class AbstractTableHeader extends VerticalLayout {
dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0f); dropHintDropFilterLayout.setExpandRatio(dropFilterLayout, 1.0f);
} }
addComponent(dropHintDropFilterLayout); addComponent(dropHintDropFilterLayout);
setComponentAlignment(dropHintDropFilterLayout, Alignment.MIDDLE_CENTER); setComponentAlignment(dropHintDropFilterLayout, Alignment.TOP_CENTER);
addStyleName("bordered-layout"); addStyleName("bordered-layout");
addStyleName("no-border-bottom"); addStyleName("no-border-bottom");
} }

View File

@@ -139,7 +139,7 @@ public final class DashboardMenu extends CustomComponent {
final Label logo = new Label("<strong>" + i18n.get("menu.title") + "</strong>", ContentMode.HTML); final Label logo = new Label("<strong>" + i18n.get("menu.title") + "</strong>", ContentMode.HTML);
logo.setSizeUndefined(); logo.setSizeUndefined();
final HorizontalLayout logoWrapper = new HorizontalLayout(logo); final HorizontalLayout logoWrapper = new HorizontalLayout(logo);
logoWrapper.setComponentAlignment(logo, Alignment.MIDDLE_CENTER); logoWrapper.setComponentAlignment(logo, Alignment.TOP_CENTER);
logoWrapper.addStyleName("valo-menu-title"); logoWrapper.addStyleName("valo-menu-title");
return logoWrapper; return logoWrapper;
} }