1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 06:40:06 -04:00

Add Zoom Factor to options panel (#7517)

This commit is contained in:
Emil Ernerfeldt
2025-09-08 18:27:28 +02:00
committed by GitHub
parent b822977e7f
commit 01ee23c1a0
6 changed files with 15 additions and 30 deletions

View File

@@ -294,10 +294,11 @@ pub enum UserAttentionType {
/// egui emits a [`CursorIcon`] in [`PlatformOutput`] each frame as a request to the integration.
///
/// Loosely based on <https://developer.mozilla.org/en-US/docs/Web/CSS/cursor>.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub enum CursorIcon {
/// Normal cursor icon, whatever that is.
#[default]
Default,
/// Show no cursor
@@ -457,12 +458,6 @@ impl CursorIcon {
];
}
impl Default for CursorIcon {
fn default() -> Self {
Self::Default
}
}
/// Things that happened during this frame that the integration may be interested in.
///
/// In particular, these events may be useful for accessibility, i.e. for screen readers.

View File

@@ -357,7 +357,7 @@ impl Options {
theme_preference,
fallback_theme: _,
system_theme: _,
zoom_factor: _, // TODO(emilk)
zoom_factor,
zoom_with_keyboard,
tessellation_options,
repaint_on_widget_change,
@@ -384,6 +384,11 @@ impl Options {
"Repaint if any widget moves or changes id",
);
ui.horizontal(|ui| {
ui.label("Zoom factor:");
ui.add(crate::DragValue::new(zoom_factor).range(0.10..=10.0));
});
ui.checkbox(
zoom_with_keyboard,
"Zoom with keyboard (Cmd +, Cmd -, Cmd 0)",