Port the rest of the app
This commit is contained in:
parent
df4566fd1e
commit
c05edee2b5
11 changed files with 207 additions and 164 deletions
|
@ -2,8 +2,9 @@ use std::{cell::RefCell, rc::Rc};
|
|||
|
||||
use gpui::{
|
||||
overlay, point, prelude::FluentBuilder, px, rems, AnchorCorner, AnyElement, Bounds,
|
||||
DismissEvent, DispatchPhase, Element, ElementId, InteractiveBounds, IntoElement, LayoutId,
|
||||
ManagedView, MouseDownEvent, ParentElement, Pixels, Point, View, VisualContext, WindowContext,
|
||||
DismissEvent, DispatchPhase, Element, ElementContext, ElementId, InteractiveBounds,
|
||||
IntoElement, LayoutId, ManagedView, MouseDownEvent, ParentElement, Pixels, Point, View,
|
||||
VisualContext, WindowContext,
|
||||
};
|
||||
|
||||
use crate::{Clickable, Selectable};
|
||||
|
@ -134,7 +135,7 @@ impl<M: ManagedView> Element for PopoverMenu<M> {
|
|||
fn request_layout(
|
||||
&mut self,
|
||||
element_state: Option<Self::State>,
|
||||
cx: &mut WindowContext,
|
||||
cx: &mut ElementContext,
|
||||
) -> (gpui::LayoutId, Self::State) {
|
||||
let mut menu_layout_id = None;
|
||||
|
||||
|
@ -188,7 +189,7 @@ impl<M: ManagedView> Element for PopoverMenu<M> {
|
|||
&mut self,
|
||||
_: Bounds<gpui::Pixels>,
|
||||
element_state: &mut Self::State,
|
||||
cx: &mut WindowContext,
|
||||
cx: &mut ElementContext,
|
||||
) {
|
||||
if let Some(mut child) = element_state.child_element.take() {
|
||||
child.paint(cx);
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use std::{cell::RefCell, rc::Rc};
|
||||
|
||||
use gpui::{
|
||||
overlay, AnchorCorner, AnyElement, BorrowWindow, Bounds, DismissEvent, DispatchPhase, Element,
|
||||
ElementId, InteractiveBounds, IntoElement, LayoutId, ManagedView, MouseButton, MouseDownEvent,
|
||||
ParentElement, Pixels, Point, View, VisualContext, WindowContext,
|
||||
overlay, AnchorCorner, AnyElement, Bounds, DismissEvent, DispatchPhase, Element,
|
||||
ElementContext, ElementId, InteractiveBounds, IntoElement, LayoutId, ManagedView, MouseButton,
|
||||
MouseDownEvent, ParentElement, Pixels, Point, View, VisualContext, WindowContext,
|
||||
};
|
||||
|
||||
pub struct RightClickMenu<M: ManagedView> {
|
||||
|
@ -64,7 +64,7 @@ impl<M: ManagedView> Element for RightClickMenu<M> {
|
|||
fn request_layout(
|
||||
&mut self,
|
||||
element_state: Option<Self::State>,
|
||||
cx: &mut WindowContext,
|
||||
cx: &mut ElementContext,
|
||||
) -> (gpui::LayoutId, Self::State) {
|
||||
let (menu, position) = if let Some(element_state) = element_state {
|
||||
(element_state.menu, element_state.position)
|
||||
|
@ -116,7 +116,7 @@ impl<M: ManagedView> Element for RightClickMenu<M> {
|
|||
&mut self,
|
||||
bounds: Bounds<gpui::Pixels>,
|
||||
element_state: &mut Self::State,
|
||||
cx: &mut WindowContext,
|
||||
cx: &mut ElementContext,
|
||||
) {
|
||||
if let Some(mut child) = element_state.child_element.take() {
|
||||
child.paint(cx);
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
pub use gpui::prelude::*;
|
||||
pub use gpui::{
|
||||
div, px, relative, rems, AbsoluteLength, DefiniteLength, Div, Element, ElementId,
|
||||
InteractiveElement, ParentElement, Pixels, Rems, RenderOnce, SharedString, Styled, ViewContext,
|
||||
WindowContext,
|
||||
div, px, relative, rems, AbsoluteLength, DefiniteLength, Div, Element, ElementContext,
|
||||
ElementId, InteractiveElement, ParentElement, Pixels, Rems, RenderOnce, SharedString, Styled,
|
||||
ViewContext, WindowContext,
|
||||
};
|
||||
|
||||
pub use crate::clickable::*;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue