1pub mod channel_view;
2pub mod chat_panel;
3pub mod collab_panel;
4pub mod notification_panel;
5pub mod notifications;
6mod panel_settings;
7
8use std::{rc::Rc, sync::Arc};
9
10pub use collab_panel::CollabPanel;
11use gpui::{
12 point, AppContext, Pixels, PlatformDisplay, Size, WindowBackgroundAppearance, WindowBounds,
13 WindowDecorations, WindowKind, WindowOptions,
14};
15use panel_settings::MessageEditorSettings;
16pub use panel_settings::{
17 ChatPanelSettings, CollaborationPanelSettings, NotificationPanelSettings,
18};
19use release_channel::ReleaseChannel;
20use settings::Settings;
21use ui::px;
22use workspace::AppState;
23
24pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
25 CollaborationPanelSettings::register(cx);
26 ChatPanelSettings::register(cx);
27 NotificationPanelSettings::register(cx);
28 MessageEditorSettings::register(cx);
29
30 channel_view::init(cx);
31 chat_panel::init(cx);
32 collab_panel::init(cx);
33 notification_panel::init(cx);
34 notifications::init(app_state, cx);
35 title_bar::init(cx);
36 vcs_menu::init(cx);
37}
38
39fn notification_window_options(
40 screen: Rc<dyn PlatformDisplay>,
41 size: Size<Pixels>,
42 cx: &AppContext,
43) -> WindowOptions {
44 let notification_margin_width = px(16.);
45 let notification_margin_height = px(-48.);
46
47 let bounds = gpui::Bounds::<Pixels> {
48 origin: screen.bounds().upper_right()
49 - point(
50 size.width + notification_margin_width,
51 notification_margin_height,
52 ),
53 size,
54 };
55
56 let app_id = ReleaseChannel::global(cx).app_id();
57
58 WindowOptions {
59 window_bounds: Some(WindowBounds::Windowed(bounds)),
60 titlebar: None,
61 focus: false,
62 show: true,
63 kind: WindowKind::PopUp,
64 is_movable: false,
65 display_id: Some(screen.id()),
66 window_background: WindowBackgroundAppearance::Transparent,
67 app_id: Some(app_id.to_owned()),
68 window_min_size: None,
69 window_decorations: Some(WindowDecorations::Client),
70 }
71}