-
Notifications
You must be signed in to change notification settings - Fork 88
/
imgui_window_params.h
133 lines (105 loc) · 5.32 KB
/
imgui_window_params.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#pragma once
#include "imgui.h"
#include <functional>
#include <string>
#include "hello_imgui/imgui_theme.h"
#include "hello_imgui/dpi_aware.h"
namespace HelloImGui
{
// @@md#DefaultImGuiWindowType
// `DefaultImGuiWindowType` is an enum class that defines whether a full screen background
// window is provided or not
enum class DefaultImGuiWindowType
{
// `ProvideFullScreenWindow`: a full window is provided in the background
ProvideFullScreenWindow,
// `ProvideFullScreenDockSpace`: a full screen dockspace is provided in the background
ProvideFullScreenDockSpace,
// `NoDefaultWindow`: No default window is provided
// (except for ImGui's default "debug" window)
NoDefaultWindow
};
// @@md
// @@md#ImGuiWindowParams
// `ImGuiWindowParams` is a struct that defines the ImGui inner windows params
// These settings affect the imgui inner windows inside the application window.
// In order to change the application window settings, change the `AppWindowsParams`
struct ImGuiWindowParams
{
// ------------ Main Options -------------------------------------------------------
// defaultImGuiWindowType: (enum DefaultImGuiWindowType)
// Choose between:
// - ProvideFullScreenWindow (default)
// a full window is provided in the background
// You can still add windows on top of it, since the Z-order
// of this background window is always behind
// - ProvideFullScreenDockSpace:
// a full screen dockspace is provided in the background
// (use this if you intend to use docking)
// - NoDefaultWindow:
// no default window is provided
DefaultImGuiWindowType defaultImGuiWindowType =
DefaultImGuiWindowType::ProvideFullScreenWindow;
// enableViewports: Enable multiple viewports (i.e. multiple native windows)
// If true, you can drag windows outside the main window,
// in order to put their content into new native windows.
bool enableViewports = false;
// Make windows only movable from the title bar
bool configWindowsMoveFromTitleBarOnly = true;
// ------------ Menus & Status bar --------------------------------------------------
// Set the title of the App menu. If empty, the menu name will use
// the "windowTitle" from AppWindowParams//
std::string menuAppTitle = "";
// Show Menu bar on top of imgui main window.
// In order to fully customize the menu, set showMenuBar to true, and set showMenu_App
// and showMenu_View params to false. Then, implement the callback
// `RunnerParams.callbacks.ShowMenus`
// which can optionally call `HelloImGui::ShowViewMenu` and `HelloImGui::ShowAppMenu`.
bool showMenuBar = false;
// If menu bar is shown, include or not the default app menu
bool showMenu_App = true;
// Include or not a "Quit" item in the default app menu.
// Set this to false if you intend to provide your own quit callback
// with possible user confirmation
// (and implement it inside RunnerCallbacks.ShowAppMenuItems)
bool showMenu_App_Quit = true;
// If menu bar is shown, include or not the default _View_ menu, that enables
// to change the layout and set the docked windows and status bar visibility)
bool showMenu_View = true;
// Show theme selection in view menu
bool showMenu_View_Themes = true;
// `rememberTheme`: _bool, default=true_. Remember selected theme
bool rememberTheme = true;
// Flag that enable to show a Status bar at the bottom. You can customize
// the status bar via RunnerCallbacks.ShowStatus()
bool showStatusBar = false;
// If set, display the FPS in the status bar.
bool showStatus_Fps = true;
// If set, showStatusBar and showStatus_Fps are stored in the application settings.
bool rememberStatusBarSettings = true;
// ------------ Change the dockspace or background window size -----------------------
// If defaultImGuiWindowType = ProvideFullScreenWindow or ProvideFullScreenDockSpace,
// you can set the position and size of the background window:
// - fullScreenWindow_MarginTopLeft is the window position
// - fullScreenWindow_MarginBottomRight is the margin between
// the "application window" bottom right corner
// and the "imgui background window" bottom right corner
// Important note:
// In order to be Dpi aware, those sizes are in *em units*, not in pixels,
// i.e. in multiples of the font size! (See HelloImGui::EmToVec2)
ImVec2 fullScreenWindow_MarginTopLeft = ImVec2(0.f, 0.f);
ImVec2 fullScreenWindow_MarginBottomRight = ImVec2(0.f, 0.f);
// ------------ Theme ---------------------------------------------------------------
// tweakedTheme: (enum ImGuiTheme::ImGuiTweakedTheme)
// Changes the ImGui theme. Several themes are available, you can query the list
// by calling HelloImGui::AvailableThemes()
ImGuiTheme::ImGuiTweakedTheme tweakedTheme;
// backgroundColor:
// This is the "clearColor", i.e. the app window background color, is visible *only if*
// runnerParams.imGuiWindowParams.defaultImGuiWindowType = NoDefaultWindow
// Alternatively, you can set your own RunnerCallbacks.CustomBackground to have full
// control over what is drawn behind the Gui.
ImVec4 backgroundColor = ImVec4(0.f, 0.f, 0.f, 0.f);
};
// @@md
} // namespace HelloImGui