Browse Source

Add hover styles to buttons in Script/Shader editor

Giganzo 3 weeks ago
parent
commit
c21a03361a

+ 4 - 4
editor/doc/editor_help.cpp

@@ -3459,9 +3459,9 @@ EditorHelp::EditorHelp() {
 	status_bar->set_custom_minimum_size(Size2(0, 24 * EDSCALE));
 	status_bar->set_custom_minimum_size(Size2(0, 24 * EDSCALE));
 
 
 	toggle_files_button = memnew(Button);
 	toggle_files_button = memnew(Button);
+	toggle_files_button->set_theme_type_variation(SceneStringName(FlatButton));
 	toggle_files_button->set_accessibility_name(TTRC("Scripts"));
 	toggle_files_button->set_accessibility_name(TTRC("Scripts"));
 	toggle_files_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
 	toggle_files_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
-	toggle_files_button->set_flat(true);
 	toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelp::_toggle_files_pressed));
 	toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &EditorHelp::_toggle_files_pressed));
 	status_bar->add_child(toggle_files_button);
 	status_bar->add_child(toggle_files_button);
 
 
@@ -4891,7 +4891,7 @@ FindBar::FindBar() {
 	matches_label->hide();
 	matches_label->hide();
 
 
 	find_prev = memnew(Button);
 	find_prev = memnew(Button);
-	find_prev->set_flat(true);
+	find_prev->set_theme_type_variation(SceneStringName(FlatButton));
 	find_prev->set_disabled(results_count < 1);
 	find_prev->set_disabled(results_count < 1);
 	find_prev->set_tooltip_text(TTR("Previous Match"));
 	find_prev->set_tooltip_text(TTR("Previous Match"));
 	add_child(find_prev);
 	add_child(find_prev);
@@ -4899,7 +4899,7 @@ FindBar::FindBar() {
 	find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_prev));
 	find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_prev));
 
 
 	find_next = memnew(Button);
 	find_next = memnew(Button);
-	find_next->set_flat(true);
+	find_next->set_theme_type_variation(SceneStringName(FlatButton));
 	find_next->set_disabled(results_count < 1);
 	find_next->set_disabled(results_count < 1);
 	find_next->set_tooltip_text(TTR("Next Match"));
 	find_next->set_tooltip_text(TTR("Next Match"));
 	add_child(find_next);
 	add_child(find_next);
@@ -4907,7 +4907,7 @@ FindBar::FindBar() {
 	find_next->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_next));
 	find_next->connect(SceneStringName(pressed), callable_mp(this, &FindBar::search_next));
 
 
 	hide_button = memnew(Button);
 	hide_button = memnew(Button);
-	hide_button->set_flat(true);
+	hide_button->set_theme_type_variation(SceneStringName(FlatButton));
 	hide_button->set_tooltip_text(TTR("Hide"));
 	hide_button->set_tooltip_text(TTR("Hide"));
 	hide_button->set_focus_mode(FOCUS_ACCESSIBILITY);
 	hide_button->set_focus_mode(FOCUS_ACCESSIBILITY);
 	hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindBar::_hide_bar));
 	hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindBar::_hide_bar));

+ 7 - 6
editor/gui/code_editor.cpp

@@ -753,9 +753,9 @@ void FindReplaceBar::_bind_methods() {
 
 
 FindReplaceBar::FindReplaceBar() {
 FindReplaceBar::FindReplaceBar() {
 	toggle_replace_button = memnew(Button);
 	toggle_replace_button = memnew(Button);
+	toggle_replace_button->set_theme_type_variation(SceneStringName(FlatButton));
 	add_child(toggle_replace_button);
 	add_child(toggle_replace_button);
 	toggle_replace_button->set_accessibility_name(TTRC("Replace Mode"));
 	toggle_replace_button->set_accessibility_name(TTRC("Replace Mode"));
-	toggle_replace_button->set_flat(true);
 	toggle_replace_button->set_focus_mode(FOCUS_ACCESSIBILITY);
 	toggle_replace_button->set_focus_mode(FOCUS_ACCESSIBILITY);
 	toggle_replace_button->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_toggle_replace_pressed));
 	toggle_replace_button->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_toggle_replace_pressed));
 
 
