Files
StarPilot/openpilot/tools/cabana/ui/inistate.h
T
Trey Moen 4c0799eb8e cabana: make Charts a native dockable panel (#38883)
* cabana: make charts a native dockable panel

* cabana: remove redundant charts docking button
2026-09-12 21:40:31 -07:00

29 lines
992 B
C++

#pragma once
#include <string>
struct GLFWwindow;
// The imgui frontend's persisted state: the imgui ini text (windows, dock layout, table
// state) plus a custom [Cabana][MainWindow] section, stored as one string in Settings.
namespace inistate {
struct MainWindowState {
int pos[2] = {0, 0};
int size[2] = {0, 0};
bool maximized = false;
bool has_geometry = false;
float video_splitter_ratio = -1.0f; // < 0: video at its size hint
bool messages_visible = true;
bool video_visible = true;
bool charts_visible = true;
};
extern MainWindowState main_window;
void addSettingsHandler(); // register the [Cabana] ini section
void load(); // migrate Qt state if needed, then LoadIniSettingsFromMemory
void applyWindowGeometry(GLFWwindow *window); // glfw pos/size/maximize from main_window
std::string save(); // SaveIniSettingsToMemory (caller fills main_window first)
} // namespace inistate