mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
TextEditor: Use an automatic "modified" marker in the window title
This simplifies the application somewhat as we no longer need to manually update the window title whenever the text document changes.
This commit is contained in:
parent
20dd5735ce
commit
f0cc712246
Notes:
sideshowbarker
2024-07-18 18:48:36 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f0cc712246c
1 changed files with 2 additions and 4 deletions
|
@ -59,7 +59,7 @@ MainWidget::MainWidget()
|
|||
|
||||
m_editor->on_change = [this] {
|
||||
update_preview();
|
||||
update_title();
|
||||
window()->set_modified(editor().document().is_modified());
|
||||
};
|
||||
|
||||
m_page_view = *find_descendant_of_type_named<Web::OutOfProcessWebView>("webview");
|
||||
|
@ -605,9 +605,7 @@ void MainWidget::update_title()
|
|||
builder.append("Untitled");
|
||||
else
|
||||
builder.append(m_path);
|
||||
if (editor().document().is_modified())
|
||||
builder.append(" (*)");
|
||||
builder.append(" - Text Editor");
|
||||
builder.append("[*] - Text Editor");
|
||||
window()->set_title(builder.to_string());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue