Blamite Game Engine - blam!  00296.01.12.21.0102.blamite
The core library for the Blamite Game Engine.
themes.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <vector>
5 #include <string>
6 
7 #include "components/3rdparty/imgui/imgui.h"
8 
9 #ifndef BLAM
10 #define BLAM
11 #endif
12 
17 {
21 };
22 
29 {
30 public:
31  std::string name;
32  std::string id;
33 
34  std::string metrics_id = "default";
35  std::string font_id = "auto";
36 
40  std::map<ImGuiCol_, ImVec4> imgui_colors;
41 
48 
53 
60  void ApplyTheme();
61 
62  void AddCustomColor(ImGuiCol_, ImVec4);
63 };
64 
66 {
67 public:
68  std::string name;
69  std::string id;
70 
71  ImVec2 window_padding = ImVec2(8, 8);
72  ImVec2 frame_padding = ImVec2(4, 3);
73  ImVec2 item_spacing = ImVec2(8, 4);
74  ImVec2 item_inner_spacing = ImVec2(4, 4);
75  ImVec2 touch_extra_padding = ImVec2(0, 0);
76  float indent_spacing = 21;
77  float scrollbar_size = 14;
78  float grab_min_size = 10;
79 
80  float window_border = 1;
81  float child_border = 1;
82  float popup_border = 1;
83  float frame_border = 0;
84  float tab_border = 0;
85 
86  float window_rounding = 7;
87  float child_rounding = 0;
88  float frame_rounding = 0;
89  float popup_rounding = 0;
90  float scrollbar_rounding = 9;
91  float grab_rounding = 0;
92  float tab_rounding = 4;
93 
94  ImVec2 window_title_align = ImVec2(0, 0.5f);
95 
96  ImGuiDir window_menu_button_pos = ImGuiDir_Left;
97  ImGuiDir color_button_pos = ImGuiDir_Right;
98 
99  ImVec2 button_text_align = ImVec2(0.5f, 0.5f);
100  ImVec2 selectable_text_align = ImVec2(0, 0);
101 
102  ImVec2 safe_area_padding = ImVec2(3, 3);
103  ImVec2 display_window_padding = ImVec2(19, 19);
104 
105  bool anti_aliased_lines = true;
106  bool anti_aliased_fill = true;
107 
109  float global_alpha = 1.0f;
110 
111  float imgui_mouse_scale = 1.0f;
112  ImVec2 window_min_size = ImVec2(32, 32);
113  float column_min_spacing = 6.0f;
114 
118  void ApplyMetrics();
119 };
120 
130 {
134  BLAM void LoadBuiltInThemes();
135 
141  BLAM std::vector<BlamColorScheme>* GetColorSchemeList();
142 
148  BLAM std::vector<BlamThemeMetrics>* GetMetricsList();
149 
157  BLAM bool ApplyColorScheme(std::string scheme_id);
158 
166  BLAM bool ApplyMetrics(std::string metrics_id);
167 }
BlamColorScheme::metrics_id
std::string metrics_id
The default metrics to apply with this theme.
Definition: themes.h:34
BlamThemeMetrics::grab_rounding
float grab_rounding
Definition: themes.h:91
BlamThemeMetrics::window_menu_button_pos
ImGuiDir window_menu_button_pos
Definition: themes.h:96
BlamThemeMetrics::imgui_mouse_scale
float imgui_mouse_scale
Definition: themes.h:111
BlamColorScheme::base_colors
ImGuiThemeColors base_colors
The default ImGUI color scheme to use as a base.
Definition: themes.h:47
BlamThemeMetrics::window_padding
ImVec2 window_padding
Definition: themes.h:71
Blam::UI::Themes::GetMetricsList
BLAM std::vector< BlamThemeMetrics > * GetMetricsList()
Retrieves the list of currently loaded theme metrics.
Definition: themes.cpp:456
BlamThemeMetrics::child_rounding
float child_rounding
Definition: themes.h:87
BlamThemeMetrics::item_inner_spacing
ImVec2 item_inner_spacing
Definition: themes.h:74
BlamThemeMetrics::window_border
float window_border
Definition: themes.h:80
BlamThemeMetrics::display_window_padding
ImVec2 display_window_padding
Definition: themes.h:103
BlamThemeMetrics::anti_aliased_fill
bool anti_aliased_fill
Definition: themes.h:106
BlamThemeMetrics::child_border
float child_border
Definition: themes.h:81
BlamThemeMetrics::scrollbar_rounding
float scrollbar_rounding
Definition: themes.h:90
Dark
@ Dark
The Dark ImGUI theme.
Definition: themes.h:20
BlamThemeMetrics::column_min_spacing
float column_min_spacing
Definition: themes.h:113
BlamThemeMetrics::color_button_pos
ImGuiDir color_button_pos
Definition: themes.h:97
BlamThemeMetrics::frame_border
float frame_border
Definition: themes.h:83
BlamColorScheme::name
std::string name
The name of the theme.
Definition: themes.h:31
Blam::UI::Themes::GetColorSchemeList
BLAM std::vector< BlamColorScheme > * GetColorSchemeList()
Retrieves the list of currently loaded color schemes.
Definition: themes.cpp:451
BlamThemeMetrics
Definition: themes.h:65
BlamThemeMetrics::safe_area_padding
ImVec2 safe_area_padding
Definition: themes.h:102
Blam::UI::Themes::LoadBuiltInThemes
BLAM void LoadBuiltInThemes()
Loads all hard-coded UI themes.
Definition: themes.cpp:8
Classic
@ Classic
The Classic ImGUI theme.
Definition: themes.h:18
BlamColorScheme::ApplyTheme
void ApplyTheme()
Applies the theme to the engine UI.
Definition: BlamColorScheme.cpp:13
Blam::UI::Themes::ApplyMetrics
BLAM bool ApplyMetrics(std::string metrics_id)
Applies the specified ImGui metrics.
Definition: themes.cpp:479
BLAM
#define BLAM
Definition: themes.h:10
BlamThemeMetrics::curve_tesselation_tolerance
float curve_tesselation_tolerance
Definition: themes.h:108
BlamThemeMetrics::button_text_align
ImVec2 button_text_align
Definition: themes.h:99
BlamThemeMetrics::window_title_align
ImVec2 window_title_align
Definition: themes.h:94
BlamColorScheme
Class representing a Blam Color Scheme.
Definition: themes.h:28
BlamThemeMetrics::popup_rounding
float popup_rounding
Definition: themes.h:89
BlamThemeMetrics::global_alpha
float global_alpha
Definition: themes.h:109
BlamThemeMetrics::selectable_text_align
ImVec2 selectable_text_align
Definition: themes.h:100
BlamThemeMetrics::grab_min_size
float grab_min_size
Definition: themes.h:78
Blam::UI::Themes
Namespace for anything relating to engine UI themes.
Definition: themes.h:129
BlamThemeMetrics::id
std::string id
The ID of the theme metrics.
Definition: themes.h:69
BlamThemeMetrics::tab_border
float tab_border
Definition: themes.h:84
BlamThemeMetrics::window_min_size
ImVec2 window_min_size
Definition: themes.h:112
BlamThemeMetrics::indent_spacing
float indent_spacing
Definition: themes.h:76
BlamColorScheme::font_id
std::string font_id
The ID of the font to apply with this theme.
Definition: themes.h:35
BlamColorScheme::id
std::string id
The ID of the theme.
Definition: themes.h:32
BlamThemeMetrics::touch_extra_padding
ImVec2 touch_extra_padding
Definition: themes.h:75
BlamThemeMetrics::anti_aliased_lines
bool anti_aliased_lines
Definition: themes.h:105
BlamColorScheme::AddCustomColor
void AddCustomColor(ImGuiCol_, ImVec4)
Definition: BlamColorScheme.cpp:89
Blam::UI::Themes::ApplyColorScheme
BLAM bool ApplyColorScheme(std::string scheme_id)
Applies the specified color scheme.
Definition: themes.cpp:461
ImGuiThemeColors
ImGuiThemeColors
Enumerator containing all possible base ImGUI color schemes.
Definition: themes.h:16
BlamThemeMetrics::frame_rounding
float frame_rounding
Definition: themes.h:88
BlamThemeMetrics::scrollbar_size
float scrollbar_size
Definition: themes.h:77
BlamThemeMetrics::popup_border
float popup_border
Definition: themes.h:82
BlamThemeMetrics::tab_rounding
float tab_rounding
Definition: themes.h:92
BlamThemeMetrics::item_spacing
ImVec2 item_spacing
Definition: themes.h:73
BlamThemeMetrics::ApplyMetrics
void ApplyMetrics()
Applies the metrics to the engine UI.
Definition: BlamThemeMetrics.cpp:6
BlamColorScheme::BlamColorScheme
BlamColorScheme()
Creates a new Blam UI theme object.
Definition: BlamColorScheme.cpp:7
BlamColorScheme::imgui_colors
std::map< ImGuiCol_, ImVec4 > imgui_colors
List of all customized ImGUI colors.
Definition: themes.h:40
BlamThemeMetrics::name
std::string name
The name of the theme metrics.
Definition: themes.h:68
BlamThemeMetrics::window_rounding
float window_rounding
Definition: themes.h:86
BlamThemeMetrics::frame_padding
ImVec2 frame_padding
Definition: themes.h:72
Light
@ Light
The Light ImGUI theme.
Definition: themes.h:19