-
-
Notifications
You must be signed in to change notification settings - Fork 344
Closed
Description
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
- Run the following code. Exhibits issue.
- Swap button and last label
- Increase the length of the text in the Button, notice last control gets smaller (including minimal size)
- 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:
Increasing the length of the text in the button reduces Button's height:
Swapping the last two controls (with short text in Button) results in the Label being tall:
Specifications
- Version: 2.5.0, 2.5.3-ci-20200531.2
- Platform(s): Gtk3
- Operating System(s): Linux, Gtk 3.24.20