fmt
This commit is contained in:
parent
5797282b98
commit
331fd896b5
3 changed files with 14 additions and 7 deletions
|
@ -536,7 +536,7 @@ mod element {
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
pane_group::{HANDLE_HITBOX_SIZE, HORIZONTAL_MIN_SIZE, VERTICAL_MIN_SIZE},
|
pane_group::{HANDLE_HITBOX_SIZE, HORIZONTAL_MIN_SIZE, VERTICAL_MIN_SIZE},
|
||||||
WorkspaceSettings, Workspace,
|
Workspace, WorkspaceSettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct PaneAxisElement {
|
pub struct PaneAxisElement {
|
||||||
|
@ -547,7 +547,7 @@ mod element {
|
||||||
children: Vec<AnyElement<Workspace>>,
|
children: Vec<AnyElement<Workspace>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PaneAxisElement {
|
impl PaneAxisElement {
|
||||||
pub fn new(axis: Axis, basis: usize, flexes: Rc<RefCell<Vec<f32>>>) -> Self {
|
pub fn new(axis: Axis, basis: usize, flexes: Rc<RefCell<Vec<f32>>>) -> Self {
|
||||||
Self {
|
Self {
|
||||||
axis,
|
axis,
|
||||||
|
@ -761,8 +761,9 @@ mod element {
|
||||||
self.basis + ix,
|
self.basis + ix,
|
||||||
handle_bounds,
|
handle_bounds,
|
||||||
);
|
);
|
||||||
mouse_region =
|
mouse_region = mouse_region.on_drag(
|
||||||
mouse_region.on_drag(MouseButton::Left, move |drag, workspace: &mut Workspace, cx| {
|
MouseButton::Left,
|
||||||
|
move |drag, workspace: &mut Workspace, cx| {
|
||||||
let min_size = match axis {
|
let min_size = match axis {
|
||||||
Axis::Horizontal => HORIZONTAL_MIN_SIZE,
|
Axis::Horizontal => HORIZONTAL_MIN_SIZE,
|
||||||
Axis::Vertical => VERTICAL_MIN_SIZE,
|
Axis::Vertical => VERTICAL_MIN_SIZE,
|
||||||
|
@ -805,7 +806,8 @@ mod element {
|
||||||
|
|
||||||
workspace.schedule_serialize(cx);
|
workspace.schedule_serialize(cx);
|
||||||
cx.notify();
|
cx.notify();
|
||||||
});
|
},
|
||||||
|
);
|
||||||
scene.push_mouse_region(mouse_region);
|
scene.push_mouse_region(mouse_region);
|
||||||
|
|
||||||
scene.pop_stacking_context();
|
scene.pop_stacking_context();
|
||||||
|
|
|
@ -161,7 +161,11 @@ impl SerializedPaneGroup {
|
||||||
Vec<Option<Box<dyn ItemHandle>>>,
|
Vec<Option<Box<dyn ItemHandle>>>,
|
||||||
)> {
|
)> {
|
||||||
match self {
|
match self {
|
||||||
SerializedPaneGroup::Group { axis, children, flexes } => {
|
SerializedPaneGroup::Group {
|
||||||
|
axis,
|
||||||
|
children,
|
||||||
|
flexes,
|
||||||
|
} => {
|
||||||
let mut current_active_pane = None;
|
let mut current_active_pane = None;
|
||||||
let mut members = Vec::new();
|
let mut members = Vec::new();
|
||||||
let mut items = Vec::new();
|
let mut items = Vec::new();
|
||||||
|
|
|
@ -2898,7 +2898,8 @@ impl Workspace {
|
||||||
fn schedule_serialize(&mut self, cx: &mut ViewContext<Self>) {
|
fn schedule_serialize(&mut self, cx: &mut ViewContext<Self>) {
|
||||||
self._schedule_serialize = Some(cx.spawn(|this, cx| async move {
|
self._schedule_serialize = Some(cx.spawn(|this, cx| async move {
|
||||||
cx.background().timer(Duration::from_millis(100)).await;
|
cx.background().timer(Duration::from_millis(100)).await;
|
||||||
this.read_with(&cx, |this, cx| this.serialize_workspace(cx)).ok();
|
this.read_with(&cx, |this, cx| this.serialize_workspace(cx))
|
||||||
|
.ok();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue