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

KeyboardMapper: Display dirty close icon when the file is changed

This commit is contained in:
Karol Kosek 2021-11-07 10:54:53 +01:00 committed by Linus Groh
parent 8ebc749191
commit 2fd7506212
2 changed files with 3 additions and 7 deletions

View file

@ -57,8 +57,7 @@ void KeyboardMapperWidget::create_frame()
else else
map[index] = value[0]; map[index] = value[0];
m_modified = true; window()->set_modified(true);
update_window_title();
} }
}; };
@ -180,7 +179,7 @@ ErrorOr<void> KeyboardMapperWidget::save_to_file(StringView filename)
TRY(file->write(file_content.bytes())); TRY(file->write(file_content.bytes()));
file->close(); file->close();
m_modified = false; window()->set_modified(false);
m_filename = filename; m_filename = filename;
update_window_title(); update_window_title();
return {}; return {};
@ -241,9 +240,7 @@ void KeyboardMapperWidget::update_window_title()
{ {
StringBuilder sb; StringBuilder sb;
sb.append(m_filename); sb.append(m_filename);
if (m_modified) sb.append("[*] - Keyboard Mapper");
sb.append(" (*)");
sb.append(" - Keyboard Mapper");
window()->set_title(sb.to_string()); window()->set_title(sb.to_string());
} }

View file

@ -44,6 +44,5 @@ private:
String m_filename; String m_filename;
Keyboard::CharacterMapData m_character_map; Keyboard::CharacterMapData m_character_map;
String m_current_map_name; String m_current_map_name;
bool m_modified { false };
bool m_automatic_modifier { false }; bool m_automatic_modifier { false };
}; };