mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-07 21:37:49 +03:00
Rename Hooks
to Hook
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
2f0f6e210d
commit
f0775aeebc
@ -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::*;
|
||||
|
@ -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 = ();
|
||||
|
@ -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(),
|
||||
|
Loading…
Reference in New Issue
Block a user