Skip to content

Commit

Permalink
Fix examples and removed stale function
Browse files Browse the repository at this point in the history
The setting on the view side remained when it was removed on the widget side. This removes the view setter, and removes the references to it.
  • Loading branch information
jaredoconnell committed Jan 13, 2025
1 parent 7621f6a commit 0fbf0f6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
4 changes: 1 addition & 3 deletions xilem/examples/http_cats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ impl HttpCats {
portal(sized_box(info_area).expand_width()).flex(1.),
))
.direction(Axis::Horizontal)
.must_fill_major_axis(true)
.flex(1.),
))
.must_fill_major_axis(true),
)),
worker(
worker_value,
|proxy, mut rx| async move {
Expand Down
4 changes: 2 additions & 2 deletions xilem/examples/stopwatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ fn app_logic(data: &mut Stopwatch) -> impl WidgetView<Stopwatch> {
flex((
FlexSpacer::Fixed(5.0),
label(get_formatted_duration(data.displayed_duration)).text_size(70.0),
flex((lap_reset_button(data), start_stop_button(data))).direction(Axis::Horizontal),
flex((lap_reset_button(data), start_stop_button(data)))
.direction(Axis::Horizontal).main_axis_alignment(MainAxisAlignment::Center),
FlexSpacer::Fixed(1.0),
laps_section(data),
label(data.displayed_error.as_ref()),
Expand Down Expand Up @@ -173,7 +174,6 @@ fn single_lap(
.direction(Axis::Horizontal)
.cross_axis_alignment(CrossAxisAlignment::Center)
.main_axis_alignment(MainAxisAlignment::Start)
.must_fill_major_axis(true)
}

fn start_stop_button(data: &mut Stopwatch) -> impl WidgetView<Stopwatch> {
Expand Down
1 change: 0 additions & 1 deletion xilem/examples/variable_clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ impl TimeZone {
},
),
))
.must_fill_major_axis(true)
.direction(Axis::Horizontal)
.flex(1.),
flex((
Expand Down
7 changes: 0 additions & 7 deletions xilem/src/view/flex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ pub fn flex<State, Action, Seq: FlexSequence<State, Action>>(
axis: Axis::Vertical,
cross_axis_alignment: CrossAxisAlignment::Center,
main_axis_alignment: MainAxisAlignment::Start,
fill_major_axis: false,
gap: None,
phantom: PhantomData,
}
Expand All @@ -33,7 +32,6 @@ pub struct Flex<Seq, State, Action = ()> {
axis: Axis,
cross_axis_alignment: CrossAxisAlignment,
main_axis_alignment: MainAxisAlignment,
fill_major_axis: bool,
gap: Option<f64>,
phantom: PhantomData<fn() -> (State, Action)>,
}
Expand All @@ -53,11 +51,6 @@ impl<Seq, State, Action> Flex<Seq, State, Action> {
self
}

pub fn must_fill_major_axis(mut self, fill_major_axis: bool) -> Self {
self.fill_major_axis = fill_major_axis;
self
}

/// Set the spacing along the major axis between any two elements in logical pixels.
///
/// Equivalent to the css [gap] property.
Expand Down

0 comments on commit 0fbf0f6

Please sign in to comment.