-
-
Notifications
You must be signed in to change notification settings - Fork 7
Layouts
Because dear imgui supports floating windows(and in our case, docking and viewports too), the library has implemented a system for managing the layout of the different widgets on the screen. On top of this, dear imgui also implements loading/saving such layouts from/to files in the ini format.
The default behaviour of the framework follows dear imgui's default behaviour: saving/loading files from/to a specific file location. In our case a file with the following path: <Application config directory>/Core/<layout name>.ini
However, you do have the ability to change this behaviour using 3 settings in your <Application config directory>/Core/Window.yaml file:
layout-location: DefaultLayout
load-layout: true
save-layout: trueThese settings affect the following:
-
layout-location- Sets the file name of the layout file, prefixed with<Application config directory/Core/and postfixed with.ini(defaults toDefaultLayoutif not set) -
load-layout- Whether to automatically load the layout file(defaults totrueif not set) -
save-layout- Whether to automatically save any changes to the layout file(defaults totrueif not set)
One can also programmatically access these 3 settings, as well as deal with manually loading and saving layouts through the Layouts interface:
class Layouts
{
public:
static bool& getLoadLayout() noexcept;
static bool& getSaveLayout() noexcept;
static FString& layoutLocation() noexcept;
static void loadLayout(String layout) noexcept;
static void saveLayout(String layout) noexcept;
};The function names should be self-explanatory.
Tip
The loadLayout and saveLayout functions don't apply any string manipulation, and are equivalent to a call to ImGui::LoadIniSettingsFromDisk and ImGui::SaveIniSettingsToDisk.
The getLoadLayout and getSaveLayout functions are rated as safe at construct and post-construct, while the layoutLocation, loadLayout and saveLayout functions are rated as safe at begin, style and post-begin.
A C API is also provided. It follows the basic C API development conventions, as defined here.
This project is supported by all the people who joined our discord server and became beta testers. If you want to join the discord you can click here.
- Home
- Beginner content
- Install guide
- Creating and using the UI components
- The Instance
- The Init Info struct
- Building better titlebar menus
- Textures
- Logging
- Unicode support
- Additional features
- Client-side bar
- Custom type definitions
- Memory management
- C API development
- Config files and Folders
- Interfaces
- Internal Event safety
- Customising the build system
- Modules system
- Collaborating with others
- Advanced content
- Loading dynamic libraries at runtime
- Understanding the library layout
- Compilation mode modifiers
- Supporting plugins
- Production export and deployment
- OS integration tips
- Targeting WASM
- Using a custom rendering engine:
- Using a custom windowing backend:
- Developer and contributor resources
- Misc