summaryrefslogtreecommitdiff
path: root/Userland/Applications
diff options
context:
space:
mode:
authorKarol Kosek <krkk@serenityos.org>2021-11-07 10:54:53 +0100
committerLinus Groh <mail@linusgroh.de>2022-03-08 22:05:48 +0100
commit2fd750621253c674de9bf131ba1c470229431bd9 (patch)
tree8ebe8499fac21618241d2e4febf77f1544c8f145 /Userland/Applications
parent8ebc74919182bbaecead47fb37804d7e54ef9ea6 (diff)
downloadserenity-2fd750621253c674de9bf131ba1c470229431bd9.zip
KeyboardMapper: Display dirty close icon when the file is changed
Diffstat (limited to 'Userland/Applications')
-rw-r--r--Userland/Applications/KeyboardMapper/KeyboardMapperWidget.cpp9
-rw-r--r--Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h1
2 files changed, 3 insertions, 7 deletions
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<void> 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());
}
diff --git a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
index e1c854755f..fb84580f1d 100644
--- a/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
+++ b/Userland/Applications/KeyboardMapper/KeyboardMapperWidget.h
@@ -44,6 +44,5 @@ private:
String m_filename;
Keyboard::CharacterMapData m_character_map;
String m_current_map_name;
- bool m_modified { false };
bool m_automatic_modifier { false };
};