Skip to content

Commit

Permalink
Merge pull request #163 from WhalesState/pre-fix-editor-scene-tabs-bu…
Browse files Browse the repository at this point in the history
…tton-minimum-size

Make `EditorSceneTabs` Add button respect the editor theme style
  • Loading branch information
jss2a98aj authored Dec 2, 2024
2 parents f7b8d6f + 28faa97 commit adc2d51
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/gui/editor_scene_tabs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ void EditorSceneTabs::_notification(int p_what) {

scene_tab_add->set_icon(get_editor_theme_icon(SNAME("Add")));
scene_tab_add->add_theme_color_override("icon_normal_color", Color(0.6f, 0.6f, 0.6f, 0.8f));
[[fallthrough]];
}

case NOTIFICATION_READY: {
scene_tab_add_ph->set_custom_minimum_size(scene_tab_add->get_minimum_size());
} break;

Expand Down Expand Up @@ -413,13 +416,13 @@ EditorSceneTabs::EditorSceneTabs() {

scene_tab_add = memnew(Button);
scene_tab_add->set_flat(true);
scene_tab_add->set_theme_type_variation("FlatMenuButton");
scene_tab_add->set_tooltip_text(TTR("Add a new scene."));
scene_tabs->add_child(scene_tab_add);
scene_tab_add->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::trigger_menu_option).bind(EditorNode::FILE_NEW_SCENE, false));

scene_tab_add_ph = memnew(Control);
scene_tab_add_ph->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
scene_tab_add_ph->set_custom_minimum_size(scene_tab_add->get_minimum_size());
tabbar_container->add_child(scene_tab_add_ph);

// On-hover tab preview.
Expand Down

0 comments on commit adc2d51

Please sign in to comment.