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

The theme editor preview is tiny on hiDPI displays #25585

Open
triptych opened this issue Feb 3, 2019 · 32 comments
Open

The theme editor preview is tiny on hiDPI displays #25585

triptych opened this issue Feb 3, 2019 · 32 comments

Comments

@triptych
Copy link

triptych commented Feb 3, 2019

Godot version:

v3.1.beta3.official

OS/device including version:

Model Name: MacBook Pro
Model Identifier: MacBookPro14,3
Processor Name: Intel Core i7
Processor Speed: 3.1 GHz
10.14.3

Issue description:

Was going to create a new theme.
Went to the control node, chose theme, created new theme, clicked "open editor"
The edit theme editor opened in the middle bottom.

Expected:
Editor should open with fonts the same size as the rest of the UI of the Godot engine.

Actual:
The UI fonts are tiny. See screenshot.

screen shot 2019-02-03 at 8 24 33 am

@twaritwaikar
Copy link
Contributor

I can't repro this on my Window 10 godot.windows.tools.32.exe build. Is there any other step that you might have missed?

@bruvzg
Copy link
Member

bruvzg commented Feb 3, 2019

HiDPI issue. I can confirm this, theme editor is not scaled with the editor UI. Can be reproduced on not retina display by setting Editor Settings -> Interface -> Display Scale to 200%.

@twaritwaikar
Copy link
Contributor

twaritwaikar commented Feb 3, 2019

@bruvzg Setting DPI scale to 200% for me, makes everything else oversized too. The theme editor still maintained a readable font size for me.
image
However, if the issue is the non-responsiveness of the theme editor to the DPI scale then I agree this is an issue.

@bruvzg
Copy link
Member

bruvzg commented Feb 3, 2019

The theme editor still maintained a readable font size for me.

It's readable on normal display, on the MacBook Pro (15'' display with 2880×1800 resolution) this text should be about 1.2 mm in height.

@toger5
Copy link
Contributor

toger5 commented Feb 6, 2019

This is expected bahaviour. The dpi scale is determined by different theme sizing values(bigger mergins, bigger font...)

So it is the theme itself which just is small ;) smaller font, margins, borders, textures.
Even the internal editor theme is ENTIRELY regenerated when changing the dpi scale.

What would neet to happen is thst themes handle dpi themselves so the theme editor can have a slider to choose the dpi scale for the theme which is opened in the theme editor.

This is planned to get added in the GSoC this year.

@akien-mga akien-mga added this to the 3.2 milestone Feb 9, 2019
@toger5
Copy link
Contributor

toger5 commented Apr 7, 2019

bump

I am working not he theme based dpi property which makes it much easier to understand and fix what is happening.
Just so u know a fix is in the process.

@Anutrix
Copy link
Contributor

Anutrix commented Aug 12, 2019

Any updates @toger5

@toger5
Copy link
Contributor

toger5 commented Aug 17, 2019

It was actually decided against the fix I implemented. Because The changes necassary were to low lvl and it was undesired to have such changes for a not that important feature like themes.
I Sady had to little time to keep the discussion alive. I might still jump on it at some point in time.

@chepulis
Copy link

3.2 alpha 2, still present, still making themes unusable (retina macbook)

image

@Calinou
Copy link
Member

Calinou commented Oct 21, 2019

I don't know how this could be fixed or worked around for now. We could scale the preview based on the editor scale, but this would likely require having a separate Viewport just for the preview (with its own stretch setting).

Maybe it'd be sufficient to scale one of the Controls that displays the theme view? I'm not sure how well this would work due to containers though.

@ghost
Copy link

ghost commented Jun 13, 2020

Hi,

Just checking where is this at? I'm on version 3.2.1, running Windows 10 and have a 4K screen. The font, buttons and the tree hierarchy are super tiny. No options for scaling/font size works.

2020-06-13_12-46-42

@Anutrix
Copy link
Contributor

Anutrix commented Jun 13, 2020

Hi,

Just checking where is this at? I'm on version 3.2.1, running Windows 10 and have a 4K screen. The font, buttons and the tree hierarchy are super tiny. No options for scaling/font size works.

2020-06-13_12-46-42

Just in case you haven't, you should try restarting after each setting change.
There's also HiDpi setting somewhere. Not sure if it's projects only and not editor. You can try it too.

@triptych
Copy link
Author

I'm also seeing this on the version of Godot that runs in the browser : https://godotengine.org/article/godot-editor-running-web-browser

Viewing on my macbook pro the UI is super tiny. I think perhaps this may be related in terms of DPI settings ...

@ghost
Copy link

ghost commented Jun 14, 2020 via email

@Calinou
Copy link
Member

Calinou commented Jun 14, 2020

Maybe it'd be sufficient to scale one of the Controls that displays the theme view? I'm not sure how well this would work due to containers though.

I tried doing this on either the ScrollContainer or the root MarginContainer, but it doesn't work as Control scaling is not effective in containers (#7049).

Any ideas for a workaround? Using a separate viewport is a possible solution, but that comes with its own issues (such as input handling).

@ghost
Copy link

ghost commented Jun 14, 2020 via email

@Calinou
Copy link
Member

Calinou commented Jun 14, 2020

@knadoor I'm trying to fix it in the C++ code. While this might be fixable with a GDScript plugin, this should really be fixed at the core level.

