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

Can't override editor font margins in a plugin #17626

Closed
Zylann opened this issue Mar 19, 2018 · 8 comments
Closed

Can't override editor font margins in a plugin #17626

Zylann opened this issue Mar 19, 2018 · 8 comments

Comments

@Zylann
Copy link
Contributor

Zylann commented Mar 19, 2018

Godot 3.0.2

I designed some GUIs for my plugin, but it looks like some options I've set in box and grid containers custom constants seem to be overrided by the editor's theme. This causes my UI to break in multiple ways.

In edited scene and in game testing, my UI looks like this:

image

In the editor, it looks like this:

image

@Zylann Zylann changed the title Custom constants set in plugin scenes are overriden by editor's theme Custom constants set in plugin scenes are overrided by editor's theme Mar 19, 2018
@ghost ghost added bug topic:core labels Apr 4, 2018
@Zylann
Copy link
Contributor Author

Zylann commented Nov 23, 2018

Still the case in Godot 3.1 alpha2.
Apparently it also makes the buttons inoperant.

When opened with show() in _ready():
image

When opened with normal flow:
image

Addon:
zylann.channel_packer.zip

@Zylann
Copy link
Contributor Author

Zylann commented Nov 23, 2018

Apparently this is actually caused by the editor font... it forces a margin which I can't fit in the RGBA indicators, and there is no property I can tweak to force vertical margins...
Example with color rects instead of labels:
image
I had to replace them with icons.

@akien-mga akien-mga changed the title Custom constants set in plugin scenes are overrided by editor's theme Custom constants set in plugin scenes are overridden by editor's theme Nov 23, 2018
@Zylann Zylann changed the title Custom constants set in plugin scenes are overridden by editor's theme Can't override editor font margins in a plugin Nov 24, 2018
@KoBeWi
Copy link
Member

KoBeWi commented Jun 16, 2020

I tried to test the project in 3.2.2 rc1. It threw lots of errors on startup which I ignored, but then the dialog appeared fine.

@Zylann Can you confirm it's fixed or provide a better MRP?

@Zylann
Copy link
Contributor Author

Zylann commented Jun 16, 2020

@KoBeWi the dialog appears fine now because I replaced text with icons. The original problem is still there, but the point is more to not rely on the editor's font because it can change anyways.

@KoBeWi
Copy link
Member

KoBeWi commented Jun 16, 2020

Then MRP with project.godot and the plugin, that you can actually run and see the bug, would be useful.

@Zylann
Copy link
Contributor Author

Zylann commented Jun 16, 2020

I believe it's not a bug actually. GridContainers spacing constants are respected, the problem comes from the font itself. I had this happen in another UI, and even if I can add negative margin, it's pointless to do it because the font could be changed by DPI or user customization.

Now it certainly makes it harder to design editor UIs when the theme in which you make them uses a different font, but I don't know if something can be done about that.

The archive I had linked in my previous post is the plugin folder only. I just tried it in 3.2.2 rc1, but it doesn't throw errors for me (probably because I replaced the plugin in my test project so resources were imported already, see maybe #17483).
Here it how it looks:
image

And this is how it looks with the version from the asset library, now with icons:
image

@KoBeWi
Copy link
Member

KoBeWi commented Jun 16, 2020

it's pointless to do it because the font could be changed by DPI or user customization.
Now it certainly makes it harder to design editor UIs when the theme in which you make them uses a different font, but I don't know if something can be done about that.

The editor somehow deals with that problem, so it may be some missing functionality for plugins (if I understand correctly), which would be a matter for a proposal.

So this issue can be closed then?

@Zylann
Copy link
Contributor Author

Zylann commented Jun 16, 2020

Yes I think it can be closed.

@KoBeWi KoBeWi closed this as completed Jun 16, 2020
@KoBeWi KoBeWi added archived and removed confirmed labels Jun 16, 2020
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

3 participants