Refactor alignment types into an alignment module
This commit is contained in:
parent
5fae6e59ff
commit
a0ad399622
54 changed files with 402 additions and 377 deletions
|
|
@ -11,7 +11,7 @@ use iced::slider::{self, Slider};
|
|||
use iced::time;
|
||||
use iced::window;
|
||||
use iced::{
|
||||
Application, Checkbox, Column, Command, Container, CrossAlign, Element,
|
||||
Alignment, Application, Checkbox, Column, Command, Container, Element,
|
||||
Length, Row, Settings, Subscription, Text,
|
||||
};
|
||||
use preset::Preset;
|
||||
|
|
@ -158,10 +158,10 @@ impl Application for GameOfLife {
|
|||
mod grid {
|
||||
use crate::Preset;
|
||||
use iced::{
|
||||
alignment,
|
||||
canvas::event::{self, Event},
|
||||
canvas::{self, Cache, Canvas, Cursor, Frame, Geometry, Path, Text},
|
||||
mouse, Color, Element, HorizontalAlignment, Length, Point, Rectangle,
|
||||
Size, Vector, VerticalAlignment,
|
||||
mouse, Color, Element, Length, Point, Rectangle, Size, Vector,
|
||||
};
|
||||
use rustc_hash::{FxHashMap, FxHashSet};
|
||||
use std::future::Future;
|
||||
|
|
@ -498,8 +498,8 @@ mod grid {
|
|||
color: Color::WHITE,
|
||||
size: 14.0,
|
||||
position: Point::new(frame.width(), frame.height()),
|
||||
horizontal_alignment: HorizontalAlignment::Right,
|
||||
vertical_alignment: VerticalAlignment::Bottom,
|
||||
horizontal_alignment: alignment::Horizontal::Right,
|
||||
vertical_alignment: alignment::Vertical::Bottom,
|
||||
..Text::default()
|
||||
};
|
||||
|
||||
|
|
@ -844,7 +844,7 @@ impl Controls {
|
|||
|
||||
let speed_controls = Row::new()
|
||||
.width(Length::Fill)
|
||||
.align_items(CrossAlign::Center)
|
||||
.align_items(Alignment::Center)
|
||||
.spacing(10)
|
||||
.push(
|
||||
Slider::new(
|
||||
|
|
@ -860,7 +860,7 @@ impl Controls {
|
|||
Row::new()
|
||||
.padding(10)
|
||||
.spacing(20)
|
||||
.align_items(CrossAlign::Center)
|
||||
.align_items(Alignment::Center)
|
||||
.push(playback_controls)
|
||||
.push(speed_controls)
|
||||
.push(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue