1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 19:05:08 +00:00

TextEditor: Show "Untitled" when there's no current document path

This commit is contained in:
Andreas Kling 2020-12-30 03:44:38 +01:00
parent 7c0e43eb3d
commit 2dc09d1cd7
3 changed files with 8 additions and 3 deletions

View file

@ -540,7 +540,10 @@ void TextEditorWidget::set_path(const LexicalPath& lexical_path)
void TextEditorWidget::update_title()
{
StringBuilder builder;
builder.append(m_path);
if (m_path.is_empty())
builder.append("Untitled");
else
builder.append(m_path);
if (m_document_dirty)
builder.append(" (*)");
builder.append(" - Text Editor");