mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-12-26 07:52:05 +03:00
show recommended scale factor in options [rebuild]
This commit is contained in:
parent
ad4ebeeb61
commit
01b5617840
@ -261,4 +261,8 @@ impl PrerenderInnards {
|
||||
}
|
||||
|
||||
pub fn window_resized(&self, _: f64, _: f64) {}
|
||||
|
||||
pub fn monitor_scale_factor(&self) -> f64 {
|
||||
self.display.gl_window().window().scale_factor()
|
||||
}
|
||||
}
|
||||
|
@ -313,4 +313,8 @@ impl PrerenderInnards {
|
||||
self.gl.scissor(0, 0, width as i32, height as i32);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn monitor_scale_factor(&self) -> f64 {
|
||||
self.windowed_context.window().scale_factor()
|
||||
}
|
||||
}
|
||||
|
@ -328,4 +328,8 @@ impl PrerenderInnards {
|
||||
self.gl.scissor(0, 0, width as i32, height as i32);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn monitor_scale_factor(&self) -> f64 {
|
||||
self.window.scale_factor()
|
||||
}
|
||||
}
|
||||
|
@ -96,6 +96,10 @@ impl<'a> EventCtx<'a> {
|
||||
pub fn get_scale_factor(&self) -> f64 {
|
||||
*self.prerender.assets.scale_factor.borrow()
|
||||
}
|
||||
|
||||
pub fn monitor_scale_factor(&self) -> f64 {
|
||||
self.prerender.inner.monitor_scale_factor()
|
||||
}
|
||||
}
|
||||
|
||||
pub struct LoadingScreen<'a> {
|
||||
|
@ -118,9 +118,12 @@ impl OptionsPanel {
|
||||
.margin(5),
|
||||
]),
|
||||
ManagedWidget::row(vec![
|
||||
"Scale factor for text / UI elements:"
|
||||
.draw_text(ctx)
|
||||
.margin(5),
|
||||
format!(
|
||||
"Scale factor for text / UI elements (your monitor is {}):",
|
||||
ctx.monitor_scale_factor()
|
||||
)
|
||||
.draw_text(ctx)
|
||||
.margin(5),
|
||||
WrappedComposite::nice_text_button(
|
||||
ctx,
|
||||
Text::from(Line(format!("{} ▼", ctx.get_scale_factor()))),
|
||||
|
Loading…
Reference in New Issue
Block a user