This PR improves the toggle button group to be more responsive across different layouts. This is accomplished by ensuring each button takes up the same amount of space in the parent containers layout. Ideally, this should be done with grids instead of a flexbox container, as this would be much better suited for this purpose. Yet, since we lack support for this, we go with this route for now. | Before | After | | --- | --- | | <img width="1608" height="1094" alt="Bildschirmfoto 2025-08-13 um 11 24 26" src="https://github.com/user-attachments/assets/2a4b5a59-6483-4f79-8fcb-e26e22071795" /> | <img width="1608" height="1094" alt="Bildschirmfoto 2025-08-13 um 11 29 36" src="https://github.com/user-attachments/assets/e6402729-6a8f-4a44-b79e-a569406edfff" /> | Release Notes: - N/A
11 lines
366 B
Rust
11 lines
366 B
Rust
use gpui::DefiniteLength;
|
|
|
|
/// A trait for elements that can have a fixed with. Enables the use of the `width` and `full_width` methods.
|
|
pub trait FixedWidth {
|
|
/// Sets the width of the element.
|
|
fn width(self, width: impl Into<DefiniteLength>) -> Self;
|
|
|
|
/// Sets the element's width to the full width of its container.
|
|
fn full_width(self) -> Self;
|
|
}
|