FileManager: Disable PropertiesDialog custom rename disabling logic

TextBox already handles well its disabled state so it's no use to have a
way to prevent it from PropertiesDialog, too.
This commit is contained in:
Andres Vieira 2020-04-28 13:18:36 +02:00 committed by Andreas Kling
parent be8dc41b9c
commit b9df3c3318
Notes: sideshowbarker 2024-07-19 07:13:39 +09:00

View file

@ -79,13 +79,10 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
m_name_box->set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
m_name_box->set_preferred_size({ 0, 22 });
m_name_box->set_text(m_name);
m_name_box->on_change = [&, disable_rename]() {
if (disable_rename) {
m_name_box->set_text(m_name); //FIXME: GUI::TextBox does not support set_enabled yet...
} else {
m_name_dirty = m_name != m_name_box->text();
m_apply_button->set_enabled(true);
}
m_name_box->set_enabled(!disable_rename);
m_name_box->on_change = [&]() {
m_name_dirty = m_name != m_name_box->text();
m_apply_button->set_enabled(true);
};
set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/properties.png"));