Fix last thing
This commit is contained in:
parent
5c0f2e75ea
commit
8049ec674e
4 changed files with 19 additions and 25 deletions
|
@ -63,7 +63,6 @@ pub struct SendKeystroke(String);
|
||||||
actions!(Clear, Copy, Paste, ShowCharacterPalette, SearchTest);
|
actions!(Clear, Copy, Paste, ShowCharacterPalette, SearchTest);
|
||||||
|
|
||||||
pub fn init(cx: &mut AppContext) {
|
pub fn init(cx: &mut AppContext) {
|
||||||
workspace::ui::init(cx);
|
|
||||||
terminal_panel::init(cx);
|
terminal_panel::init(cx);
|
||||||
terminal::init(cx);
|
terminal::init(cx);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
use gpui::{div, AnyElement, ClickEvent, Div, RenderOnce, Stateful, StatefulInteractiveElement};
|
use gpui::{
|
||||||
|
div, px, AnyElement, ClickEvent, Div, RenderOnce, Stateful, StatefulInteractiveElement,
|
||||||
|
};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use crate::settings::user_settings;
|
|
||||||
use crate::{
|
use crate::{
|
||||||
disclosure_control, h_stack, v_stack, Avatar, Icon, IconElement, IconSize, Label, Toggle,
|
disclosure_control, h_stack, v_stack, Avatar, Icon, IconElement, IconSize, Label, Toggle,
|
||||||
};
|
};
|
||||||
|
@ -331,8 +332,6 @@ impl Component for ListItem {
|
||||||
type Rendered = Stateful<Div>;
|
type Rendered = Stateful<Div>;
|
||||||
|
|
||||||
fn render(self, cx: &mut WindowContext) -> Self::Rendered {
|
fn render(self, cx: &mut WindowContext) -> Self::Rendered {
|
||||||
let settings = user_settings(cx);
|
|
||||||
|
|
||||||
let left_content = match self.left_slot.clone() {
|
let left_content = match self.left_slot.clone() {
|
||||||
Some(GraphicSlot::Icon(i)) => Some(
|
Some(GraphicSlot::Icon(i)) => Some(
|
||||||
h_stack().child(
|
h_stack().child(
|
||||||
|
@ -377,7 +376,7 @@ impl Component for ListItem {
|
||||||
// .ml(rems(0.75 * self.indent_level as f32))
|
// .ml(rems(0.75 * self.indent_level as f32))
|
||||||
.children((0..self.indent_level).map(|_| {
|
.children((0..self.indent_level).map(|_| {
|
||||||
div()
|
div()
|
||||||
.w(*settings.list_indent_depth)
|
.w(px(4.))
|
||||||
.h_full()
|
.h_full()
|
||||||
.flex()
|
.flex()
|
||||||
.justify_center()
|
.justify_center()
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
use gpui::px;
|
||||||
use gpui::{prelude::*, AbsoluteLength, AnyElement, Div, RenderOnce};
|
use gpui::{prelude::*, AbsoluteLength, AnyElement, Div, RenderOnce};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::settings::user_settings;
|
|
||||||
use crate::v_stack;
|
use crate::v_stack;
|
||||||
|
|
||||||
#[derive(Default, Debug, PartialEq, Eq, Hash, Clone, Copy)]
|
#[derive(Default, Debug, PartialEq, Eq, Hash, Clone, Copy)]
|
||||||
|
@ -75,13 +75,11 @@ impl Component for Panel {
|
||||||
|
|
||||||
impl Panel {
|
impl Panel {
|
||||||
pub fn new(id: impl Into<ElementId>, cx: &mut WindowContext) -> Self {
|
pub fn new(id: impl Into<ElementId>, cx: &mut WindowContext) -> Self {
|
||||||
let settings = user_settings(cx);
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
id: id.into(),
|
id: id.into(),
|
||||||
current_side: PanelSide::default(),
|
current_side: PanelSide::default(),
|
||||||
allowed_sides: PanelAllowedSides::default(),
|
allowed_sides: PanelAllowedSides::default(),
|
||||||
initial_width: *settings.default_panel_size,
|
initial_width: px(320.).into(),
|
||||||
width: None,
|
width: None,
|
||||||
children: SmallVec::new(),
|
children: SmallVec::new(),
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,9 @@ use schemars::JsonSchema;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use theme2::ActiveTheme;
|
use theme2::ActiveTheme;
|
||||||
use ui::{h_stack, menu_handle, ContextMenu, IconButton, InteractionState, Tooltip};
|
use ui::{
|
||||||
|
h_stack, menu_handle, ContextMenu, IconButton, InteractionState, Label, ListItem, Tooltip,
|
||||||
|
};
|
||||||
|
|
||||||
pub enum PanelEvent {
|
pub enum PanelEvent {
|
||||||
ChangePosition,
|
ChangePosition,
|
||||||
|
@ -711,25 +713,21 @@ impl Render for PanelButtons {
|
||||||
DockPosition::Bottom,
|
DockPosition::Bottom,
|
||||||
];
|
];
|
||||||
|
|
||||||
//CX: Pane
|
|
||||||
ContextMenu::build(cx, |mut menu, cx| {
|
ContextMenu::build(cx, |mut menu, cx| {
|
||||||
// CX: Menu
|
|
||||||
for position in POSITIONS {
|
for position in POSITIONS {
|
||||||
if position != dock_position
|
if position != dock_position
|
||||||
&& panel.position_is_valid(position, cx)
|
&& panel.position_is_valid(position, cx)
|
||||||
{
|
{
|
||||||
// let panel = panel.clone();
|
let panel = panel.clone();
|
||||||
todo!()
|
menu = menu.entry(
|
||||||
// menu = menu.entry(
|
ListItem::new(
|
||||||
// ListEntry::new(Label::new(format!(
|
panel.entity_id(),
|
||||||
// "Dock {}",
|
Label::new(format!("Dock {}", position.to_label())),
|
||||||
// position.to_label()
|
),
|
||||||
// ))),
|
move |_, cx| {
|
||||||
// cx.listener(move |_, cx| {
|
panel.set_position(position, cx);
|
||||||
// //What should CX be? CX: Pane
|
},
|
||||||
// panel.set_position(position, cx);
|
)
|
||||||
// }),
|
|
||||||
//)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
menu
|
menu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue