update dock

This commit is contained in:
2026-08-19 11:00:21 +07:00
parent c8bf7eb5d3
commit cc4fcd315c
6 changed files with 25 additions and 126 deletions
+4 -11
View File
@@ -15,7 +15,7 @@ use gpui::prelude::FluentBuilder;
use gpui::{
AnyElement, AnyView, App, AppContext, Axis, Bounds, Context, Edges, Entity, EntityId,
EventEmitter, InteractiveElement as _, IntoElement, ParentElement as _, Pixels, Render,
SharedString, Styled, Subscription, WeakEntity, Window, actions, div,
SharedString, Styled, Subscription, WeakEntity, Window, actions, div, px,
};
use gpui_component::{ElementExt, Placement};
pub use panel::*;
@@ -52,6 +52,9 @@ pub(crate) fn t(key: &'static str) -> &'static str {
}
}
/// The fixed height of the tab bar, which doubles as the window title bar.
pub(crate) const TAB_BAR_HEIGHT: Pixels = px(44.);
/// A host-owned drag item, dragged into the dock by the application.
#[derive(Clone, Debug)]
pub struct AnyDrag {
@@ -115,9 +118,6 @@ pub struct DockArea {
/// Lock panels layout, but allow to resize.
locked: bool,
/// The panel style, default is [`PanelStyle::Default`](PanelStyle::Default).
pub(crate) panel_style: PanelStyle,
_subscriptions: Vec<Subscription>,
}
@@ -509,7 +509,6 @@ impl DockArea {
toggle_button_panels: Edges::default(),
toggle_button_visible: true,
locked: false,
panel_style: PanelStyle::default(),
_subscriptions: vec![],
};
@@ -523,12 +522,6 @@ impl DockArea {
self.bounds
}
/// Set the panel style of the dock area.
pub fn panel_style(mut self, style: PanelStyle) -> Self {
self.panel_style = style;
self
}
/// Set version of the dock area.
pub fn set_version(&mut self, version: usize, _: &mut Window, cx: &mut Context<Self>) {
self.version = Some(version);