Implement FixedWidth for all button types

[no-ci]

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Nate Butler 2023-12-01 16:20:39 -05:00
parent c07455efa7
commit 03ebf0a5a9
3 changed files with 43 additions and 2 deletions

View file

@ -1,4 +1,4 @@
use gpui::AnyView;
use gpui::{AnyView, DefiniteLength};
use crate::prelude::*;
use crate::{ButtonCommon, ButtonLike, ButtonSize, ButtonStyle, Label, LineHeightStyle};
@ -49,6 +49,18 @@ impl Clickable for Button {
}
}
impl FixedWidth for Button {
fn width(mut self, width: DefiniteLength) -> Self {
self.base = self.base.width(width);
self
}
fn full_width(mut self) -> Self {
self.base = self.base.full_width();
self
}
}
impl ButtonCommon for Button {
fn id(&self) -> &ElementId {
self.base.id()