-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
How can I flex a collection of elements to be the same width/fill remaining space? #746
Comments
Have you tried to set the width of the buttons to Button::new(&mut state, "Press Me!").width(Length::Fill) |
Yes, this causes them to fill the width of the entire window. |
Just wrap all those buttons in a button group (Container) and give the container a specified width, then set all buttons width to Length::Fill. |
I don't want to specify a fixed width. In HTML/CSS you can just do this: <style>
#container {
display: flex;
}
#container .btn {
flex: 1;
}
</style>
<div id="container">
<div class="btn">...</div>
<div class="btn">...</div>
<div class="btn">...</div>
...
</div> No need to specify any widths. The Druid is capable of this, which apparently the flex component of iced is inspired by: linebender/druid#1608 (comment) |
Is the fix of this particularly hard? Can I perhaps contribute in any way (I haven't yet looked at the inner workings of iced)? I'm doing a school project with iced which depends on this functionality, and I need to know if this has potential to land in time, or if I'm better off migrating to druid. |
You might be better off with using Tauri, I found the data model of Druid very complex and the documentation is very poor. I don't think we're GUI yet, at least for a full blown application. |
How could I flex these buttons to fill the remaining space (designated by the red square)?
Code
Result
The text was updated successfully, but these errors were encountered: