Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Support high resolution icons #302

Open
teadrinker opened this issue Oct 10, 2023 · 4 comments
Open

Support high resolution icons #302

teadrinker opened this issue Oct 10, 2023 · 4 comments
Labels
bug An issue that should be fixed. feature request A feature request or improvement ui Task is related to user interface

Comments

@teadrinker
Copy link
Contributor

(might be related to issue 203)

I have a high-DPI laptop at 200% windows scaling, although text scales as expected, a number of issues seem to be happening:

  • Many icons in the UI (for instance in the timeline header) don't seem to care about scaling and are hard to see
  • Texts are cut-off (such as enable/bypass, names of presets etc)
  • Dialogs are too small for their contents (for instance playback settings)

I can look into this at some point, however, would be good to know if there an idea of how/where in the code DPI is supposed to be managed? Is there an abstraction, or a global multiplier all UI implementations are supposed to use?

fbwIoba8ny
T3Editor_23-10-09__13-43-41

@pixtur
Copy link
Collaborator

pixtur commented Nov 2, 2023

Thanks for reporting: I fixed the playback settings with e514348.

The main idea here is to scale fixed pixel sizes like so...

            ImGui.SetNextWindowSize(new Vector2(600, 500) * T3Ui.UiScaleFactor);

Scaling icons will be much more tricky. We have the icons as vector graphics. But they are carefully crafted for pixel alignment with 15px. So we would need to load highres version and scale down for other other scale factors. They are added as glyphs to the ImGui font-atlas, which would make the whole thing is a pain in the butt...

For the cut of UI-Elements, it would be ideal if you have a precise list or a long collection of the issue. Each one is probably 2-3 minutes of work.

@teadrinker
Copy link
Contributor Author

They are added as glyphs to the ImGui font-atlas, which would make the whole thing is a pain in the butt...

Where is the atlas? or is it created from code?
I found the png fonts-sheets in the dir Resources\fonts (what kind of format is that btw?), but don't seem to have the additional icons (but it's hard to see so might have missed!)

@pixtur
Copy link
Collaborator

pixtur commented Nov 3, 2023

Yes, it's all created on runtime:

in Editor/Gui/WindowsUiContentDrawer.cs

private unsafe void CreateFontsTexture() {  ... }

@pixtur
Copy link
Collaborator

pixtur commented Nov 3, 2023

I rethought about the icons integration: I good work around would be to export the icon-image in multiple hires version (e.g. @1.5, @2x etc) and switch between them on certain thresholds. that should pretty easy to implement.

@pixtur pixtur changed the title DPI Scaling not working well (v3.7.1, Windows 10) Support high resolution icons Jan 27, 2024
@pixtur pixtur added bug An issue that should be fixed. feature request A feature request or improvement ui Task is related to user interface labels Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that should be fixed. feature request A feature request or improvement ui Task is related to user interface
Projects
Status: Planned for v3.10
Development

No branches or pull requests

2 participants