Skip to content

Commit cded180

Browse files
committed
Also store Dear ImGui INI file in the app config dir
1 parent 3ab6ba4 commit cded180

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

src/gui/ProjectMGUI.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ void ProjectMGUI::initialize(Poco::Util::Application& app)
2323
IMGUI_CHECKVERSION();
2424
ImGui::CreateContext();
2525
ImGuiIO& io = ImGui::GetIO();
26-
(void) io;
26+
27+
Poco::Path userConfigurationDir = Poco::Path::configHome();
28+
userConfigurationDir.makeDirectory().append("projectM/");
29+
userConfigurationDir.setFileName(app.config().getString("application.baseName") + ".UI.ini");
30+
_uiIniFileName = userConfigurationDir.toString();
31+
32+
io.IniFilename = _uiIniFileName.c_str();
2733

2834
ImGui::StyleColorsDark();
2935

src/gui/ProjectMGUI.h

+2
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ class ProjectMGUI : public Poco::Util::Subsystem
134134

135135
Poco::NObserver<ProjectMGUI, DisplayToastNotification> _displayToastNotificationObserver{*this, &ProjectMGUI::DisplayToastNotificationHandler};
136136

137+
std::string _uiIniFileName; //!< Path and filename of the UI configuration (positions etc.)
138+
137139
SDL_Window* _renderingWindow{nullptr}; //!< Pointer to the SDL window used for rendering.
138140
SDL_GLContext _glContext{nullptr}; //!< Pointer to the OpenGL context associated with the window.
139141
ImFont* _uiFont{nullptr}; //!< Main UI font (monospaced).

0 commit comments

Comments
 (0)