mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 10:19:03 +03:00
KeyboardMapper: Display dirty close icon when the file is changed
This commit is contained in:
parent
8ebc749191
commit
2fd7506212
Notes:
sideshowbarker
2024-07-17 22:41:14 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/2fd7506212 Pull-request: https://github.com/SerenityOS/serenity/pull/12775
@ -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());
|
||||
}
|
||||
|
@ -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 };
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user