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:  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:
parent
5ae145145e
commit
5bf0c8ed2d
15 changed files with 121 additions and 687 deletions
|
@ -29,7 +29,7 @@ use crate::{
|
|||
#[derive(Default)]
|
||||
pub(crate) struct Callbacks {
|
||||
request_frame: Option<Box<dyn FnMut()>>,
|
||||
input: Option<Box<dyn FnMut(crate::PlatformInput) -> crate::DispatchEventResult>>,
|
||||
input: Option<Box<dyn FnMut(crate::PlatformInput) -> bool>>,
|
||||
active_status_change: Option<Box<dyn FnMut(bool)>>,
|
||||
resize: Option<Box<dyn FnMut(Size<Pixels>, f32)>>,
|
||||
fullscreen: Option<Box<dyn FnMut(bool)>>,
|
||||
|
@ -237,7 +237,7 @@ impl WaylandWindowState {
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -279,11 +279,6 @@ impl PlatformWindow for WaylandWindow {
|
|||
unimplemented!()
|
||||
}
|
||||
|
||||
// todo(linux)
|
||||
fn is_maximized(&self) -> bool {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn content_size(&self) -> Size<Pixels> {
|
||||
let inner = self.0.inner.borrow_mut();
|
||||
Size {
|
||||
|
@ -383,7 +378,7 @@ impl PlatformWindow for WaylandWindow {
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue