-
Notifications
You must be signed in to change notification settings - Fork 213
Migrate all logical pixel Property values to Length.
#1788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use masonry::core::{NewWidget, PropertySet, StyleProperty, Widget}; | ||
| use masonry::layout::{AsUnit as _, UnitPoint}; | ||
| use masonry::layout::{AsUnit, UnitPoint}; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary change. |
||
| use masonry::peniko::Color; | ||
| use masonry::properties::types::CrossAxisAlignment; | ||
| use masonry::properties::{Background, Padding}; | ||
|
|
@@ -43,10 +43,10 @@ impl DemoPage for KitchenSinkDemo { | |
| let grid = NewWidget::new(SizedBox::new(grid.prepare())).with_props( | ||
| PropertySet::new() | ||
| .with(Background::Color(Color::from_rgb8(0x24, 0x24, 0x24))) | ||
| .with(Padding::all(12.0)), | ||
| .with(Padding::all(12.px())), | ||
| ); | ||
|
|
||
| let bg = NewWidget::new(SizedBox::empty().size(220.0.px(), 120.0.px())).with_props( | ||
| let bg = NewWidget::new(SizedBox::empty().size(220.px(), 120.px())).with_props( | ||
| PropertySet::one(Background::Color(Color::from_rgb8(0x44, 0x22, 0x66))), | ||
| ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use masonry::core::{NewWidget, Widget}; | ||
| use masonry::layout::AsUnit as _; | ||
| use masonry::layout::AsUnit; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary change. |
||
| use masonry::properties::types::CrossAxisAlignment; | ||
| use masonry::widgets::{Flex, SizedBox, Spinner}; | ||
|
|
||
|
|
@@ -32,7 +32,7 @@ impl DemoPage for SpinnerDemo { | |
| .cross_axis_alignment(CrossAxisAlignment::Center) | ||
| .with_fixed( | ||
| SizedBox::new(Spinner::new().prepare()) | ||
| .size(80.0.px(), 80.0.px()) | ||
| .size(80.px(), 80.px()) | ||
| .prepare(), | ||
| ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use masonry::core::{NewWidget, PropertySet, StyleProperty, Widget}; | ||
| use masonry::layout::AsUnit as _; | ||
| use masonry::layout::AsUnit; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary change. |
||
| use masonry::peniko::Color; | ||
| use masonry::properties::{Background, Padding}; | ||
| use masonry::widgets::{Label, SizedBox, Split}; | ||
|
|
@@ -37,7 +37,7 @@ impl DemoPage for SplitDemo { | |
| .with_props( | ||
| PropertySet::new() | ||
| .with(Background::Color(Color::from_rgb8(0x1f, 0x2a, 0x44))) | ||
| .with(Padding::all(12.0)), | ||
| .with(Padding::all(12.px())), | ||
| ); | ||
|
|
||
| let right = NewWidget::new(SizedBox::new( | ||
|
|
@@ -48,11 +48,11 @@ impl DemoPage for SplitDemo { | |
| .with_props( | ||
| PropertySet::new() | ||
| .with(Background::Color(Color::from_rgb8(0x2b, 0x3c, 0x2f))) | ||
| .with(Padding::all(12.0)), | ||
| .with(Padding::all(12.px())), | ||
| ); | ||
|
|
||
| let body = SizedBox::new(Split::new(left, right).split_fraction(0.33).prepare()) | ||
| .height(260.0.px()); | ||
| let body = | ||
| SizedBox::new(Split::new(left, right).split_fraction(0.33).prepare()).height(260.px()); | ||
|
|
||
| wrap_in_shell(self.shell, NewWidget::new(body).erased()) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ use masonry::core::{ | |
| ErasedAction, Handled, NewWidget, PropertySet, StyleProperty, Widget, WidgetId, WidgetTag, | ||
| }; | ||
| use masonry::kurbo::{Affine, Vec2}; | ||
| use masonry::layout::AsUnit as _; | ||
| use masonry::layout::AsUnit; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary change. |
||
| use masonry::peniko::Color; | ||
| use masonry::properties::types::CrossAxisAlignment; | ||
| use masonry::properties::{Background, Padding}; | ||
|
|
@@ -108,13 +108,13 @@ impl DemoPage for TransformsDemo { | |
| .with_style(StyleProperty::FontSize(14.0)) | ||
| .prepare(), | ||
| ) | ||
| .size(160.0.px(), 160.0.px()), | ||
| .size(160.px(), 160.px()), | ||
| ) | ||
| .with_tag(self.target) | ||
| .with_props( | ||
| PropertySet::new() | ||
| .with(Background::Color(Color::from_rgb8(0x35, 0x35, 0x35))) | ||
| .with(Padding::all(12.0)), | ||
| .with(Padding::all(12.px())), | ||
| ); | ||
|
|
||
| let body = Flex::column() | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| // SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use crate::core::Widget as _; | ||
| use crate::layout::AsUnit as _; | ||
| use crate::layout::AsUnit; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unnecessary change. |
||
| use crate::palette::css::BLUE; | ||
| use crate::properties::{ContentColor, Dimensions, Gap}; | ||
| use crate::widgets::Button; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's essentially fallout from a search-replace of me "fixing" some new Rust Analyzer imports. I prefer the more compact
AsUnitas the name doesn't cause any conflicts being in scope. Both end up in the same result.