@@ -799,7 +799,7 @@ FindReplaceBar::FindReplaceBar() {
 	matches_label->hide();
 	matches_label->hide();
 
 
 	find_prev = memnew(Button);
 	find_prev = memnew(Button);
-	find_prev->set_flat(true);
+	find_prev->set_theme_type_variation(SceneStringName(FlatButton));
 	find_prev->set_disabled(results_count < 1);
 	find_prev->set_disabled(results_count < 1);
 	find_prev->set_tooltip_text(TTRC("Previous Match"));
 	find_prev->set_tooltip_text(TTRC("Previous Match"));
 	hbc_button_search->add_child(find_prev);
 	hbc_button_search->add_child(find_prev);
@@ -807,7 +807,7 @@ FindReplaceBar::FindReplaceBar() {
 	find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::search_prev));
 	find_prev->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::search_prev));
 
 
 	find_next = memnew(Button);
 	find_next = memnew(Button);
-	find_next->set_flat(true);
+	find_next->set_theme_type_variation(SceneStringName(FlatButton));
 	find_next->set_disabled(results_count < 1);
 	find_next->set_disabled(results_count < 1);
 	find_next->set_tooltip_text(TTRC("Next Match"));
 	find_next->set_tooltip_text(TTRC("Next Match"));
 	hbc_button_search->add_child(find_next);
 	hbc_button_search->add_child(find_next);
@@ -852,7 +852,7 @@ FindReplaceBar::FindReplaceBar() {
 	selection_only->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));
 	selection_only->connect(SceneStringName(toggled), callable_mp(this, &FindReplaceBar::_search_options_changed));
 
 
 	hide_button = memnew(Button);
 	hide_button = memnew(Button);
-	hide_button->set_flat(true);
+	hide_button->set_theme_type_variation(SceneStringName(FlatButton));
 	hide_button->set_tooltip_text(TTRC("Hide"));
 	hide_button->set_tooltip_text(TTRC("Hide"));
 	hide_button->set_focus_mode(FOCUS_ACCESSIBILITY);
 	hide_button->set_focus_mode(FOCUS_ACCESSIBILITY);
 	hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_hide_bar));
 	hide_button->connect(SceneStringName(pressed), callable_mp(this, &FindReplaceBar::_hide_bar));
@@ -1918,7 +1918,7 @@ CodeTextEditor::CodeTextEditor() {
 	error_column = 0;
 	error_column = 0;
 
 
 	toggle_files_button = memnew(Button);
 	toggle_files_button = memnew(Button);
-	toggle_files_button->set_flat(true);
+	toggle_files_button->set_theme_type_variation(SceneStringName(FlatButton));
 	toggle_files_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
 	toggle_files_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
 	toggle_files_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
 	toggle_files_button->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
 	toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_toggle_files_pressed));
 	toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &CodeTextEditor::_toggle_files_pressed));
