Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Cannot manually scale GUI on Linux #1721

Closed
BartMassey opened this issue Jun 7, 2022 · 6 comments · Fixed by #2239
Closed

Cannot manually scale GUI on Linux #1721

BartMassey opened this issue Jun 7, 2022 · 6 comments · Fixed by #2239
Labels
bug Something is broken

Comments

@BartMassey
Copy link

Issue #53 describes the need to be able to manually scale the GUI both for accessibility and for dealing with HIDPI displays. The GUI should be scalable using <ctl-shift-"+"> and <ctl-shift-"-"> or <ctl-mousewheel>, . Neither of these options currently works on Linux.

This can be reproduced by compiling the hello world demo app and trying to scale it.

I'm running current Debian Linux.

@BartMassey BartMassey added the bug Something is broken label Jun 7, 2022
@emilk
Copy link
Owner

emilk commented Jun 10, 2022

This should already work well on the web (please www.egui.rs).

In case you are talking about native:

  • are you used to be able to zoom any app like that?
  • have you tested just listening for those key presses and calling egui_ctx.set_pixels_per_point in your app?

@BartMassey
Copy link
Author

Yes, native. Sorry, should have been more clear.

are you used to be able to zoom any app like that?

Very much so.

have you tested just listening for those key presses and calling egui_ctx.set_pixels_per_point in your app?

Nope! Could, but was hoping that the framework would handle it.

@thomas992
Copy link
Contributor

thomas992 commented Jun 10, 2022

What apps are you able to zoom in? My understanding is that zooming is a browser only event currently.

pub use egui::Context;
    let mut ctx = egui::Context::default();
    if ui
        .input_mut()
        .consume_key(egui::Modifiers::ALT_SHIFT, Key::F)
    {
        ctx.set_pixels_per_point(120.0)
    }

does not work in my easymark editor branch

@BartMassey
Copy link
Author

Gnome-terminal, for example, zooms the whole window on <ctrl>-<minus> and <ctrl>-<plus>. I mostly edit in a terminal, so idk what editors do. VSCode seems to support <ctrl>-<minus> and <ctrl>-<plus>, although tbf it uses some browser framework underneath I'm sure. Zulip works, but again… Other apps seem to support zooming on a per-app basis: for example LibreOffice Calc zooms the spreadsheet with <ctrl>-<mousewheel>.

@thomas992
Copy link
Contributor

thomas992 commented Jun 11, 2022

Accessing the minus and plus buttons are not possible for hotkeys on EGUI as of yet as far as I am aware of. Keys such as ; are not international and require some form of internationalization to bring it to pull. It is possible to change some files to add the specific keys, I can tell you how to do that but I am not sure how to change the zoom even if the keys were accessible.

@kud1ing
Copy link
Contributor

kud1ing commented Jun 18, 2022

This should already work well on the web (please www.egui.rs).

On Safari macOS Cmd+Plus seems to zoom into the canvas, not scaling the rendering within the canvas, though, which leads to some blurriness:

Bildschirmfoto 2022-06-18 um 10 36 00

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants