gpui_macros: Extract border_style_methods
macro (#14514)
This PR extracts a separate `border_style_methods` macro so that it can be used independently from `style_helpers!`. Release Notes: - N/A
This commit is contained in:
parent
fa3d29087d
commit
143035b1ed
3 changed files with 59 additions and 37 deletions
|
@ -5,8 +5,9 @@ use crate::{
|
|||
SharedString, StyleRefinement, WhiteSpace,
|
||||
};
|
||||
pub use gpui_macros::{
|
||||
box_shadow_style_methods, cursor_style_methods, margin_style_methods, overflow_style_methods,
|
||||
padding_style_methods, position_style_methods, visibility_style_methods,
|
||||
border_style_methods, box_shadow_style_methods, cursor_style_methods, margin_style_methods,
|
||||
overflow_style_methods, padding_style_methods, position_style_methods,
|
||||
visibility_style_methods,
|
||||
};
|
||||
use taffy::style::{AlignContent, Display};
|
||||
|
||||
|
@ -23,6 +24,7 @@ pub trait Styled: Sized {
|
|||
gpui_macros::position_style_methods!();
|
||||
gpui_macros::overflow_style_methods!();
|
||||
gpui_macros::cursor_style_methods!();
|
||||
gpui_macros::border_style_methods!();
|
||||
gpui_macros::box_shadow_style_methods!();
|
||||
|
||||
/// Sets the display type of the element to `block`.
|
||||
|
@ -303,16 +305,6 @@ pub trait Styled: Sized {
|
|||
self
|
||||
}
|
||||
|
||||
/// Sets the border color of the element.
|
||||
fn border_color<C>(mut self, border_color: C) -> Self
|
||||
where
|
||||
C: Into<Hsla>,
|
||||
Self: Sized,
|
||||
{
|
||||
self.style().border_color = Some(border_color.into());
|
||||
self
|
||||
}
|
||||
|
||||
/// Get the text style that has been configured on this element.
|
||||
fn text_style(&mut self) -> &mut Option<TextStyleRefinement> {
|
||||
let style: &mut StyleRefinement = self.style();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue