GCodeViewer -> Added visualization of percentage in estimated printing time dialog

This commit is contained in:
enricoturri1966 2020-07-20 09:45:49 +02:00
parent afd9429e6d
commit 51f0fd8912
4 changed files with 48 additions and 50 deletions

View file

@ -760,12 +760,10 @@ void ImGuiWrapper::search_list(const ImVec2& size_, bool (*items_getter)(int, co
void ImGuiWrapper::title(const std::string& str)
{
ImGuiWindow* window = ImGui::GetCurrentWindow();
const float frame_height = ImGui::CalcTextSize(str.c_str(), nullptr, false).y;
ImRect frame_bb;
frame_bb.Min = { window->WorkRect.Min.x, window->DC.CursorPos.y };
frame_bb.Max = { window->WorkRect.Max.x, window->DC.CursorPos.y + frame_height };
frame_bb.Max = { window->WorkRect.Max.x, window->DC.CursorPos.y + ImGui::CalcTextSize(str.c_str(), nullptr, false).y };
frame_bb.Min.x -= IM_FLOOR(window->WindowPadding.x * 0.5f - 1.0f);
frame_bb.Max.x += IM_FLOOR(window->WindowPadding.x * 0.5f);