Repository: godot
Issue: Custom node types do not appear in a theme resource and have no default theme values
Labels: enhancement,topic:gui

### Godot version

3.4.stable

### System information

Mac OS Big Sur v11.6.5, Core i7, GPU Intel Iris Plus Graphics 1536 MB, GLES3

### Issue description

Good day team, I'm not 100% sure if this is a bug, or I am misusing Godot, or don't know how to accomplish what I'm trying, so I'd appreciate it if you help me analyze the situation.

I'm trying to create a full theme. I have successfully defined the theme for node types like Button, Panel, Label, TextEdit, etcetera. My problem is that I seem to be unable to define the theme for a custom node type.

I created a node type named SecondaryButton, by creating a script that extends from Button, and writing `class_name SecondaryButton`. I am then able to create nodes of this new type SecondaryButton, but I don't see a way to use a theme resource to modify the theme of a SecondaryButton.

Here are a few images of my process. This is the small node tree I have to showcase the issue:
<img width="676" alt="Screen Shot 2022-05-05 at 8 18 24 PM" src="https://user-images.githubusercontent.com/89230550/167053030-bcdecb4b-2bca-48b9-a12d-8d2e16f797cc.png">

This screenshot shows that SecondaryButton is indeed a child of Button:
<img width="553" alt="Screen Shot 2022-05-05 at 8 35 49 PM" src="https://user-images.githubusercontent.com/89230550/167053945-e99686cc-cc30-4bb6-8f4c-856d36812ed0.png">

These are the font color definitions for Button nodes using the theme resource I've created. The font color is of a green tone:
<img width="308" alt="Screen Shot 2022-05-05 at 8 18 47 PM" src="https://user-images.githubusercontent.com/89230550/167053170-bfa17811-00e5-4e2b-bd5f-07b73550db08.png">

Here I run into an issue: I can't add a SecondaryButton to the theme, because when I click on the plus button to 'Add Item Type', the SecondaryButton type does not appear:
<img width="597" alt="Screen Shot 2022-05-05 at 8 19 07 PM" src="https://user-images.githubusercontent.com/89230550/167053283-bc7256a6-a288-427f-a017-eebe19c2856f.png">

But still, I can "force" add the SecondaryButton to the theme, just by typing out 'SecondaryButton' into the 'Add Item Type' and then clicking 'OK'. As you can see in this next screenshot, none of the default theme values appear, like they did for Button (i.e. here there is no `font_color`, no `font_color_disabled`, no `font_color_focus`, and no `font_color_hover`):
<img width="298" alt="Screen Shot 2022-05-05 at 8 19 28 PM" src="https://user-images.githubusercontent.com/89230550/167053403-1cec8526-fb2d-414e-966c-e20d5abe1bd1.png">

If I create a `font_color` variable, and give it a value using the color picker (a magenta in this case), the font color of the SecondaryButton does not change, but it should:
<img width="301" alt="Screen Shot 2022-05-05 at 8 19 55 PM" src="https://user-images.githubusercontent.com/89230550/167053822-ea8940c5-c5d7-4821-91b7-3bca45c53398.png">

I would expect my theme resource to hold the theme for all of the UI nodes that I need, including new one that I create. Maybe I'm doing this wrong, because my assumption is that by extending from Button, my custom node type will have the same default theme variables as a Button. Instead, my custom node type has no theme variables.

Thanks in advance for your attention.


### Steps to reproduce

1. Open in Godot the minimal reproduction project attached to this issue.
2. Open the 'Control.tscn' scene and zoom in to your leisure. You should see two buttons, one on top of the other.
3. Open the theme resource named 'new_theme.tres'.
4. Click on the 'Type:' dropdown menu, inside the theme editor, you should see two types: 'Button' and 'SecondaryButton'. Click on 'SecondaryButton'
5. Change the font_color variable using the color picker.
6. You should see that the font color of the SecondaryButton does not change, despite of you using the color picker to change the font color like in a regular button.

### Minimal reproduction project

[NoCustomNodeInTheme.zip](https://github.com/godotengine/godot/files/8637000/NoCustomNodeInTheme.zip)