imgui code cleanup

This commit is contained in:
Bruno
2021-04-27 23:19:58 +02:00
parent be36662efc
commit d2f0f42c2d
2 changed files with 99 additions and 100 deletions

View File

@@ -345,7 +345,7 @@ void ImGuiToolkit::ShowIconsWindow(bool* p_open)
const ImGuiIO& io = ImGui::GetIO();
ImGui::Begin("Icons", p_open);
if ( ImGui::Begin("Icons", p_open) ) {
ImVec2 pos = ImGui::GetCursorScreenPos();
ImGui::Image((void*)(intptr_t)textureicons, ImVec2(640, 640));
@@ -373,6 +373,7 @@ void ImGuiToolkit::ShowIconsWindow(bool* p_open)
ImGui::End();
}
}
void ImGuiToolkit::ToolTip(const char* desc, const char* shortcut)
{

12
Log.cpp
View File

@@ -57,12 +57,8 @@ struct AppLog
ImGui::SetNextWindowPos(ImVec2(430, 660), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(1150, 220), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSizeConstraints(ImVec2(600, 180), ImVec2(FLT_MAX, FLT_MAX));
if (!ImGui::Begin(title, p_open))
if (ImGui::Begin(title, p_open))
{
ImGui::End();
return;
}
// window
ImGui::SameLine(0, 0);
static bool numbering = true;
@@ -75,8 +71,8 @@ struct AppLog
Filter.Draw("Filter", -60.0f);
ImGui::Separator();
ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_AlwaysHorizontalScrollbar);
if ( ImGui::BeginChild("scrolling", ImVec2(0,0), false, ImGuiWindowFlags_AlwaysHorizontalScrollbar) )
{
if (clear)
Clear();
if (copy)
@@ -138,8 +134,10 @@ struct AppLog
ImGui::SetScrollHereY(1.0f);
ImGui::EndChild();
}
ImGui::End();
}
}
};
static AppLog logs;