From c073beefeb0ac1df8fc9298682faac7e0a2a6702 Mon Sep 17 00:00:00 2001 From: GAM Date: Sat, 20 Mar 2021 09:26:37 +0100 Subject: [PATCH] fix styling EditLayout --- .../match/components/MatchComponent.java | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/main/java/app/views/match/components/MatchComponent.java b/src/main/java/app/views/match/components/MatchComponent.java index 1d52609..159e22c 100644 --- a/src/main/java/app/views/match/components/MatchComponent.java +++ b/src/main/java/app/views/match/components/MatchComponent.java @@ -37,6 +37,7 @@ public class MatchComponent extends Div implements ContentConfigurable { private final FlexLayout gamesLayout = new FlexLayout(); private final VerticalLayout noGamesLayout = new VerticalLayout(); + private final FlexLayout editLayout = new FlexLayout(); private final EditMatchCard editMatchCard; private Match match; @@ -64,6 +65,21 @@ public class MatchComponent extends Div implements ContentConfigurable { defineHeaderLayout(); defineGamesLayout(); defineNoGamesLayout(); + defineEditLayout(); + } + + private void defineHeaderLayout() { + headerLayout.add(headerPlayersLayout, headerResultLabel); + + headerPlayersLayout.addClassName("match-header-players"); + + headerResultLabel.addClassName("match-header-result"); + headerResultLabel.addClassName("bold-header"); + } + + private void defineGamesLayout() { + gamesLayout.setFlexWrap(FlexLayout.FlexWrap.WRAP); + gamesLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); } private void defineNoGamesLayout() { @@ -85,18 +101,9 @@ public class MatchComponent extends Div implements ContentConfigurable { return button; } - private void defineHeaderLayout() { - headerLayout.add(headerPlayersLayout, headerResultLabel); - - headerPlayersLayout.addClassName("match-header-players"); - - headerResultLabel.addClassName("match-header-result"); - headerResultLabel.addClassName("bold-header"); - } - - private void defineGamesLayout() { - gamesLayout.setFlexWrap(FlexLayout.FlexWrap.WRAP); - gamesLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); + private void defineEditLayout() { + editLayout.setJustifyContentMode(FlexComponent.JustifyContentMode.CENTER); + editLayout.add(editMatchCard); } ///////////// @@ -143,11 +150,11 @@ public class MatchComponent extends Div implements ContentConfigurable { private void configureMainContent() { if (navigation.editFlag()) { remove(gamesLayout); - add(editMatchCard); + add(editLayout); editMatchCard.configureContent(match); return; } - remove(editMatchCard); + remove(editLayout); configureGamesContent(); }