Checkpoint
This commit is contained in:
parent
cec5280013
commit
18abb068b1
1 changed files with 51 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
group_bounds, AnyElement, BorrowWindow, Bounds, DispatchPhase, Element, ElementId,
|
group_bounds, AnyElement, BorrowWindow, Bounds, DispatchPhase, Element, ElementId,
|
||||||
IdentifiedElement, IntoAnyElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, SharedString,
|
IdentifiedElement, IntoAnyElement, MouseDownEvent, MouseMoveEvent, MouseUpEvent, Overflow,
|
||||||
Style, StyleCascade, StyleRefinement, ViewContext,
|
ScrollState, SharedString, Style, StyleCascade, StyleRefinement, ViewContext,
|
||||||
};
|
};
|
||||||
use parking_lot::Mutex;
|
use parking_lot::Mutex;
|
||||||
use refineable::{CascadeSlot, Refineable};
|
use refineable::{CascadeSlot, Refineable};
|
||||||
|
@ -466,6 +466,55 @@ pub struct Div<V: 'static + Send + Sync, K: ElementKind>(
|
||||||
ClickableElement<HoverableElement<LayoutNodeElement<V, K>>>,
|
ClickableElement<HoverableElement<LayoutNodeElement<V, K>>>,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
impl<V: 'static + Send + Sync, K: ElementKind> Div<V, K> {
|
||||||
|
pub fn z_index(mut self, z_index: u32) -> Self {
|
||||||
|
self.base_style().z_index = Some(z_index);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn overflow_hidden(mut self) -> Self {
|
||||||
|
self.base_style().overflow.x = Some(Overflow::Hidden);
|
||||||
|
self.base_style().overflow.y = Some(Overflow::Hidden);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn overflow_hidden_x(mut self) -> Self {
|
||||||
|
self.base_style().overflow.x = Some(Overflow::Hidden);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn overflow_hidden_y(mut self) -> Self {
|
||||||
|
self.base_style().overflow.y = Some(Overflow::Hidden);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn overflow_scroll(mut self, scroll_state: ScrollState) -> Self {
|
||||||
|
// todo!("impl scrolling")
|
||||||
|
// self.scroll_state = Some(scroll_state);
|
||||||
|
self.base_style().overflow.x = Some(Overflow::Scroll);
|
||||||
|
self.base_style().overflow.y = Some(Overflow::Scroll);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn overflow_x_scroll(mut self, scroll_state: ScrollState) -> Self {
|
||||||
|
// todo!("impl scrolling")
|
||||||
|
// self.scroll_state = Some(scroll_state);
|
||||||
|
self.base_style().overflow.x = Some(Overflow::Scroll);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn overflow_y_scroll(mut self, scroll_state: ScrollState) -> Self {
|
||||||
|
// todo!("impl scrolling")
|
||||||
|
// self.scroll_state = Some(scroll_state);
|
||||||
|
self.base_style().overflow.y = Some(Overflow::Scroll);
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
fn base_style(&mut self) -> &mut StyleRefinement {
|
||||||
|
self.style_cascade().base()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<V: 'static + Send + Sync> Div<V, Anonymous> {
|
impl<V: 'static + Send + Sync> Div<V, Anonymous> {
|
||||||
pub fn id(self, id: impl Into<ElementId>) -> Div<V, Identified> {
|
pub fn id(self, id: impl Into<ElementId>) -> Div<V, Identified> {
|
||||||
Div(self.0.replace_child(|hoverable| {
|
Div(self.0.replace_child(|hoverable| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue