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

Alignment problem when using image in box layout #1554

Open
koendehondt opened this issue Jun 9, 2024 · 0 comments
Open

Alignment problem when using image in box layout #1554

koendehondt opened this issue Jun 9, 2024 · 0 comments

Comments

@koendehondt
Copy link
Contributor

Consider this code:

presenter := SpPresenter new.
presenter layout: (SpBoxLayout newLeftToRight
	add: (presenter newLabel label: 'One'; yourself);
	add: (presenter newLabel label: 'Two'; yourself);
	yourself);
	open

The result is:

Screenshot 2024-06-09 at 15 50 38

That is what I expect.

Consider this code:

presenter := SpPresenter new.
presenter layout: (SpBoxLayout newLeftToRight
	add: presenter newList;
	add: (presenter newLabel label: 'Two'; yourself);
	yourself);
	open

The result is:

Screenshot 2024-06-09 at 15 50 56

That is also what I expect.

Now consider this code:

presenter := SpPresenter new.
presenter layout: (SpBoxLayout newLeftToRight
	add: (presenter newImage image: (presenter iconNamed: #smallError); yourself);
	add: (presenter newLabel label: 'Label'; yourself);
	yourself);
	open

The result is:

Screenshot 2024-06-09 at 15 50 25

That is not what I expect. Why doesn't the image align to the top of the box layout (i.e. the top of the window), just like a label or a list? That seems to be inconsistent behaviour.

We see the same issue when using a vertical box layout:

presenter := SpPresenter new.
presenter layout: (SpBoxLayout newTopToBottom
	add: (presenter newImage image: (presenter iconNamed: #smallError); yourself);
	add: (presenter newLabel label: 'Label'; yourself);
	yourself);
	open.
Screenshot 2024-06-09 at 16 03 49

While the label is aligned with the left side of the box layout (i.e. the left side of the window), the image is not aligned the same way.

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

No branches or pull requests

1 participant