@@ -1961,7 +1961,8 @@ CodeTextEditor::CodeTextEditor() {
 	// Zoom
 	// Zoom
 	zoom_button = memnew(MenuButton);
 	zoom_button = memnew(MenuButton);
 	status_bar->add_child(zoom_button);
 	status_bar->add_child(zoom_button);
-	zoom_button->set_flat(true);
+	zoom_button->set_flat(false);
+	zoom_button->set_theme_type_variation("FlatMenuButton");
 	zoom_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
 	zoom_button->set_v_size_flags(SIZE_EXPAND | SIZE_SHRINK_CENTER);
 	zoom_button->set_text("100 %");
 	zoom_button->set_text("100 %");
 	zoom_button->set_accessibility_name(TTRC("Zoom Factor"));
 	zoom_button->set_accessibility_name(TTRC("Zoom Factor"));

+ 1 - 1
editor/gui/window_wrapper.cpp

@@ -488,7 +488,7 @@ void ScreenSelect::pressed() {
 
 
 ScreenSelect::ScreenSelect() {
 ScreenSelect::ScreenSelect() {
 	set_button_mask(MouseButtonMask::RIGHT);
 	set_button_mask(MouseButtonMask::RIGHT);
-	set_flat(true);
+	set_theme_type_variation(SceneStringName(FlatButton));
 	set_toggle_mode(true);
 	set_toggle_mode(true);
 	set_focus_mode(FOCUS_NONE);
 	set_focus_mode(FOCUS_NONE);
 	set_action_mode(ACTION_MODE_BUTTON_PRESS);
 	set_action_mode(ACTION_MODE_BUTTON_PRESS);

+ 11 - 6
editor/script/script_editor_plugin.cpp

@@ -4283,7 +4283,7 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	buttons_hbox->add_child(filename);
 	buttons_hbox->add_child(filename);
 
 
 	members_overview_alphabeta_sort_button = memnew(Button);
 	members_overview_alphabeta_sort_button = memnew(Button);
-	members_overview_alphabeta_sort_button->set_flat(true);
+	members_overview_alphabeta_sort_button->set_theme_type_variation(SceneStringName(FlatButton));
 	members_overview_alphabeta_sort_button->set_tooltip_text(TTRC("Toggle alphabetical sorting of the method list."));
 	members_overview_alphabeta_sort_button->set_tooltip_text(TTRC("Toggle alphabetical sorting of the method list."));
 	members_overview_alphabeta_sort_button->set_toggle_mode(true);
 	members_overview_alphabeta_sort_button->set_toggle_mode(true);
 	members_overview_alphabeta_sort_button->set_pressed(EDITOR_GET("text_editor/script_list/sort_members_outline_alphabetically"));
 	members_overview_alphabeta_sort_button->set_pressed(EDITOR_GET("text_editor/script_list/sort_members_outline_alphabetically"));
@@ -4340,6 +4340,8 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	set_process_shortcut_input(true);
 	set_process_shortcut_input(true);
 
 
 	file_menu = memnew(MenuButton);
 	file_menu = memnew(MenuButton);
+	file_menu->set_flat(false);
+	file_menu->set_theme_type_variation("FlatMenuButton");
 	file_menu->set_text(TTRC("File"));
 	file_menu->set_text(TTRC("File"));
 	file_menu->set_switch_on_hover(true);
 	file_menu->set_switch_on_hover(true);
 	file_menu->set_shortcut_context(this);
 	file_menu->set_shortcut_context(this);
@@ -4408,6 +4410,8 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	file_menu->get_popup()->connect("popup_hide", callable_mp(this, &ScriptEditor::_file_menu_closed));
 	file_menu->get_popup()->connect("popup_hide", callable_mp(this, &ScriptEditor::_file_menu_closed));
 
 
 	script_search_menu = memnew(MenuButton);
 	script_search_menu = memnew(MenuButton);
+	script_search_menu->set_flat(false);
+	script_search_menu->set_theme_type_variation("FlatMenuButton");
 	script_search_menu->set_text(TTRC("Search"));
 	script_search_menu->set_text(TTRC("Search"));
 	script_search_menu->set_switch_on_hover(true);
 	script_search_menu->set_switch_on_hover(true);
 	script_search_menu->set_shortcut_context(this);
 	script_search_menu->set_shortcut_context(this);
@@ -4415,6 +4419,8 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	menu_hb->add_child(script_search_menu);
 	menu_hb->add_child(script_search_menu);
 
 
 	MenuButton *debug_menu_btn = memnew(MenuButton);
 	MenuButton *debug_menu_btn = memnew(MenuButton);
+	debug_menu_btn->set_flat(false);
+	debug_menu_btn->set_theme_type_variation("FlatMenuButton");
 	menu_hb->add_child(debug_menu_btn);
 	menu_hb->add_child(debug_menu_btn);
 	debug_menu_btn->hide(); // Handled by EditorDebuggerNode below.
 	debug_menu_btn->hide(); // Handled by EditorDebuggerNode below.
 
 
@@ -4441,13 +4447,13 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	menu_hb->add_spacer();
 	menu_hb->add_spacer();
 
 
 	site_search = memnew(Button);
 	site_search = memnew(Button);
+	site_search->set_theme_type_variation(SceneStringName(FlatButton));
 	site_search->set_accessibility_name(TTRC("Site Search"));
 	site_search->set_accessibility_name(TTRC("Site Search"));
-	site_search->set_flat(true);
 	site_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_WEBSITE));
 	site_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_WEBSITE));
 	menu_hb->add_child(site_search);
 	menu_hb->add_child(site_search);
 
 
 	help_search = memnew(Button);
 	help_search = memnew(Button);
-	help_search->set_flat(true);
+	help_search->set_theme_type_variation(SceneStringName(FlatButton));
 	help_search->set_text(TTRC("Search Help"));
 	help_search->set_text(TTRC("Search Help"));
 	help_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_HELP));
 	help_search->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_menu_option).bind(SEARCH_HELP));
 	menu_hb->add_child(help_search);
 	menu_hb->add_child(help_search);
@@ -4456,14 +4462,14 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	menu_hb->add_child(memnew(VSeparator));
 	menu_hb->add_child(memnew(VSeparator));
 
 
 	script_back = memnew(Button);
 	script_back = memnew(Button);
-	script_back->set_flat(true);
+	script_back->set_theme_type_variation(SceneStringName(FlatButton));
 	script_back->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_back));
 	script_back->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_back));
 	menu_hb->add_child(script_back);
 	menu_hb->add_child(script_back);
 	script_back->set_disabled(true);
 	script_back->set_disabled(true);
 	script_back->set_tooltip_text(TTRC("Go to previous edited document."));
 	script_back->set_tooltip_text(TTRC("Go to previous edited document."));
 
 
 	script_forward = memnew(Button);
 	script_forward = memnew(Button);
-	script_forward->set_flat(true);
+	script_forward->set_theme_type_variation(SceneStringName(FlatButton));
 	script_forward->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_forward));
 	script_forward->connect(SceneStringName(pressed), callable_mp(this, &ScriptEditor::_history_forward));
 	menu_hb->add_child(script_forward);
 	menu_hb->add_child(script_forward);
 	script_forward->set_disabled(true);
 	script_forward->set_disabled(true);
@@ -4472,7 +4478,6 @@ ScriptEditor::ScriptEditor(WindowWrapper *p_wrapper) {
 	menu_hb->add_child(memnew(VSeparator));
 	menu_hb->add_child(memnew(VSeparator));
 
 
 	make_floating = memnew(ScreenSelect);
 	make_floating = memnew(ScreenSelect);
-	make_floating->set_flat(true);
 	make_floating->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
 	make_floating->set_tooltip_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
 	make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true));
 	make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true));
 
 

+ 6 - 0
editor/script/script_text_editor.cpp

