mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-04-02 05:27:41 -05:00
feat: Added minimal layout
This commit is contained in:
@@ -1192,7 +1192,9 @@ namespace hex {
|
||||
|
||||
handler.ReadOpenFn = [](ImGuiContext *ctx, ImGuiSettingsHandler *, const char *) -> void* { return ctx; };
|
||||
|
||||
handler.ReadLineFn = [](ImGuiContext *, ImGuiSettingsHandler *, void *, const char *line) {
|
||||
handler.ReadLineFn = [](ImGuiContext *, ImGuiSettingsHandler *handler, void *, const char *line) {
|
||||
Window* window = static_cast<Window*>(handler->UserData);
|
||||
|
||||
for (auto &[name, view] : ContentRegistry::Views::impl::getEntries()) {
|
||||
std::string format = view->getUnlocalizedName() + "=%d";
|
||||
sscanf(line, format.c_str(), &view->getWindowOpenState());
|
||||
@@ -1201,6 +1203,15 @@ namespace hex {
|
||||
std::string format = name + "=%d";
|
||||
sscanf(line, format.c_str(), &detached);
|
||||
}
|
||||
|
||||
int width = 0, height = 0;
|
||||
sscanf(line, "MainWindowSize=%d,%d", &width, &height);
|
||||
|
||||
if (width > 0 && height > 0) {
|
||||
TaskManager::doLater([width, height, window]{
|
||||
glfwSetWindowSize(window->m_window, width, height);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
handler.WriteAllFn = [](ImGuiContext *, ImGuiSettingsHandler *handler, ImGuiTextBuffer *buf) {
|
||||
|
||||
Reference in New Issue
Block a user