### Godot version

v4.2.dev3.official [013e8e3af]

### System information

Windows 10, 64bit

### Issue description

![image](https://github.com/godotengine/godot/assets/35988767/ccdac68c-a60d-491b-a406-d6e3bc1c95ae)
![GIF](https://github.com/godotengine/godot/assets/35988767/7d230faf-0260-4bc3-92e8-11cd026931a8)


### Steps to reproduce

/

### Minimal reproduction project

/
Ref<Texture2D> menu_icon;
		Ref<Texture2D> menu_hl_icon;
		
		int icon_separation = 0;
		int icon_max_width = 0;
		int outline_size = 0;
		Ref<StyleBox> tab_unselected_style;
		Ref<StyleBox> tab_hovered_style;
		Ref<StyleBox> tab_selected_style;
		Ref<StyleBox> tab_disabled_style;
		Ref<Texture2D> increment_icon;
		Ref<Texture2D> increment_hl_icon;
		Ref<Texture2D> decrement_icon;
		Ref<Texture2D> decrement_hl_icon;
		Ref<Texture2D> drop_mark_icon;
		Color drop_mark_color;
		Color font_selected_color;
		Color font_unselected_color;
		Color font_disabled_color;
		Color font_outline_color;
		Ref<Font> tab_font;
		int tab_font_size;
	} theme_cache;
	int _get_top_margin() const;
	Vector<Control *> _get_tab_controls() const;
	void _on_theme_changed();
	void _repaint();
	void _refresh_tab_names();
	void _update_margins();
	void _on_mouse_exited();