Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Gtk3: incorrect extra height of last vertical element in DynamicTable #1708

@Sejsel

Description

@Sejsel

This seems to be a more general version of #1622 (thanks for the fix!), in vertical dynamic layouts. I sadly don't have enough time to look into this myself, and don't know the layout logic in Gtk3.

Expected Behavior

Correct control sizes (and minimal sizes), as with Eto 2.4.1.

Actual Behavior

Height of the last element in a DynamicTable weirdly depends on the width and content of text of some elements, at the very least buttons. Height of other elements also plays a role, the more labels there are above, the taller the button gets.

Steps to Reproduce the Problem

  1. Run the following code. Exhibits issue.
  2. Swap button and last label
  3. Increase the length of the text in the Button, notice last control gets smaller (including minimal size)
  4. Swap button back to last, see it happens regardless of Button's position
using Eto.Drawing;
using Eto.Forms;

namespace GtkButtonIssues
{
	public class MainForm : Form
	{
		public MainForm()
		{
			Title = "My Eto Form";
			ClientSize = new Size(400, 350);

			var layout = new DynamicLayout();
			layout.BeginVertical();
			{
				layout.Add("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dictum ultricies augue, non mollis ligula sagittis ac.");
				layout.Add("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dictum ultricies augue, non mollis ligula sagittis ac.");
				layout.Add("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dictum ultricies augue, non mollis ligula sagittis ac.");
				// Uncomment this line and comment the last button. The last label becomes tall
				//layout.Add(new Button {Text = "L"});
				layout.Add("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus dictum ultricies augue, non mollis ligula sagittis ac.");
				layout.Add(new Button {Text = "L"});
				// Increasing the length of the Button text reduces the height of the Button (or other last element) - swap with previous line:
				//layout.Add(new Button {Text = "Lorem ipsum dolor sit amet."});
			}
			layout.EndVertical();

			Content = layout;
		}
	}
}

Images

This is the result of the code above:
image

Increasing the length of the text in the button reduces Button's height:
image

Swapping the last two controls (with short text in Button) results in the Label being tall:
image

Specifications

  • Version: 2.5.0, 2.5.3-ci-20200531.2
  • Platform(s): Gtk3
  • Operating System(s): Linux, Gtk 3.24.20

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions