From 2fd750621253c674de9bf131ba1c470229431bd9 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Sun, 7 Nov 2021 10:54:53 +0100 Subject: KeyboardMapper: Display dirty close icon when the file is changed --- Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp') diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp index 8417d149eb..33a35c7b7f 100644 --- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp +++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp @@ -57,8 +57,7 @@ void KeyboardMapperWidget::create_frame() else map[index] = value[0]; - m_modified = true; - update_window_title(); + window()->set_modified(true); } }; @@ -180,7 +179,7 @@ ErrorOr KeyboardMapperWidget::save_to_file(StringView filename) TRY(file->write(file_content.bytes())); file->close(); - m_modified = false; + window()->set_modified(false); m_filename = filename; update_window_title(); return {}; @@ -241,9 +240,7 @@ void KeyboardMapperWidget::update_window_title() { StringBuilder sb; sb.append(m_filename); - if (m_modified) - sb.append(" (*)"); - sb.append(" - Keyboard Mapper"); + sb.append("[*] - Keyboard Mapper"); window()->set_title(sb.to_string()); } -- cgit v1.2.3