update dock

This commit is contained in:
2026-08-19 09:14:42 +07:00
parent 6a3e9604c9
commit 071cb9e714
6 changed files with 758 additions and 288 deletions
+12 -5
View File
@@ -1,14 +1,14 @@
use std::sync::Arc;
use assets::CustomIconName;
use dock::{DockArea, DockPlacement, Panel, PanelEvent, title_bar_drag_handlers};
use gpui::prelude::*;
use gpui::{
App, ClickEvent, Context, ElementId, EventEmitter, FocusHandle, Focusable, Render,
SharedString, StyleRefinement, Subscription, WeakEntity, Window, div,
SharedString, StyleRefinement, Subscription, WeakEntity, Window, div, px,
};
use gpui_component::avatar::Avatar;
use gpui_component::button::{Button, ButtonVariants};
use dock::{DockArea, DockPlacement, Panel, PanelEvent};
use gpui_component::input::InputState;
use gpui_component::{ActiveTheme, Icon, IconName, Sizable, StyledExt, h_flex, v_flex};
use signed_state::{Backend, BackendEvent, ProfileStore};
@@ -129,7 +129,7 @@ impl Focusable for SidebarPanel {
}
impl Render for SidebarPanel {
fn render(&mut self, _window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
fn render(&mut self, window: &mut Window, cx: &mut Context<Self>) -> impl IntoElement {
if !self.logged_in {
return v_flex()
.p_4()
@@ -183,11 +183,16 @@ impl Render for SidebarPanel {
let name = profile.name();
let picture = profile.picture();
this.child(
this.child(title_bar_drag_handlers(
h_flex()
.id("sidebar-profile")
.h_12()
.px_3()
.gap_2()
// The macOS traffic lights overlay the
// top-left corner of the window; keep the
// profile content clear of them.
.when(cfg!(target_os = "macos"), |this| this.pl(px(80.)))
.child(
Avatar::new()
.name(name.clone())
@@ -196,7 +201,9 @@ impl Render for SidebarPanel {
.border_0(),
)
.child(div().text_sm().child(name)),
)
window,
cx,
))
})
.child(
v_flex()