Revert "windows: better looking titlebar" and follow-up (#9392)

This reverts #9053 and #9375 because they introduced a regression on
`main` that broke the titlebars on macOS:


![image](https://github.com/zed-industries/zed/assets/1185253/d046003b-5c66-4a42-9385-623f5d58c9a4)

Two things are off:

- Left padding is missing
- Titlebar height is less than it was before, which means the
traffic-light buttons are not centered vertically

What @as-cii and I noticed while looking into this: the `cfg!(macos)`
macros that were used don't work like that. You need to check for
`cfg!(target = "macos")` etc. Means that on macOS we never used the
macOS-specific code because the condition was always false.

Overall height, we're not sure about.

Release Notes:

- N/A
This commit is contained in:
Thorsten Ball 2024-03-15 12:25:51 +01:00 committed by GitHub
parent 5ae145145e
commit 5bf0c8ed2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 121 additions and 687 deletions

View file

@ -31,7 +31,7 @@ use super::X11Display;
#[derive(Default)]
struct Callbacks {
request_frame: Option<Box<dyn FnMut()>>,
input: Option<Box<dyn FnMut(PlatformInput) -> crate::DispatchEventResult>>,
input: Option<Box<dyn FnMut(PlatformInput) -> bool>>,
active_status_change: Option<Box<dyn FnMut(bool)>>,
resize: Option<Box<dyn FnMut(Size<Pixels>, f32)>>,
fullscreen: Option<Box<dyn FnMut(bool)>>,
@ -303,7 +303,7 @@ impl X11WindowState {
pub fn handle_input(&self, input: PlatformInput) {
if let Some(ref mut fun) = self.callbacks.borrow_mut().input {
if !fun(input.clone()).propagate {
if fun(input.clone()) {
return;
}
}
@ -333,11 +333,6 @@ impl PlatformWindow for X11Window {
.map(|v| GlobalPixels(v as f32))
}
// todo(linux)
fn is_maximized(&self) -> bool {
unimplemented!()
}
fn content_size(&self) -> Size<Pixels> {
self.0.inner.borrow_mut().content_size()
}
@ -456,7 +451,7 @@ impl PlatformWindow for X11Window {
self.0.callbacks.borrow_mut().request_frame = Some(callback);
}
fn on_input(&self, callback: Box<dyn FnMut(PlatformInput) -> crate::DispatchEventResult>) {
fn on_input(&self, callback: Box<dyn FnMut(PlatformInput) -> bool>) {
self.0.callbacks.borrow_mut().input = Some(callback);
}