mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-03 09:20:26 -05:00
Update imgui external
This commit is contained in:
@@ -192,8 +192,6 @@ GUI::~GUI() {} // NOLINT
|
||||
void GUI::initialize() {}
|
||||
|
||||
void GUI::deinitialize() {
|
||||
ImGui::Shutdown();
|
||||
|
||||
for (ImGuiContext* ctx : _contexts) {
|
||||
ImGui::DestroyContext(ctx);
|
||||
}
|
||||
@@ -273,7 +271,7 @@ void GUI::initializeGL() {
|
||||
style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 1.00f);
|
||||
style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
|
||||
style.Colors[ImGuiCol_WindowBg] = ImVec4(0.13f, 0.13f, 0.13f, 0.96f);
|
||||
style.Colors[ImGuiCol_ChildWindowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
style.Colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.90f);
|
||||
style.Colors[ImGuiCol_Border] = ImVec4(0.65f, 0.65f, 0.65f, 0.59f);
|
||||
style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
|
||||
@@ -288,7 +286,6 @@ void GUI::initializeGL() {
|
||||
style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.75f, 0.80f, 0.43f);
|
||||
style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.75f, 0.80f, 0.65f);
|
||||
style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.40f, 0.75f, 0.80f, 0.65f);
|
||||
style.Colors[ImGuiCol_ComboBg] = ImVec4(0.36f, 0.46f, 0.56f, 1.00f);
|
||||
style.Colors[ImGuiCol_CheckMark] = ImVec4(1.00f, 1.00f, 1.00f, 0.50f);
|
||||
style.Colors[ImGuiCol_SliderGrab] = ImVec4(1.00f, 1.00f, 1.00f, 0.30f);
|
||||
style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.50f, 0.80f, 0.76f, 1.00f);
|
||||
@@ -298,21 +295,18 @@ void GUI::initializeGL() {
|
||||
style.Colors[ImGuiCol_Header] = ImVec4(0.69f, 0.69f, 0.69f, 0.45f);
|
||||
style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.36f, 0.54f, 0.68f, 0.62f);
|
||||
style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.53f, 0.63f, 0.87f, 0.80f);
|
||||
style.Colors[ImGuiCol_Column] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
|
||||
style.Colors[ImGuiCol_ColumnHovered] = ImVec4(0.70f, 0.60f, 0.60f, 1.00f);
|
||||
style.Colors[ImGuiCol_ColumnActive] = ImVec4(0.90f, 0.70f, 0.70f, 1.00f);
|
||||
style.Colors[ImGuiCol_Separator] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
|
||||
style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.70f, 0.60f, 0.60f, 1.00f);
|
||||
style.Colors[ImGuiCol_SeparatorActive] = ImVec4(0.90f, 0.70f, 0.70f, 1.00f);
|
||||
style.Colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
|
||||
style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.60f);
|
||||
style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
|
||||
style.Colors[ImGuiCol_CloseButton] = ImVec4(0.75f, 0.75f, 0.75f, 1.00f);
|
||||
style.Colors[ImGuiCol_CloseButtonHovered] = ImVec4(0.52f, 0.52f, 0.52f, 0.60f);
|
||||
style.Colors[ImGuiCol_CloseButtonActive] = ImVec4(0.52f, 0.52f, 0.52f, 1.00f);
|
||||
style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
|
||||
style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
|
||||
style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
|
||||
style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
|
||||
style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.44f, 0.63f, 1.00f, 0.35f);
|
||||
style.Colors[ImGuiCol_ModalWindowDarkening] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
|
||||
style.Colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
|
||||
}
|
||||
|
||||
for (GuiComponent* comp : _components) {
|
||||
@@ -629,7 +623,7 @@ bool GUI::charCallback(unsigned int character, KeyModifier) {
|
||||
bool GUI::touchDetectedCallback(TouchInput input) {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
const glm::vec2 windowPos = input.currentWindowCoordinates();
|
||||
const bool consumeEvent = ImGui::IsPosHoveringAnyWindow({ windowPos.x, windowPos.y });
|
||||
const bool consumeEvent = io.WantCaptureMouse;
|
||||
|
||||
if (!consumeEvent) {
|
||||
return false;
|
||||
|
||||
@@ -42,7 +42,9 @@ GuiGIBSComponent::GuiGIBSComponent()
|
||||
void GuiGIBSComponent::render() {
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
bool e = _isEnabled;
|
||||
ImGui::Begin("GIBS", &e, WindowSize, 0.5f);
|
||||
ImGui::SetNextWindowSize(WindowSize, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::Begin("GIBS", &e);
|
||||
_isEnabled = e;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
|
||||
@@ -59,7 +59,9 @@ void GuiGlobeBrowsingComponent::render() {
|
||||
|
||||
bool e = _isEnabled;
|
||||
|
||||
ImGui::Begin("Globe Browsing", &e, WindowSize, 0.5f);
|
||||
ImGui::SetNextWindowSize(WindowSize, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::Begin("Globe Browsing", &e);
|
||||
_isEnabled = e;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
defer { ImGui::End(); };
|
||||
|
||||
@@ -38,7 +38,9 @@ void GuiHelpComponent::render() {
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
|
||||
bool v = _isEnabled;
|
||||
ImGui::Begin("Help", &v, Size, 0.5f);
|
||||
ImGui::SetNextWindowSize(Size, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::Begin("Help", &v);
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
ImGui::ShowUserGuide();
|
||||
|
||||
@@ -46,7 +46,9 @@ void GuiJoystickComponent::render() {
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
|
||||
bool v = _isEnabled;
|
||||
ImGui::Begin("Joystick Information", &v, Size, 0.5f);
|
||||
ImGui::SetNextWindowSize(Size, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::Begin("Joystick Information", &v);
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
|
||||
@@ -59,7 +59,9 @@ void GuiMemoryComponent::render() {
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
|
||||
bool v = _isEnabled;
|
||||
ImGui::Begin("Memory Information", &v, Size, 0.5f);
|
||||
ImGui::SetNextWindowSize(Size, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::Begin("Memory Information", &v);
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
|
||||
@@ -104,7 +104,9 @@ void GuiMissionComponent::render() {
|
||||
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
bool v = _isEnabled;
|
||||
ImGui::Begin(guiName().c_str(), &v, Size, 0.75f);
|
||||
ImGui::SetNextWindowSize(Size, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.75f);
|
||||
ImGui::Begin(guiName().c_str(), &v);
|
||||
_isEnabled = v;
|
||||
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
@@ -278,7 +278,9 @@ void GuiPropertyComponent::render() {
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
|
||||
bool v = _isEnabled;
|
||||
ImGui::Begin(guiName().c_str(), &v, Size, 0.75f);
|
||||
ImGui::SetNextWindowSize(Size, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.75f);
|
||||
ImGui::Begin(guiName().c_str(), &v);
|
||||
_isEnabled = v;
|
||||
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
@@ -80,7 +80,9 @@ GuiSpaceTimeComponent::GuiSpaceTimeComponent()
|
||||
void GuiSpaceTimeComponent::render() {
|
||||
ImGui::SetNextWindowCollapsed(_isCollapsed);
|
||||
bool v = _isEnabled;
|
||||
ImGui::Begin(guiName().c_str(), &v, Size, 0.5f, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
ImGui::SetNextWindowSize(Size, ImGuiCond_FirstUseEver);
|
||||
ImGui::SetNextWindowBgAlpha(0.5f);
|
||||
ImGui::Begin(guiName().c_str(), &v, ImGuiWindowFlags_AlwaysAutoResize);
|
||||
_isEnabled = v;
|
||||
_isCollapsed = ImGui::IsWindowCollapsed();
|
||||
|
||||
@@ -366,7 +368,7 @@ void GuiSpaceTimeComponent::render() {
|
||||
&_deltaTime,
|
||||
1.f,
|
||||
100.f,
|
||||
-1,
|
||||
"%.8f",
|
||||
ImGuiInputTextFlags_EnterReturnsTrue
|
||||
);
|
||||
ImGui::SameLine();
|
||||
|
||||
Reference in New Issue
Block a user