collab_ui.rs

 1mod call_stats_modal;
 2pub mod channel_view;
 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    App, Pixels, PlatformDisplay, Size, WindowBackgroundAppearance, WindowBounds,
13    WindowDecorations, WindowKind, WindowOptions, point,
14};
15pub use panel_settings::{CollaborationPanelSettings, NotificationPanelSettings};
16use release_channel::ReleaseChannel;
17use ui::px;
18use workspace::AppState;
19
20// Another comment, nice.
21pub fn init(app_state: &Arc<AppState>, cx: &mut App) {
22    call_stats_modal::init(cx);
23    channel_view::init(cx);
24    collab_panel::init(cx);
25    notification_panel::init(cx);
26    notifications::init(app_state, cx);
27    title_bar::init(cx);
28}
29
30fn notification_window_options(
31    screen: Rc<dyn PlatformDisplay>,
32    size: Size<Pixels>,
33    cx: &App,
34) -> WindowOptions {
35    let notification_margin_width = px(16.);
36    let notification_margin_height = px(-48.);
37
38    let bounds = gpui::Bounds::<Pixels> {
39        origin: screen.bounds().top_right()
40            - point(
41                size.width + notification_margin_width,
42                notification_margin_height,
43            ),
44        size,
45    };
46
47    let app_id = ReleaseChannel::global(cx).app_id();
48
49    WindowOptions {
50        window_bounds: Some(WindowBounds::Windowed(bounds)),
51        titlebar: None,
52        focus: false,
53        show: true,
54        kind: WindowKind::PopUp,
55        is_movable: false,
56        display_id: Some(screen.id()),
57        window_background: WindowBackgroundAppearance::Transparent,
58        app_id: Some(app_id.to_owned()),
59        window_min_size: None,
60        window_decorations: Some(WindowDecorations::Client),
61        tabbing_identifier: None,
62        ..Default::default()
63    }
64}