mirror of
https://github.com/joel16/NX-Shell.git
synced 2025-02-20 03:50:50 +00:00
settings: Only save config and refresh dir entries after settings is closed
This commit is contained in:
parent
4cececbfb9
commit
dff3a6ed5e
@ -2,7 +2,6 @@
|
||||
#define NX_SHELL_WINDOWS_H
|
||||
|
||||
#include "imgui.h"
|
||||
#include "textures.h"
|
||||
|
||||
namespace Windows {
|
||||
inline void SetupWindow(void) {
|
||||
@ -18,6 +17,7 @@ namespace Windows {
|
||||
|
||||
void FileBrowserWindow(bool *focus, bool *first_item);
|
||||
void ImageWindow(void);
|
||||
void PartitionBrowserWindow(void);
|
||||
void SettingsWindow(void);
|
||||
void TextReaderWindow(void);
|
||||
}
|
||||
|
@ -104,6 +104,10 @@ namespace GUI {
|
||||
delete[] text_reader.buf;
|
||||
item.state = MENU_STATE_HOME;
|
||||
}
|
||||
else if (item.state == MENU_STATE_SETTINGS) {
|
||||
Config::Save(config);
|
||||
item.file_count = FS::RefreshEntries(&item.entries, item.file_count);
|
||||
}
|
||||
else
|
||||
item.state = MENU_STATE_HOME;
|
||||
}
|
||||
|
@ -11,8 +11,8 @@ namespace Windows {
|
||||
ImGui::Separator();
|
||||
ImGui::Dummy(ImVec2(0.0f, 5.0f)); // Spacing
|
||||
}
|
||||
|
||||
void SettingsWindow(void) {
|
||||
|
||||
void SettingsWindow(void) {
|
||||
Windows::SetupWindow();
|
||||
|
||||
if (ImGui::Begin("Settings", nullptr, ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) {
|
||||
@ -29,15 +29,15 @@ namespace Windows {
|
||||
}
|
||||
|
||||
Windows::Separator();
|
||||
|
||||
|
||||
if (ImGui::TreeNode("Image Viewer")) {
|
||||
ImGui::Dummy(ImVec2(0.0f, 5.0f)); // Spacing
|
||||
ImGui::Checkbox(" Display filename", &config.image_filename);
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
|
||||
Windows::Separator();
|
||||
|
||||
|
||||
if (ImGui::TreeNode("Developer Options")) {
|
||||
ImGui::Dummy(ImVec2(0.0f, 5.0f)); // Spacing
|
||||
ImGui::Checkbox(" Enable logs", &config.dev_options);
|
||||
@ -64,9 +64,6 @@ namespace Windows {
|
||||
ImGui::TreePop();
|
||||
}
|
||||
}
|
||||
|
||||
Windows::ExitWindow();
|
||||
Config::Save(config);
|
||||
item.file_count = FS::RefreshEntries(&item.entries, item.file_count);
|
||||
Windows::ExitWindow();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user