Replies: 2 comments 1 reply
-
I've just found that; for example, if you want a 30x30 image centered in a 120x120 container you can use this: ui.add_sized(
[120., 120.],
Image::new(self.texture.texture_id(ctx), vec2(30., 30.)),
); |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can also use one of those two to control spacing: ui.style_mut().spacing.item_spacing = vec2(16.0, 16.0);
ui.style_mut().spacing.indent = 16.0; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have some buttons in the top panel, as a kind of toolbar. I like a bit more space in my layouts, so I am wondering if there is a way to add spacing around the buttons, like panel padding. I would have thought the Spacing struct would handle that, but maybe not. Maybe it is somewhere else, or there is a way to fake it? I am still new to egui.
Thanks, and awesome work. No other GUI framework in Rust is this easy or convenient.
Beta Was this translation helpful? Give feedback.
All reactions