package com.example.myapplication;

import javax.servlet.annotation.WebServlet;

import com.vaadin.annotations.Theme;
import com.vaadin.annotations.VaadinServletConfiguration;
import com.vaadin.annotations.Widgetset;
import com.vaadin.server.Responsive;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinServlet;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.UI;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;

@Theme("mytheme")
//@Widgetset("com.example.myapplication.MyAppWidgetset")
public class MyUI extends UI {
	static int colorNumber = 0;

	class ColoredLabel extends Label {
		public ColoredLabel() {
			super();
			addStyleName("color-label");
			addStyleName("color-" + (colorNumber++) % 10);
		}
	}

	@Override
	protected void init(VaadinRequest vaadinRequest) {

		int rowCount = 3;
		GridLayout gridLayout = new GridLayout(6, rowCount);
		for (int i = 0; i < rowCount; i++) {
			gridLayout.setRowExpandRatio(i, 1);
		}
		gridLayout.setSizeFull();
		for (int i = 0; i < 10; i++) {
			gridLayout.addComponent(new ColoredLabel());
		}

		Label label = new Label("Shrinking header");
		label.addStyleName("header");
		VerticalLayout responsive = new VerticalLayout(label, gridLayout);
		responsive.setExpandRatio(gridLayout, 1);
		responsive.setSizeFull();
		responsive.addStyleName("responsive");
		Responsive.makeResponsive(responsive);
		Component root = new VerticalSplitPanel(responsive, new Label(getDesc()));
		root.setSizeFull();
		setContent(root);
	}

	private String getDesc() {
		return "Resize the split panel upwards until the \"Shrinking header shrinks\". After that the GridLayout row heights do not respect the set expand ratios anymore.";
	}

	@WebServlet(urlPatterns = "/*", name = "MyUIServlet", asyncSupported = true)
	@VaadinServletConfiguration(ui = MyUI.class, productionMode = false)
	public static class MyUIServlet extends VaadinServlet {
	}
}

@@ -173,49 +173,8 @@
 on;%0A
-import com.vaadin.annotations.Widgetset;%0A
 impo
@@ -379,16 +379,44 @@
 .Label;%0A
+import com.vaadin.ui.Panel;%0A
 import c
@@ -531,16 +531,17 @@
 eme%22)%0A//
+ 
 @Widgets
@@ -897,9 +897,10 @@
 t = 
-3
+58
 ;%0A%09%09
@@ -1084,17 +1084,17 @@
  0; i %3C 
-1
+2
 0; i++) 
@@ -1102,676 +1102,427 @@
 %0A%09%09%09
-gridLayout.addComponent(new ColoredLabel());%0A%09%09%7D%0A%0A%09%09Label label = new Label(%22Shrinking header%22);%0A%09%09label.addStyleName(%22header%22);%0A%09%09VerticalLayout responsive = new VerticalLayout(label, gridLayout);%0A%09%09responsive.setExpandRatio(gridLayout, 1);%0A%09%09responsive.setSizeFull();%0A%09%09responsive.addStyleName(%22responsive%22);%0A%09%09Responsive.makeResponsive(responsive);%0A%09%09Component root = new VerticalSplitPanel(responsive, new Label(getDesc()));%0A%09%09root.setSizeFull();%0A%09%09setContent(root);%0A%09%7D%0A%0A%09private String getDesc() %7B%0A%09%09return %22Resize the split panel upwards until the %5C%22Shrinking header shrinks%5C%22. After that the GridLayout row heights do not respect the set expand ratios anymore.%22
+int upperLeftRow = i * 2;%0A%09%09%09int upperLeftCol = 0;%0A%09%09%09int lowerRightCol = 5;%0A%09%09%09int lowerRightRow = upperLeftRow + 1;%0A%09%09%09ColoredLabel coloredLabel = new ColoredLabel();%0A%09%09%09coloredLabel.setSizeFull();%0A%09%09%09gridLayout.addComponent(coloredLabel, upperLeftCol, upperLeftRow, lowerRightCol, lowerRightRow);%0A%09%09%7D%0A%0A%09%09gridLayout.setHeight(%22500%25%22);%0A%09%09Component root = new Panel(gridLayout);%0A%09%09root.setSizeFull();%0A%09%09setContent(root)
 ;%0A%09%7D
@@ -1733,8 +1733,9 @@
  %7B%0A%09%7D%0A%7D%0A
+%0A

update demo