1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-03 16:55:53 +00:00

Merge pull request #106780 from arkology/no-more-distraction

Add "Distraction Free Mode" button to `EditorBottomPanel` when bottom panel is expanded
This commit is contained in:
Thaddeus Crews
2025-11-17 10:56:37 -06:00
3 changed files with 27 additions and 1 deletions

View File

@@ -679,7 +679,7 @@ void EditorNode::_update_theme(bool p_skip_creation) {
editor_main_screen->add_theme_style_override(SceneStringName(panel), theme->get_stylebox(SNAME("Content"), EditorStringName(EditorStyles)));
bottom_panel->_theme_changed();
distraction_free->set_button_icon(theme->get_icon(SNAME("DistractionFree"), EditorStringName(EditorIcons)));
distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox(CoreStringName(normal), "FlatMenuButton"));
update_distraction_free_button_theme();
help_menu->set_item_icon(help_menu->get_item_index(HELP_SEARCH), _get_editor_theme_native_menu_icon(SNAME("HelpSearch"), global_menu, dark_mode));
help_menu->set_item_icon(help_menu->get_item_index(HELP_COPY_SYSTEM_INFO), _get_editor_theme_native_menu_icon(SNAME("ActionCopy"), global_menu, dark_mode));
@@ -6568,6 +6568,16 @@ bool EditorNode::is_distraction_free_mode_enabled() const {
return distraction_free->is_pressed();
}
void EditorNode::update_distraction_free_button_theme() {
if (distraction_free->get_meta("_scene_tabs_owned", true)) {
distraction_free->set_theme_type_variation("FlatMenuButton");
distraction_free->add_theme_style_override(SceneStringName(pressed), theme->get_stylebox(CoreStringName(normal), "FlatMenuButton"));
} else {
distraction_free->set_theme_type_variation("BottomPanelButton");
distraction_free->remove_theme_style_override(SceneStringName(pressed));
}
}
void EditorNode::set_center_split_offset(int p_offset) {
center_split->set_split_offset(p_offset);
}