Skip to content

Commit

Permalink
Also store Dear ImGui INI file in the app config dir
Browse files Browse the repository at this point in the history
  • Loading branch information
kblaschke committed Mar 19, 2024
1 parent 8dbf578 commit 02414f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/ProjectMGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ void ProjectMGUI::initialize(Poco::Util::Application& app)
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
(void) io;

Poco::Path userConfigurationDir = Poco::Path::configHome();
userConfigurationDir.makeDirectory().append("projectM/");
userConfigurationDir.setFileName(app.config().getString("application.baseName") + ".UI.ini");
_uiIniFileName = userConfigurationDir.toString();

io.IniFilename = _uiIniFileName.c_str();

ImGui::StyleColorsDark();

Expand Down
2 changes: 2 additions & 0 deletions src/gui/ProjectMGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ class ProjectMGUI : public Poco::Util::Subsystem

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

std::string _uiIniFileName; //!< Path and filename of the UI configuration (positions etc.)

SDL_Window* _renderingWindow{nullptr}; //!< Pointer to the SDL window used for rendering.
SDL_GLContext _glContext{nullptr}; //!< Pointer to the OpenGL context associated with the window.
ImFont* _uiFont{nullptr}; //!< Main UI font (monospaced).
Expand Down

0 comments on commit 02414f2

Please sign in to comment.