From 9cb53bc4213fc9adcf098c09c260c03d5c132173 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Mon, 20 Jul 2020 20:16:25 +0200 Subject: [PATCH] rename draw to Render (pedantic programming uniformity) --- UserInterfaceManager.cpp | 8 ++++---- UserInterfaceManager.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UserInterfaceManager.cpp b/UserInterfaceManager.cpp index 5b2484a..9cefbba 100644 --- a/UserInterfaceManager.cpp +++ b/UserInterfaceManager.cpp @@ -1522,7 +1522,7 @@ Source * SourcePreview::getSource() return s; } -void SourcePreview::draw(float width) +void SourcePreview::Render(float width, bool controlbutton) { if(source_) { // cancel if failed @@ -1540,7 +1540,7 @@ void SourcePreview::draw(float width) ImVec2 preview_size(width, width / source_->frame()->aspectRatio()); ImGui::Image((void*)(uintptr_t) source_->frame()->texture(), preview_size); - if (source_->ready()) { + if (controlbutton && source_->ready()) { ImVec2 pos = ImGui::GetCursorPos(); ImGui::SameLine(); if (ImGuiToolkit::IconToggle(9,7,1,8, &active)) @@ -1617,7 +1617,7 @@ void Navigator::RenderNewPannel() // if a new source was added if (new_source_preview_.ready()) { // show preview - new_source_preview_.draw(ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN); + new_source_preview_.Render(ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN, true); // or press Validate button ImGui::Text(" "); if ( ImGui::Button(ICON_FA_CHECK " Create", ImVec2(pannel_width_ - padding_width_, 0)) ) { @@ -1657,7 +1657,7 @@ void Navigator::RenderNewPannel() // if a new source was added if (new_source_preview_.ready()) { // show preview - new_source_preview_.draw(ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN); + new_source_preview_.Render(ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN); // ask to import the source in the mixer ImGui::Text(" "); if ( ImGui::Button( ICON_FA_CHECK " Create", ImVec2(pannel_width_ - padding_width_, 0)) ) { diff --git a/UserInterfaceManager.h b/UserInterfaceManager.h index a3f6cec..7501bad 100644 --- a/UserInterfaceManager.h +++ b/UserInterfaceManager.h @@ -26,7 +26,7 @@ public: void setSource(Source *s = nullptr, std::string label = ""); Source *getSource(); - void draw(float width); + void Render(float width, bool controlbutton = false); inline bool ready() const { return source_ != nullptr; } };