egui/crates/egui_demo_lib/src/demo
Emil Ernerfeldt 63e48dc855
Introduce global `zoom_factor` (#3608)
* Closes https://github.com/emilk/egui/issues/3602

You can now zoom any egui app by pressing Cmd+Plus, Cmd+Minus or Cmd+0,
just like in a browser. This will change the current `zoom_factor`
(default 1.0) which is persisted in the egui memory, and is the same for
all viewports.
You can turn off the keyboard shortcuts with `ctx.options_mut(|o|
o.zoom_with_keyboard = false);`

`zoom_factor` can also be explicitly read/written with
`ctx.zoom_factor()` and `ctx.set_zoom_factor()`.

This redefines `pixels_per_point` as `zoom_factor *
native_pixels_per_point`, where `native_pixels_per_point` is whatever is
the native scale factor for the monitor that the current viewport is in.

This adds some complexity to the interaction with winit, since we need
to know the current `zoom_factor` in a lot of places, because all egui
IO is done in ui points. I'm pretty sure this PR fixes a bunch of subtle
bugs though that used to be in this code.

`egui::gui_zoom::zoom_with_keyboard_shortcuts` is now gone, and is no
longer needed, as this is now the default behavior.

`Context::set_pixels_per_point` is still there, but it is recommended
you use `Context::set_zoom_factor` instead.
2023-11-22 20:34:51 +01:00
..
about.rs Update Rerun.io logo and copy 2023-09-27 15:27:51 +02:00
code_editor.rs Add syntax highlighing feature to `egui_extras` (#3333) 2023-09-13 20:39:40 +02:00
code_example.rs Add syntax highlighing feature to `egui_extras` (#3333) 2023-09-13 20:39:40 +02:00
context_menu.rs Add `emath::Vec2b`, replacing `egui_plot::AxisBools` (#3543) 2023-11-11 21:31:36 +01:00
dancing_strings.rs Avoid deadlocks by using lambdas for context lock (#2625) 2023-01-25 10:24:23 +01:00
demo_app_windows.rs Introduce global `zoom_factor` (#3608) 2023-11-22 20:34:51 +01:00
drag_and_drop.rs Support images with rounded corners (#3257) 2023-08-15 09:29:30 +02:00
extra_viewport.rs CentralPanel: base id on the current viewport (#3593) 2023-11-20 21:54:32 +01:00
font_book.rs Add `Context::open_url` and `Context::copy_text` (#3380) 2023-09-24 09:31:21 +02:00
highlighting.rs Add ability to highlight any widget (#2632) 2023-01-27 23:36:14 +01:00
layout_test.rs Increase MSRV to 1.67 (#3234) 2023-08-11 13:54:02 +02:00
misc_demo_window.rs Floating scroll bars (#3539) 2023-11-09 18:41:58 +01:00
mod.rs Replace `eframe::Frame` commands and `WindowInfo` with egui (#3564) 2023-11-18 19:27:53 +01:00
multi_touch.rs Increase MSRV to 1.67 (#3234) 2023-08-11 13:54:02 +02:00
paint_bezier.rs Avoid deadlocks by using lambdas for context lock (#2625) 2023-01-25 10:24:23 +01:00
painting.rs `Painter` extend accepts `IntoIter` (#2249) 2022-11-07 09:32:28 +01:00
password.rs Avoid deadlocks by using lambdas for context lock (#2625) 2023-01-25 10:24:23 +01:00
plot_demo.rs Add `emath::Vec2b`, replacing `egui_plot::AxisBools` (#3543) 2023-11-11 21:31:36 +01:00
scrolling.rs Add `emath::Vec2b`, replacing `egui_plot::AxisBools` (#3543) 2023-11-11 21:31:36 +01:00
sliders.rs Allow changing handle shape of a slider (#3429) 2023-11-21 11:24:29 +01:00
strip_demo.rs Fix the "ever-growing height" problem of Strip and Table demos (#3122) 2023-08-10 12:35:40 +02:00
table_demo.rs Fix the "ever-growing height" problem of Strip and Table demos (#3122) 2023-08-10 12:35:40 +02:00
tests.rs Increase MSRV to 1.67 (#3234) 2023-08-11 13:54:02 +02:00
text_edit.rs Add control of line height and letter spacing (#3302) 2023-09-05 10:45:11 +02:00
text_layout.rs Add `emath::Vec2b`, replacing `egui_plot::AxisBools` (#3543) 2023-11-11 21:31:36 +01:00
toggle_switch.rs Move all crates into a `crates` directory (#1940) 2022-08-20 10:41:49 +02:00
widget_gallery.rs Fix broken doc links in the demo app widget gallery (#3441) 2023-11-10 21:39:49 +01:00
window_options.rs Add `emath::Vec2b`, replacing `egui_plot::AxisBools` (#3543) 2023-11-11 21:31:36 +01:00
window_with_panels.rs Control `Separator` widths, and less clipping in `ScrollArea` (#2665) 2023-02-03 13:19:25 +01:00