Remove MonitorHandle::size/refresh_rate_millihertz()

This commit is contained in:
daxpedda 2024-07-21 00:40:57 +02:00
parent 2e53533cc1
commit 0ffcfd8a3a
No known key found for this signature in database
GPG key ID: 43D62A3EA388E46F
13 changed files with 81 additions and 218 deletions

View file

@ -75,8 +75,8 @@ impl VideoModeHandle {
self.bit_depth
}
pub fn refresh_rate_millihertz(&self) -> u32 {
self.refresh_rate_millihertz
pub fn refresh_rate_millihertz(&self) -> Option<u32> {
Some(self.refresh_rate_millihertz)
}
pub fn monitor(&self) -> MonitorHandle {
@ -131,10 +131,8 @@ impl fmt::Debug for MonitorHandle {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("MonitorHandle")
.field("name", &self.name())
.field("size", &self.size())
.field("position", &self.position())
.field("scale_factor", &self.scale_factor())
.field("refresh_rate_millihertz", &self.refresh_rate_millihertz())
.finish_non_exhaustive()
}
}
@ -164,11 +162,6 @@ impl MonitorHandle {
})
}
pub fn size(&self) -> PhysicalSize<u32> {
let bounds = self.ui_screen.get_on_main(|ui_screen| ui_screen.nativeBounds());
PhysicalSize::new(bounds.size.width as u32, bounds.size.height as u32)
}
pub fn position(&self) -> PhysicalPosition<i32> {
let bounds = self.ui_screen.get_on_main(|ui_screen| ui_screen.nativeBounds());
(bounds.origin.x as f64, bounds.origin.y as f64).into()
@ -178,10 +171,6 @@ impl MonitorHandle {
self.ui_screen.get_on_main(|ui_screen| ui_screen.nativeScale()) as f64
}
pub fn refresh_rate_millihertz(&self) -> Option<u32> {
Some(self.ui_screen.get_on_main(|ui_screen| refresh_rate_millihertz(ui_screen)))
}
pub fn current_video_mode(&self) -> Option<VideoModeHandle> {
Some(run_on_main(|mtm| {
VideoModeHandle::new(