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
Notes: sideshowbarker 2024-07-17 22:41:14 +09:00
2 changed files with 3 additions and 7 deletions

View File

@ -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());
}

View File

@ -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 };
};