MainMenuWidget Class
Main menu bar providing access to application settings. More...
Declaration
Base class
| class | ImGuiWidget |
|
Abstract base class for ImGui widgets rendered in debug overlays. More... | |
Public Constructors Index
| MainMenuWidget () | |
|
Default constructor, registers settings handler with ImGui. More... | |
Public Destructor Index
| ~MainMenuWidget () override | |
Public Member Functions Index
| void | setDockingCallback (std::function< void(bool)> callback) |
|
Sets a callback for when docking is enabled/disabled. More... | |
| void | setWindowAlpha (float alpha) |
|
Sets the window transparency level. More... | |
| float | windowAlpha () const noexcept |
|
Returns the current window transparency level. More... | |
| bool | isDockingEnabled () const noexcept |
|
Returns whether docking is enabled. More... | |
| void | draw () override |
|
Renders the main menu bar. More... | |
Private Member Functions Index
| void | applyTransparency () |
|
Applies the current transparency settings to ImGui style. More... | |
| void | registerSettingsHandler () |
|
Registers the ImGui settings handler for persistence. More... | |
Private Member Attributes Index
| float | windowAlpha_ = 0.85f |
|
Window background transparency (0.0 - 1.0). More... | |
| float | childAlpha_ = 0.0f |
|
Child window background transparency. More... | |
| bool | showDemoWindow_ = false |
|
Whether to show the ImGui demo window. More... | |
| bool | showStyleEditor_ = false |
|
Whether to show the style editor. More... | |
| bool | dockingEnabled_ = true |
|
Whether docking is enabled. More... | |
| bool | firstDraw_ = true |
|
Whether this is the first draw call (for initial setup). More... | |
| bool | handlerRegistered_ = false |
|
Whether the settings handler has been registered. More... | |
| std::function< void(bool)> | onDockingChanged_ |
|
Callback when docking setting changes. More... | |
Private Static Attributes Index
| static MainMenuWidget * | instance_ = nullptr |
|
Static pointer to the current instance (for ImGui callbacks). More... | |
Description
Main menu bar providing access to application settings.
This widget renders a menu bar at the top of the viewport with options for:
- View settings (window transparency, docking)
- Debug tools (show/hide log console, demo window)
- Style presets
Settings are automatically saved to and loaded from ImGui's imgui.ini file.
Definition at line 31 of file MainMenuWidget.ixx.
Public Constructors
MainMenuWidget()
| inline |
Default constructor, registers settings handler with ImGui.
Definition at line 136 of file MainMenuWidget.ixx.
Public Destructor
~MainMenuWidget()
| inline |
Definition at line 140 of file MainMenuWidget.ixx.
Public Member Functions
draw()
| inline virtual |
Renders the main menu bar.
Definition at line 183 of file MainMenuWidget.ixx.
isDockingEnabled()
| inline nodiscard noexcept |
Returns whether docking is enabled.
Definition at line 176 of file MainMenuWidget.ixx.
setDockingCallback()
| inline |
Sets a callback for when docking is enabled/disabled.
- Parameters
-
callback Function called with the new docking state.
Definition at line 151 of file MainMenuWidget.ixx.
setWindowAlpha()
| inline |
Sets the window transparency level.
- Parameters
-
alpha Transparency value (0.0 = transparent, 1.0 = opaque).
Definition at line 160 of file MainMenuWidget.ixx.
windowAlpha()
| inline nodiscard noexcept |
Returns the current window transparency level.
Definition at line 169 of file MainMenuWidget.ixx.
Private Member Functions
applyTransparency()
| inline |
Applies the current transparency settings to ImGui style.
Definition at line 82 of file MainMenuWidget.ixx.
registerSettingsHandler()
| inline |
Registers the ImGui settings handler for persistence.
Definition at line 94 of file MainMenuWidget.ixx.
Private Member Attributes
childAlpha_
|
Child window background transparency.
Definition at line 42 of file MainMenuWidget.ixx.
dockingEnabled_
|
Whether docking is enabled.
Definition at line 57 of file MainMenuWidget.ixx.
firstDraw_
|
Whether this is the first draw call (for initial setup).
Definition at line 62 of file MainMenuWidget.ixx.
handlerRegistered_
|
Whether the settings handler has been registered.
Definition at line 67 of file MainMenuWidget.ixx.
onDockingChanged_
|
Callback when docking setting changes.
Definition at line 72 of file MainMenuWidget.ixx.
showDemoWindow_
|
Whether to show the ImGui demo window.
Definition at line 47 of file MainMenuWidget.ixx.
showStyleEditor_
|
Whether to show the style editor.
Definition at line 52 of file MainMenuWidget.ixx.
windowAlpha_
|
Window background transparency (0.0 - 1.0).
Definition at line 37 of file MainMenuWidget.ixx.
Private Static Attributes
instance_
| static |
Static pointer to the current instance (for ImGui callbacks).
Definition at line 77 of file MainMenuWidget.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.