Refactor alignment types into an alignment module

This commit is contained in:
Héctor Ramón Jiménez 2021-09-20 15:09:55 +07:00
parent 5fae6e59ff
commit a0ad399622
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
54 changed files with 402 additions and 377 deletions

View file

@ -1,10 +1,9 @@
//! Display a dropdown list of selectable values.
use crate::alignment;
use crate::backend::{self, Backend};
use crate::{Primitive, Renderer};
use iced_native::{
mouse, Font, HorizontalAlignment, Padding, Point, Rectangle,
VerticalAlignment,
};
use iced_native::{mouse, Font, Padding, Point, Rectangle};
use iced_style::menu;
pub use iced_native::pick_list::State;
@ -64,8 +63,8 @@ where
..bounds
},
color: style.text_color,
horizontal_alignment: HorizontalAlignment::Right,
vertical_alignment: VerticalAlignment::Center,
horizontal_alignment: alignment::Horizontal::Right,
vertical_alignment: alignment::Vertical::Center,
};
(
@ -85,8 +84,8 @@ where
y: bounds.center_y(),
..bounds
},
horizontal_alignment: HorizontalAlignment::Left,
vertical_alignment: VerticalAlignment::Center,
horizontal_alignment: alignment::Horizontal::Left,
vertical_alignment: alignment::Vertical::Center,
};
vec![background, label, arrow_down]