collab_ui.rs

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