godot icon indicating copy to clipboard operation
godot copied to clipboard

The theme editor is opened only once

Open JekSun97 opened this issue 1 year ago • 11 comments

Tested versions

4.3 stable, 4.4 dev2

System information

Godot v4.4.dev2 - Windows 10.0.19045 - OpenGL 3 (Compatibility) - Radeon RX 560 Series (Advanced Micro Devices, Inc.; 31.0.14001.45012) - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz (4 Threads)

Issue description

When we create a new theme for any Control node, clicking on the resource opens the theme editor, then if we close this editor, the theme editor can no longer be opened by clicking on the resource in the inspector. scr

However, we can open the theme editor if we select the theme in the file manager

Steps to reproduce

  1. Create a new theme for any Control node
  2. Select this theme in the inspector to open the theme editor
  3. Close the theme editor
  4. Repeat step 2 and the theme editor will not open

Minimal reproduction project (MRP)

N/A

JekSun97 avatar Sep 21 '24 12:09 JekSun97

@AThousandShips Isn't this a mistake?

JekSun97 avatar Sep 21 '24 16:09 JekSun97

I have no clue? I haven't tagged this as anything nor have I done any triage on this

AThousandShips avatar Sep 21 '24 16:09 AThousandShips

Could you please mark this as a bug? Usually the issues that are marked as a bug are the ones that are prioritized for fixing

JekSun97 avatar Sep 21 '24 16:09 JekSun97

Calm down and be patient, I'm not working right now (I would need to actually test this to assign a label), it's the weekend, and I'm not the only one who does bug triage

Also please don't tag random maintainers, I have no connection to this bug report

AThousandShips avatar Sep 21 '24 16:09 AThousandShips

Can confirm this behavior, however it is the same with other editors in the bar, so unsure if this is intentional or a bug, will see what the relevant teams think. It'd be relevant to know if this has always been the case, and if not when it changed, and why, if it was accidental or intentional, etc.

See also (for the converse problem and frustration):

  • https://github.com/godotengine/godot/issues/92889

AThousandShips avatar Sep 22 '24 09:09 AThousandShips

I don't think it's intentional cause if you clear theme and add a new one the preview still doesn't open. Here is a branch that sort of fixes it but not really https://github.com/shahriarlabib000/godot/tree/theme

  • [x] Still have to figure out a way to detect when the preview is closed.
  • [ ] have to do something about the inspector theme expand/contract thing. Otherwise you have to press the theme twice.

Here is a video:

https://github.com/user-attachments/assets/82847276-fb3f-4084-93fa-9b8c345608b0

But idk if this is the right way to do it or if this is intended behavior or not so sorry for that

Edit:

  1. Here is the original commit
  2. Latest commit

shahriarlabib000 avatar Sep 22 '24 18:09 shahriarlabib000

It'd be good to identify when this was changed if it was different in the past

But that solution doesn't look right it shows it regardless of the theme is valid, and edit can be called in some cases

AThousandShips avatar Sep 22 '24 18:09 AThousandShips

I can confirm this much that this is Reproducible in 4.2.2.stable

shahriarlabib000 avatar Sep 22 '24 18:09 shahriarlabib000

How can I create an invalid theme kinda curious what will happen

shahriarlabib000 avatar Sep 22 '24 18:09 shahriarlabib000

You don't, edit can be called with nullptr, it's done to clear things

AThousandShips avatar Sep 22 '24 20:09 AThousandShips

It'd be good to identify when this was changed if it was different in the past

I can't check it yet, but I definitely remember that this behavior didn't happen in 3.x, since I often switched between nodes and called the theme editor in this way

JekSun97 avatar Sep 23 '24 20:09 JekSun97

As it turned out, this is indeed the case, in 3.x there is no such problem, most likely this is an old error that arose in 4.0, I doubt that this behavior is intended on purpose, because if we do not save this topic to disk, we will not be able to open it until we reload the project

https://github.com/user-attachments/assets/e9e509b4-3e05-4cb9-b634-785b0d4e445c

JekSun97 avatar Sep 24 '24 09:09 JekSun97

I think the close button was added in 4.2 Added in #81523 I think

shahriarlabib000 avatar Sep 25 '24 05:09 shahriarlabib000

@AThousandShips is this any good

shahriarlabib000 avatar Sep 27 '24 08:09 shahriarlabib000

This is not my area so I can't comment on this

AThousandShips avatar Sep 27 '24 08:09 AThousandShips

@JekSun97 To clarify, as we've discussed different things in this thread, and there's no clear instructions, do you mean the "Close" button in the theme editor, or closing the theme editor from the bottom bar?

AThousandShips avatar Sep 27 '24 10:09 AThousandShips

@JekSun97 To clarify, as we've discussed different things in this thread, and there's no clear instructions, do you mean the "Close" button in the theme editor, or closing the theme editor from the bottom bar?

Sorry, I really didn't make this clear, we need to use the Close button specifically to reproduce this, I'll duplicate my comment from the PR:

The problem is that if we close the theme editor (using the close button), then when we click on the theme in the inspector, the theme editor will not open again, for this we need to select any other node, and then Control with the theme again, then the theme editor will open again, you must agree, quite strange behavior

JekSun97 avatar Sep 27 '24 11:09 JekSun97