
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
44 lines
904 B
Rust
44 lines
904 B
Rust
use windows::Win32::{Foundation::*, UI::WindowsAndMessaging::*};
|
|
|
|
pub(crate) trait HiLoWord {
|
|
fn hiword(&self) -> u16;
|
|
fn loword(&self) -> u16;
|
|
fn signed_hiword(&self) -> i16;
|
|
fn signed_loword(&self) -> i16;
|
|
}
|
|
|
|
impl HiLoWord for WPARAM {
|
|
fn hiword(&self) -> u16 {
|
|
((self.0 >> 16) & 0xFFFF) as u16
|
|
}
|
|
|
|
fn loword(&self) -> u16 {
|
|
(self.0 & 0xFFFF) as u16
|
|
}
|
|
|
|
fn signed_hiword(&self) -> i16 {
|
|
((self.0 >> 16) & 0xFFFF) as i16
|
|
}
|
|
|
|
fn signed_loword(&self) -> i16 {
|
|
(self.0 & 0xFFFF) as i16
|
|
}
|
|
}
|
|
|
|
impl HiLoWord for LPARAM {
|
|
fn hiword(&self) -> u16 {
|
|
((self.0 >> 16) & 0xFFFF) as u16
|
|
}
|
|
|
|
fn loword(&self) -> u16 {
|
|
(self.0 & 0xFFFF) as u16
|
|
}
|
|
|
|
fn signed_hiword(&self) -> i16 {
|
|
((self.0 >> 16) & 0xFFFF) as i16
|
|
}
|
|
|
|
fn signed_loword(&self) -> i16 {
|
|
(self.0 & 0xFFFF) as i16
|
|
}
|
|
}
|