Rename Hooks to Hook

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2021-09-03 17:55:39 +02:00
parent 2f0f6e210d
commit f0775aeebc
3 changed files with 6 additions and 6 deletions

View file

@ -5,7 +5,7 @@ mod container;
mod empty;
mod event_handler;
mod flex;
mod hooks;
mod hook;
mod label;
mod line_box;
mod list;
@ -24,7 +24,7 @@ pub use container::*;
pub use empty::*;
pub use event_handler::*;
pub use flex::*;
pub use hooks::*;
pub use hook::*;
pub use label::*;
pub use line_box::*;
pub use list::*;

View file

@ -5,12 +5,12 @@ use crate::{
SizeConstraint,
};
pub struct Hooks {
pub struct Hook {
child: ElementBox,
after_layout: Option<Box<dyn FnMut(Vector2F, &mut LayoutContext)>>,
}
impl Hooks {
impl Hook {
pub fn new(child: ElementBox) -> Self {
Self {
child,
@ -27,7 +27,7 @@ impl Hooks {
}
}
impl Element for Hooks {
impl Element for Hook {
type LayoutState = ();
type PaintState = ();

View file

@ -116,7 +116,7 @@ impl Sidebar {
container.add_child(
Flexible::new(
1.,
Hooks::new(
Hook::new(
ConstrainedBox::new(ChildView::new(active_item.id()).boxed())
.with_max_width(*self.width.borrow())
.boxed(),