1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:07:36 +00:00

VideoPlayer: Show current open file in the title

This commit is contained in:
Slimey 2022-11-06 13:14:29 +00:00 committed by Gunnar Beutner
parent 13ac078202
commit 8006bdf6b4
3 changed files with 21 additions and 1 deletions

View file

@ -77,6 +77,9 @@ void VideoPlayerWidget::open_file(StringView filename)
return;
}
m_path = filename;
update_title();
m_playback_manager = load_file_result.release_value();
resume_playback();
}
@ -184,4 +187,17 @@ void VideoPlayerWidget::cycle_sizing_modes()
m_video_display->update();
}
void VideoPlayerWidget::update_title()
{
StringBuilder string_builder;
if (m_path.is_empty()) {
string_builder.append("No video"sv);
} else {
string_builder.append(m_path.view());
}
string_builder.append("[*] - Video Player"sv);
window()->set_title(string_builder.to_string());
}
}