@ghost
Copy link

ghost commented Jun 14, 2020 via email

@vvinhas
Copy link

vvinhas commented Jun 15, 2020

I'm having the same issue. Not only the theme editor but on the AnimatedSprite tile selection and CollisionPolygon2D as well.

Maybe just having a way to zoom in would be enough.

Captura de Tela 2020-06-05 às 00 24 24

Captura de Tela 2020-06-05 às 00 23 41

@ghost
Copy link

ghost commented Jul 31, 2020

Hi,
Just checking where is this at? I'm on version 3.2.1, running Windows 10 and have a 4K screen. The font, buttons and the tree hierarchy are super tiny. No options for scaling/font size works.
2020-06-13_12-46-42

Just in case you haven't, you should try restarting after each setting change.
There's also HiDpi setting somewhere. Not sure if it's projects only and not editor. You can try it too.

The HiDpi is only for the project not the editor unfortunately. Still have this error.

@Calinou Calinou changed the title Theme editor font size tiny The theme editor preview is tiny on hiDPI displays Jul 31, 2020
@name-here
Copy link

This seems to be fixed in the latest master, but still a problem in release 3.2.3. I guess it should be moved to the 3.2 milestone?

@akien-mga akien-mga modified the milestones: 4.0, 3.2 Oct 26, 2020
@aaronfranke aaronfranke modified the milestones: 3.2, 3.3 Mar 16, 2021
@hidemat
Copy link

hidemat commented Apr 6, 2021

I'm having the opposite issue. Where if my font is too big the UI in the theme preview is way too large:
Screenshot 2021-04-05 201200

It would be a nice to be able to scale the UI in the preview window.

@Expl0it-0x01
Copy link

So for the time being there’s no fix?

@Calinou
Copy link
Member

Calinou commented May 16, 2021

So for the time being there’s no fix?

There is no fix yet, but as a workaround, you can force Godot to run in low-DPI mode or switch to a lower display resolution. There's the --low-dpi command line argument you can use on Windows and macOS, but you can alternatively use the standard procedure on the OS (right-click the executable > Properties > Compatibility > Force scaling to "System" on Windows).

@develtar
Copy link

As a workaround is it possible to add a zoom functionality to the theme editor preview (with vertical and horizontal scrollbars) like the 2D or 3D preview?

Doing so you can avoid to work with dpi settings or other stuff.

@Calinou
Copy link
Member

Calinou commented Oct 23, 2022

As a workaround is it possible to add a zoom functionality to the theme editor preview (with vertical and horizontal scrollbars) like the 2D or 3D preview?

Yes, but it's not trivial for the reasons described above. At this point, it'd be better to implement automatic scaling based on the editor scale setting.

Doing so you can avoid to work with dpi settings or other stuff.

There's already an editor scale setting you can query 🙂

@ghost
Copy link

ghost commented Jul 2, 2023

This issue exists in Godot 4.1 RC2, I'm on a Macbook 16".

image

@ghost
Copy link

ghost commented Jul 4, 2023

@Calinou @YuriSizov @akien-mga A couple of ideas...

Option 1:
How about allow the user to set a default theme font size? i.e., it's at 25 below.

image

And this is how it looks like at default size:
image

This option could be added in Interface -> Editor settings just below the "Main Font Size" option.
image

Users have different monitor resolutions, so this is a setting where the onus can be put on the user to setup and not have to think about the small size of the theme font again. The font size of my source code is 17 - it actually looks the same size as the font size 25 I've set for the theme - so yeah it's kind of weird there and perhaps a better option is available - but this is a workaround.

Option 2:
The default theme font size can be x2 of the main font size. I've noticed applying x2 on the main font size setting makes the font size in the theme editor match it and looks normal.
image

So above I have the main font size at 14, and applying x2 to it is 28 - so this has been applied as the theme's default font size.

I've tested this with a few font sizes, here's another example where the main font size is 22 and the theme font size is 44:
image

We can see that the font size (visually looking) in the theme editor matches with the rest of the godot UI text now. This is something that would be a scaling set internally as part of core - so the default theme font size property will still be empty by default if the user hasn't set any value yet.

@YuriSizov
Copy link
Contributor

@knadoor This is not about the font size. It's related to the scale which is used for everything related to sizes and spacing. You are viewing how the theme looks at its native scale. Unlike the editor theme, which incorporates your screen's DPI into its scale factor.

@ghost
Copy link

ghost commented Jul 4, 2023

Okay good point

@Calinou
Copy link
Member

Calinou commented Jul 4, 2023

In 4.0, there's already a project setting you can adjust to modify the default theme's scale factor. (This affects all elements in the theme, not just the font size.)

This is intended to be used when you want the UI to be large enough when using a high base resolution for your project (such as 4K). This means you cannot use this in every project, as the default base resolution is too low for accomodate for a default project theme that uses a scale of 2.0.

@ghost
Copy link

ghost commented Jul 4, 2023

In 4.0, there's already a project setting you can adjust to modify the default theme's scale factor. (This affects all elements in the theme, not just the font size.)

This is intended to be used when you want the UI to be large enough when using a high base resolution for your project (such as 4K). This means you cannot use this in every project, as the default base resolution is too low for accomodate for a default project theme that uses a scale of 2.0.

Oh fantastic, thanks for mentioning this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests