Rename *_space to space_x and space_y
This commit is contained in:
parent
c684fbd6af
commit
89b7585465
22 changed files with 92 additions and 113 deletions
|
|
@ -1017,7 +1017,7 @@ where
|
|||
/// # mod iced { pub mod widget { pub use iced_widget::*; } }
|
||||
/// # pub type State = ();
|
||||
/// # pub type Element<'a, Message> = iced_widget::core::Element<'a, Message, iced_widget::Theme, iced_widget::Renderer>;
|
||||
/// use iced::widget::{column, scrollable, vertical_space};
|
||||
/// use iced::widget::{column, scrollable, space_y};
|
||||
///
|
||||
/// enum Message {
|
||||
/// // ...
|
||||
|
|
@ -1026,7 +1026,7 @@ where
|
|||
/// fn view(state: &State) -> Element<'_, Message> {
|
||||
/// scrollable(column![
|
||||
/// "Scroll me!",
|
||||
/// vertical_space().height(3000),
|
||||
/// space_y().height(3000),
|
||||
/// "You did it!",
|
||||
/// ]).into()
|
||||
/// }
|
||||
|
|
@ -1733,7 +1733,7 @@ where
|
|||
/// horizontal space.
|
||||
///
|
||||
/// This can be useful to separate widgets in a [`Row`].
|
||||
pub fn horizontal_space() -> Space {
|
||||
pub fn space_x() -> Space {
|
||||
Space::with_width(Length::Fill)
|
||||
}
|
||||
|
||||
|
|
@ -1741,7 +1741,7 @@ pub fn horizontal_space() -> Space {
|
|||
/// vertical space.
|
||||
///
|
||||
/// This can be useful to separate widgets in a [`Column`].
|
||||
pub fn vertical_space() -> Space {
|
||||
pub fn space_y() -> Space {
|
||||
Space::with_height(Length::Fill)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ use crate::core::{
|
|||
self, Clipboard, Element, Event, Length, Rectangle, Shell, Size, Vector,
|
||||
Widget,
|
||||
};
|
||||
use crate::horizontal_space;
|
||||
use crate::space_x;
|
||||
|
||||
/// A widget that is aware of its dimensions.
|
||||
///
|
||||
|
|
@ -44,7 +44,7 @@ where
|
|||
view: Box::new(view),
|
||||
width: Length::Fill,
|
||||
height: Length::Fill,
|
||||
content: Element::new(horizontal_space().width(0)),
|
||||
content: Element::new(space_x().width(0)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
//! # mod iced { pub mod widget { pub use iced_widget::*; } }
|
||||
//! # pub type State = ();
|
||||
//! # pub type Element<'a, Message> = iced_widget::core::Element<'a, Message, iced_widget::Theme, iced_widget::Renderer>;
|
||||
//! use iced::widget::{column, scrollable, vertical_space};
|
||||
//! use iced::widget::{column, scrollable, space_y};
|
||||
//!
|
||||
//! enum Message {
|
||||
//! // ...
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
//! fn view(state: &State) -> Element<'_, Message> {
|
||||
//! scrollable(column![
|
||||
//! "Scroll me!",
|
||||
//! vertical_space().height(3000),
|
||||
//! space_y().height(3000),
|
||||
//! "You did it!",
|
||||
//! ]).into()
|
||||
//! }
|
||||
|
|
@ -48,7 +48,7 @@ pub use operation::scrollable::{AbsoluteOffset, RelativeOffset};
|
|||
/// # mod iced { pub mod widget { pub use iced_widget::*; } }
|
||||
/// # pub type State = ();
|
||||
/// # pub type Element<'a, Message> = iced_widget::core::Element<'a, Message, iced_widget::Theme, iced_widget::Renderer>;
|
||||
/// use iced::widget::{column, scrollable, vertical_space};
|
||||
/// use iced::widget::{column, scrollable, space_y};
|
||||
///
|
||||
/// enum Message {
|
||||
/// // ...
|
||||
|
|
@ -57,7 +57,7 @@ pub use operation::scrollable::{AbsoluteOffset, RelativeOffset};
|
|||
/// fn view(state: &State) -> Element<'_, Message> {
|
||||
/// scrollable(column![
|
||||
/// "Scroll me!",
|
||||
/// vertical_space().height(3000),
|
||||
/// space_y().height(3000),
|
||||
/// "You did it!",
|
||||
/// ]).into()
|
||||
/// }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue