Position incoming call notification on right hand side.
Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
b2b5df4428
commit
1c2f906e48
2 changed files with 10 additions and 5 deletions
|
@ -12,7 +12,7 @@ use std::{rc::Rc, sync::Arc};
|
||||||
pub use collab_panel::CollabPanel;
|
pub use collab_panel::CollabPanel;
|
||||||
pub use collab_titlebar_item::CollabTitlebarItem;
|
pub use collab_titlebar_item::CollabTitlebarItem;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
AppContext, GlobalPixels, Pixels, PlatformDisplay, Size, WindowBounds, WindowKind,
|
point, AppContext, GlobalPixels, Pixels, PlatformDisplay, Size, WindowBounds, WindowKind,
|
||||||
WindowOptions,
|
WindowOptions,
|
||||||
};
|
};
|
||||||
pub use panel_settings::{
|
pub use panel_settings::{
|
||||||
|
@ -102,13 +102,19 @@ fn notification_window_options(
|
||||||
screen: Rc<dyn PlatformDisplay>,
|
screen: Rc<dyn PlatformDisplay>,
|
||||||
window_size: Size<Pixels>,
|
window_size: Size<Pixels>,
|
||||||
) -> WindowOptions {
|
) -> WindowOptions {
|
||||||
let _notification_padding = Pixels::from(16.);
|
let notification_margin_width = GlobalPixels::from(16.);
|
||||||
|
let notification_margin_height = GlobalPixels::from(-0.) - GlobalPixels::from(48.);
|
||||||
|
|
||||||
let screen_bounds = screen.bounds();
|
let screen_bounds = screen.bounds();
|
||||||
let _size: Size<GlobalPixels> = window_size.into();
|
let size: Size<GlobalPixels> = window_size.into();
|
||||||
|
|
||||||
|
// todo!() use content bounds instead of screen.bounds and get rid of magics in point's 2nd argument.
|
||||||
let bounds = gpui::Bounds::<GlobalPixels> {
|
let bounds = gpui::Bounds::<GlobalPixels> {
|
||||||
origin: screen_bounds.origin,
|
origin: screen_bounds.upper_right()
|
||||||
|
- point(
|
||||||
|
size.width + notification_margin_width,
|
||||||
|
notification_margin_height,
|
||||||
|
),
|
||||||
size: window_size.into(),
|
size: window_size.into(),
|
||||||
};
|
};
|
||||||
WindowOptions {
|
WindowOptions {
|
||||||
|
|
|
@ -34,7 +34,6 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut AppContext) {
|
||||||
|
|
||||||
for window in unique_screens {
|
for window in unique_screens {
|
||||||
let options = notification_window_options(window, window_size);
|
let options = notification_window_options(window, window_size);
|
||||||
dbg!(&options);
|
|
||||||
let window = cx
|
let window = cx
|
||||||
.open_window(options, |cx| {
|
.open_window(options, |cx| {
|
||||||
cx.build_view(|_| {
|
cx.build_view(|_| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue