Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Sejsel opened this issue Jun 1, 2020 · 1 comment · Fixed by #1793
Closed

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

Sejsel opened this issue Jun 1, 2020 · 1 comment · Fixed by #1793
Labels
Milestone

Comments

@Sejsel
Copy link
Contributor

Sejsel commented Jun 1, 2020

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
@cwensley
Copy link
Member

cwensley commented Jun 2, 2020

Thanks for the report! I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants