Improve animation player header spacing in modern theme

This commit is contained in:
passivestar
2026-01-09 03:39:16 +04:00
parent 6f15a05b6c
commit e25a21da3a
2 changed files with 7 additions and 3 deletions

View File

@@ -1897,7 +1897,7 @@ void AnimationTimelineEdit::_play_position_draw() {
}
float scale = get_zoom_scale();
int h = play_position->get_size().height;
int h = editor->box_selection_container->get_global_position().y - get_global_position().y;
int px = (-get_value() + play_position_pos) * scale + get_name_limit();
@@ -5550,7 +5550,11 @@ void AnimationTrackEditor::_notification(int p_what) {
imported_anim_warning->set_button_icon(get_editor_theme_icon(SNAME("NodeWarning")));
dummy_player_warning->set_button_icon(get_editor_theme_icon(SNAME("NodeWarning")));
inactive_player_warning->set_button_icon(get_editor_theme_icon(SNAME("NodeWarning")));
main_panel->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));
Ref<StyleBox> panel_style = get_theme_stylebox(SceneStringName(panel), SNAME("Tree"))->duplicate();
panel_style->set_content_margin(SIDE_TOP, get_theme_constant("base_margin", EditorStringName(Editor)) * EDSCALE);
main_panel->add_theme_style_override(SceneStringName(panel), panel_style);
edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_ADD_RESET_KEY), get_editor_theme_icon(SNAME("MoveUp")));
edit->get_popup()->set_item_icon(edit->get_popup()->get_item_index(EDIT_APPLY_RESET), get_editor_theme_icon(SNAME("Reload")));
auto_fit->set_button_icon(get_editor_theme_icon(SNAME("AnimationAutoFit")));

View File

@@ -2382,7 +2382,7 @@ void ThemeModern::populate_editor_styles(const Ref<EditorTheme> &p_theme, Editor
{
// Timeline general.
p_theme->set_constant("timeline_v_separation", "AnimationTrackEditor", 0);
p_theme->set_constant("timeline_v_separation", "AnimationTrackEditor", p_config.base_margin * EDSCALE);
p_theme->set_constant("track_v_separation", "AnimationTrackEditor", 0);
int margin = p_theme->get_stylebox(SceneStringName(panel), SNAME("PanelContainer"))->get_content_margin(SIDE_LEFT);