Generalize Refineable derive macro to derive arbitrary traits on the refinement type
This commit is contained in:
@@ -9,7 +9,7 @@ use std::{
|
||||
};
|
||||
|
||||
#[derive(Refineable, Default, Add, AddAssign, Sub, SubAssign, Copy, Debug, PartialEq, Eq, Hash)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct Point<T: Default + Clone + Debug> {
|
||||
pub x: T,
|
||||
@@ -140,7 +140,7 @@ impl<T: Clone + Default + Debug> Clone for Point<T> {
|
||||
}
|
||||
|
||||
#[derive(Refineable, Default, Clone, Copy, PartialEq, Div, Hash, Serialize, Deserialize)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct Size<T: Clone + Default + Debug> {
|
||||
pub width: T,
|
||||
@@ -313,7 +313,7 @@ impl Size<Length> {
|
||||
}
|
||||
|
||||
#[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct Bounds<T: Clone + Default + Debug> {
|
||||
pub origin: Point<T>,
|
||||
@@ -477,7 +477,7 @@ impl Bounds<Pixels> {
|
||||
impl<T: Clone + Debug + Copy + Default> Copy for Bounds<T> {}
|
||||
|
||||
#[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct Edges<T: Clone + Default + Debug> {
|
||||
pub top: T,
|
||||
@@ -619,7 +619,7 @@ impl Edges<Pixels> {
|
||||
}
|
||||
|
||||
#[derive(Refineable, Clone, Default, Debug, Eq, PartialEq)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
#[repr(C)]
|
||||
pub struct Corners<T: Clone + Default + Debug> {
|
||||
pub top_left: T,
|
||||
|
||||
@@ -14,7 +14,7 @@ pub use taffy::style::{
|
||||
pub type StyleCascade = Cascade<Style>;
|
||||
|
||||
#[derive(Clone, Refineable, Debug)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
pub struct Style {
|
||||
/// What layout strategy should be used?
|
||||
pub display: Display,
|
||||
@@ -129,7 +129,7 @@ pub struct BoxShadow {
|
||||
}
|
||||
|
||||
#[derive(Refineable, Clone, Debug)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
pub struct TextStyle {
|
||||
pub color: Hsla,
|
||||
pub font_family: SharedString,
|
||||
@@ -353,7 +353,7 @@ impl Default for Style {
|
||||
}
|
||||
|
||||
#[derive(Refineable, Copy, Clone, Default, Debug, PartialEq, Eq)]
|
||||
#[refineable(debug)]
|
||||
#[refineable(Debug)]
|
||||
pub struct UnderlineStyle {
|
||||
pub thickness: Pixels,
|
||||
pub color: Option<Hsla>,
|
||||
|
||||
Reference in New Issue
Block a user