Merge pull request #159 from zed-industries/tabs-cleanup

Clean up tabs styling
This commit is contained in:
Nathan Sobo
2021-09-20 09:16:08 -07:00
committed by GitHub
4 changed files with 49 additions and 35 deletions
+11
View File
@@ -348,6 +348,17 @@ enum Spacing {
},
}
impl Padding {
pub fn uniform(padding: f32) -> Self {
Self {
top: padding,
left: padding,
bottom: padding,
right: padding,
}
}
}
impl ToJson for Padding {
fn to_json(&self) -> serde_json::Value {
let mut value = json!({});
+2 -1
View File
@@ -116,7 +116,8 @@ impl Element for MouseEventHandler {
let hit_bounds = RectF::from_points(
bounds.origin() - vec2f(self.padding.left, self.padding.top),
bounds.lower_right() + vec2f(self.padding.right, self.padding.bottom),
);
)
.round_out();
self.state.update(cx, |state, cx| match event {
Event::MouseMoved {