@@ -2857,6 +2857,8 @@ ScriptTextEditor::ScriptTextEditor() {
 	edit_hb = memnew(HBoxContainer);
 	edit_hb = memnew(HBoxContainer);
 
 
 	edit_menu = memnew(MenuButton);
 	edit_menu = memnew(MenuButton);
+	edit_menu->set_flat(false);
+	edit_menu->set_theme_type_variation("FlatMenuButton");
 	edit_menu->set_text(TTRC("Edit"));
 	edit_menu->set_text(TTRC("Edit"));
 	edit_menu->set_switch_on_hover(true);
 	edit_menu->set_switch_on_hover(true);
 	edit_menu->set_shortcut_context(this);
 	edit_menu->set_shortcut_context(this);
@@ -2873,11 +2875,15 @@ ScriptTextEditor::ScriptTextEditor() {
 	set_syntax_highlighter(highlighter);
 	set_syntax_highlighter(highlighter);
 
 
 	search_menu = memnew(MenuButton);
 	search_menu = memnew(MenuButton);
+	search_menu->set_flat(false);
+	search_menu->set_theme_type_variation("FlatMenuButton");
 	search_menu->set_text(TTRC("Search"));
 	search_menu->set_text(TTRC("Search"));
 	search_menu->set_switch_on_hover(true);
 	search_menu->set_switch_on_hover(true);
 	search_menu->set_shortcut_context(this);
 	search_menu->set_shortcut_context(this);
 
 
 	goto_menu = memnew(MenuButton);
 	goto_menu = memnew(MenuButton);
+	goto_menu->set_flat(false);
+	goto_menu->set_theme_type_variation("FlatMenuButton");
 	goto_menu->set_text(TTRC("Go To"));
 	goto_menu->set_text(TTRC("Go To"));
 	goto_menu->set_switch_on_hover(true);
 	goto_menu->set_switch_on_hover(true);
 	goto_menu->set_shortcut_context(this);
 	goto_menu->set_shortcut_context(this);

+ 6 - 0
editor/script/text_editor.cpp

@@ -626,6 +626,8 @@ TextEditor::TextEditor() {
 	edit_hb = memnew(HBoxContainer);
 	edit_hb = memnew(HBoxContainer);
 
 
 	edit_menu = memnew(MenuButton);
 	edit_menu = memnew(MenuButton);
+	edit_menu->set_flat(false);
+	edit_menu->set_theme_type_variation("FlatMenuButton");
 	edit_menu->set_shortcut_context(this);
 	edit_menu->set_shortcut_context(this);
 	edit_hb->add_child(edit_menu);
 	edit_hb->add_child(edit_menu);
 	edit_menu->set_text(TTRC("Edit"));
 	edit_menu->set_text(TTRC("Edit"));
@@ -681,6 +683,8 @@ TextEditor::TextEditor() {
 	set_syntax_highlighter(plain_highlighter);
 	set_syntax_highlighter(plain_highlighter);
 
 
 	search_menu = memnew(MenuButton);
 	search_menu = memnew(MenuButton);
+	search_menu->set_flat(false);
+	search_menu->set_theme_type_variation("FlatMenuButton");
 	search_menu->set_shortcut_context(this);
 	search_menu->set_shortcut_context(this);
 	edit_hb->add_child(search_menu);
 	edit_hb->add_child(search_menu);
 	search_menu->set_text(TTRC("Search"));
 	search_menu->set_text(TTRC("Search"));
@@ -696,6 +700,8 @@ TextEditor::TextEditor() {
 	search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES);
 	search_menu->get_popup()->add_shortcut(ED_GET_SHORTCUT("script_text_editor/replace_in_files"), REPLACE_IN_FILES);
 
 
 	MenuButton *goto_menu = memnew(MenuButton);
 	MenuButton *goto_menu = memnew(MenuButton);
+	goto_menu->set_flat(false);
+	goto_menu->set_theme_type_variation("FlatMenuButton");
 	goto_menu->set_shortcut_context(this);
 	goto_menu->set_shortcut_context(this);
 	edit_hb->add_child(goto_menu);
 	edit_hb->add_child(goto_menu);
 	goto_menu->set_text(TTRC("Go To"));
 	goto_menu->set_text(TTRC("Go To"));

+ 2 - 1
editor/shader/shader_editor_plugin.cpp

@@ -905,6 +905,8 @@ ShaderEditorPlugin::ShaderEditorPlugin() {
 	menu_hb = memnew(HBoxContainer);
 	menu_hb = memnew(HBoxContainer);
 	main_container->add_child(menu_hb);
 	main_container->add_child(menu_hb);
 	file_menu = memnew(MenuButton);
 	file_menu = memnew(MenuButton);
+	file_menu->set_flat(false);
+	file_menu->set_theme_type_variation("FlatMenuButton");
 	file_menu->set_text(TTR("File"));
 	file_menu->set_text(TTR("File"));
 	file_menu->set_switch_on_hover(true);
 	file_menu->set_switch_on_hover(true);
 	file_menu->set_shortcut_context(files_split);
 	file_menu->set_shortcut_context(files_split);
@@ -921,7 +923,6 @@ ShaderEditorPlugin::ShaderEditorPlugin() {
 	menu_spacer = menu_hb->add_spacer();
 	menu_spacer = menu_hb->add_spacer();
 
 
 	make_floating = memnew(ScreenSelect);
 	make_floating = memnew(ScreenSelect);
-	make_floating->set_flat(true);
 	make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true));
 	make_floating->connect("request_open_in_screen", callable_mp(window_wrapper, &WindowWrapper::enable_window_on_screen).bind(true));
 	if (!make_floating->is_disabled()) {
 	if (!make_floating->is_disabled()) {
 		// Override default ScreenSelect tooltip if multi-window support is available.
 		// Override default ScreenSelect tooltip if multi-window support is available.

+ 7 - 1
editor/shader/text_shader_editor.cpp

@@ -1207,6 +1207,8 @@ TextShaderEditor::TextShaderEditor() {
 	hbc = memnew(HBoxContainer);
 	hbc = memnew(HBoxContainer);
 
 
 	edit_menu = memnew(MenuButton);
 	edit_menu = memnew(MenuButton);
+	edit_menu->set_flat(false);
+	edit_menu->set_theme_type_variation("FlatMenuButton");
 	edit_menu->set_shortcut_context(this);
 	edit_menu->set_shortcut_context(this);
 	edit_menu->set_text(TTR("Edit"));
 	edit_menu->set_text(TTR("Edit"));
 	edit_menu->set_switch_on_hover(true);
 	edit_menu->set_switch_on_hover(true);
@@ -1235,6 +1237,8 @@ TextShaderEditor::TextShaderEditor() {
 	edit_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
 	edit_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
 
 
 	search_menu = memnew(MenuButton);
 	search_menu = memnew(MenuButton);
+	search_menu->set_flat(false);
+	search_menu->set_theme_type_variation("FlatMenuButton");
 	search_menu->set_shortcut_context(this);
 	search_menu->set_shortcut_context(this);
 	search_menu->set_text(TTR("Search"));
 	search_menu->set_text(TTR("Search"));
 	search_menu->set_switch_on_hover(true);
 	search_menu->set_switch_on_hover(true);
@@ -1246,6 +1250,8 @@ TextShaderEditor::TextShaderEditor() {
 	search_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
 	search_menu->get_popup()->connect(SceneStringName(id_pressed), callable_mp(this, &TextShaderEditor::_menu_option));
 
 
 	MenuButton *goto_menu = memnew(MenuButton);
 	MenuButton *goto_menu = memnew(MenuButton);
+	goto_menu->set_flat(false);
+	goto_menu->set_theme_type_variation("FlatMenuButton");
 	goto_menu->set_shortcut_context(this);
 	goto_menu->set_shortcut_context(this);
 	goto_menu->set_text(TTR("Go To"));
 	goto_menu->set_text(TTR("Go To"));
 	goto_menu->set_switch_on_hover(true);
 	goto_menu->set_switch_on_hover(true);
@@ -1267,7 +1273,7 @@ TextShaderEditor::TextShaderEditor() {
 	hbc->add_spacer();
 	hbc->add_spacer();
 
 
 	site_search = memnew(Button);
 	site_search = memnew(Button);
-	site_search->set_flat(true);
+	site_search->set_theme_type_variation(SceneStringName(FlatButton));
 	site_search->connect(SceneStringName(pressed), callable_mp(this, &TextShaderEditor::_menu_option).bind(HELP_DOCS));
 	site_search->connect(SceneStringName(pressed), callable_mp(this, &TextShaderEditor::_menu_option).bind(HELP_DOCS));
 	site_search->set_text(TTR("Online Docs"));
 	site_search->set_text(TTR("Online Docs"));
 	site_search->set_tooltip_text(TTR("Open Godot online documentation."));
 	site_search->set_tooltip_text(TTR("Open Godot online documentation."));

+ 5 - 3
editor/shader/visual_shader_editor_plugin.cpp

@@ -6672,7 +6672,7 @@ VisualShaderEditor::VisualShaderEditor() {
 	toolbar->move_child(edit_type_fog, 0);
 	toolbar->move_child(edit_type_fog, 0);
 
 
 	add_node = memnew(Button);
 	add_node = memnew(Button);
-	add_node->set_flat(true);
+	add_node->set_theme_type_variation(SceneStringName(FlatButton));
 	add_node->set_text(TTR("Add Node..."));
 	add_node->set_text(TTR("Add Node..."));
 	toolbar->add_child(add_node);
 	toolbar->add_child(add_node);
 	toolbar->move_child(add_node, 0);
 	toolbar->move_child(add_node, 0);
@@ -6682,6 +6682,8 @@ VisualShaderEditor::VisualShaderEditor() {
 	graph->connect("frame_rect_changed", callable_mp(this, &VisualShaderEditor::_frame_rect_changed));
 	graph->connect("frame_rect_changed", callable_mp(this, &VisualShaderEditor::_frame_rect_changed));
 
 
 	varying_button = memnew(MenuButton);
 	varying_button = memnew(MenuButton);
+	varying_button->set_flat(false);
+	varying_button->set_theme_type_variation("FlatMenuButton");
 	varying_button->set_text(TTR("Manage Varyings"));
 	varying_button->set_text(TTR("Manage Varyings"));
 	varying_button->set_switch_on_hover(true);
 	varying_button->set_switch_on_hover(true);
 	toolbar->add_child(varying_button);
 	toolbar->add_child(varying_button);
@@ -6711,7 +6713,7 @@ VisualShaderEditor::VisualShaderEditor() {
 	toolbar->add_child(spacer);
 	toolbar->add_child(spacer);
 
 
 	site_search = memnew(Button);
 	site_search = memnew(Button);
-	site_search->set_flat(true);
+	site_search->set_theme_type_variation(SceneStringName(FlatButton));
 	site_search->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_help_open));
 	site_search->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_help_open));
 	site_search->set_text(TTR("Online Docs"));
 	site_search->set_text(TTR("Online Docs"));
 	site_search->set_tooltip_text(TTR("Open Godot online documentation."));
 	site_search->set_tooltip_text(TTR("Open Godot online documentation."));
@@ -6727,7 +6729,7 @@ VisualShaderEditor::VisualShaderEditor() {
 	toolbar->move_child(separator, 0);
 	toolbar->move_child(separator, 0);
 
 
 	toggle_files_button = memnew(Button);
 	toggle_files_button = memnew(Button);
-	toggle_files_button->set_flat(true);
+	toggle_files_button->set_theme_type_variation(SceneStringName(FlatButton));
 	toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_toggle_files_pressed));
 	toggle_files_button->connect(SceneStringName(pressed), callable_mp(this, &VisualShaderEditor::_toggle_files_pressed));
 	toolbar->add_child(toggle_files_button);
 	toolbar->add_child(toggle_files_button);
 	toolbar->move_child(toggle_files_button, 0);
 	toolbar->move_child(toggle_files_button, 0);