Save/restore window size of the file selector (fix #2756 in some way)

This commit is contained in:
David Capello 2021-08-19 11:51:21 -03:00
parent 7f56db58b7
commit c46927dce6
2 changed files with 15 additions and 0 deletions

View File

@ -56,6 +56,8 @@ using namespace ui;
namespace {
const char* kConfigSection = "FileSelector";
template<class Container>
class NullableIterator {
public:
@ -428,6 +430,7 @@ bool FileSelector::show(
remapWindow();
centerWindow();
load_window_pos(this, kConfigSection);
// Change the file formats/extensions to be shown
std::string initialExtension = base::get_file_extension(initialPath);
@ -694,6 +697,16 @@ again:
return (!output.empty());
}
bool FileSelector::onProcessMessage(ui::Message* msg)
{
switch (msg->type()) {
case kCloseMessage:
save_window_pos(this, kConfigSection);
break;
}
return app::gen::FileSelector::onProcessMessage(msg);
}
// Updates the content of the combo-box that shows the current
// location in the file-system.
void FileSelector::updateLocation()

View File

@ -45,6 +45,8 @@ namespace app {
base::paths& output);
private:
bool onProcessMessage(ui::Message* msg) override;
void updateLocation();
void updateNavigationButtons();
void addInNavigationHistory(IFileItem* folder);