From b2209bcdafec6464b53f7b0a6645e1a9f1539504 Mon Sep 17 00:00:00 2001 From: Moritz Dieing <63721811+moritzdieing@users.noreply.github.com> Date: Sun, 14 Feb 2021 12:05:46 +0100 Subject: [PATCH] Set dialog width in java Css solution did not work when all accordion panels were closed --- frontend/styles/view/main/help-dialog.css | 9 ++++----- src/main/java/edu/kit/typicalc/view/main/HelpDialog.java | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/styles/view/main/help-dialog.css b/frontend/styles/view/main/help-dialog.css index aabe842..308d7fa 100644 --- a/frontend/styles/view/main/help-dialog.css +++ b/frontend/styles/view/main/help-dialog.css @@ -1,8 +1,3 @@ -vaadin-dialog-overlay { - width: 1000px; - height: 600px; -} - #contentLayout { padding-left: 0; padding-right: 0; @@ -21,6 +16,10 @@ vaadin-dialog-overlay { right: 0; } +#accordion { + width: 100%; +} + .help-field { justify-content: center; align-items: center; diff --git a/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java b/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java index 648a83c..43e1fa5 100644 --- a/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java +++ b/src/main/java/edu/kit/typicalc/view/main/HelpDialog.java @@ -31,6 +31,7 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver { private static final String HEADING_LAYOUT_ID = "headingLayout"; private static final String CONTENT_LAYOUT_ID = "contentLayout"; private static final String LANGUAGE_SELECT_ID = "languageSelect"; + private static final String ACCORDION_ID = "accordion"; private final H3 heading; private final Select languageSelect; @@ -53,9 +54,13 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver { VerticalLayout contentLayout = new VerticalLayout(); Accordion content = createHelpContent(); + content.setId(ACCORDION_ID); contentLayout.add(content); contentLayout.setId(CONTENT_LAYOUT_ID); add(headingLayout, contentLayout); + // setting size of overlay does not work if all accordion panels are closed + setWidth("1000px"); + setHeight("600px"); } private Accordion createHelpContent() { @@ -84,5 +89,6 @@ public class HelpDialog extends Dialog implements LocaleChangeObserver { languageSelect.setLabel(getTranslation("root.selectLanguage")); languageSelect.setTextRenderer(renderer); // TODO update help texts + // language-switch already works } }