rename draw to Render (pedantic programming uniformity)

This commit is contained in:
brunoherbelin
2020-07-20 20:16:25 +02:00
parent 68cdb6b45d
commit 9cb53bc421
2 changed files with 5 additions and 5 deletions

View File

@@ -1522,7 +1522,7 @@ Source * SourcePreview::getSource()
return s; return s;
} }
void SourcePreview::draw(float width) void SourcePreview::Render(float width, bool controlbutton)
{ {
if(source_) { if(source_) {
// cancel if failed // cancel if failed
@@ -1540,7 +1540,7 @@ void SourcePreview::draw(float width)
ImVec2 preview_size(width, width / source_->frame()->aspectRatio()); ImVec2 preview_size(width, width / source_->frame()->aspectRatio());
ImGui::Image((void*)(uintptr_t) source_->frame()->texture(), preview_size); ImGui::Image((void*)(uintptr_t) source_->frame()->texture(), preview_size);
if (source_->ready()) { if (controlbutton && source_->ready()) {
ImVec2 pos = ImGui::GetCursorPos(); ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(); ImGui::SameLine();
if (ImGuiToolkit::IconToggle(9,7,1,8, &active)) if (ImGuiToolkit::IconToggle(9,7,1,8, &active))
@@ -1617,7 +1617,7 @@ void Navigator::RenderNewPannel()
// if a new source was added // if a new source was added
if (new_source_preview_.ready()) { if (new_source_preview_.ready()) {
// show preview // 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 // or press Validate button
ImGui::Text(" "); ImGui::Text(" ");
if ( ImGui::Button(ICON_FA_CHECK " Create", ImVec2(pannel_width_ - padding_width_, 0)) ) { 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 a new source was added
if (new_source_preview_.ready()) { if (new_source_preview_.ready()) {
// show preview // 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 // ask to import the source in the mixer
ImGui::Text(" "); ImGui::Text(" ");
if ( ImGui::Button( ICON_FA_CHECK " Create", ImVec2(pannel_width_ - padding_width_, 0)) ) { if ( ImGui::Button( ICON_FA_CHECK " Create", ImVec2(pannel_width_ - padding_width_, 0)) ) {

View File

@@ -26,7 +26,7 @@ public:
void setSource(Source *s = nullptr, std::string label = ""); void setSource(Source *s = nullptr, std::string label = "");
Source *getSource(); Source *getSource();
void draw(float width); void Render(float width, bool controlbutton = false);
inline bool ready() const { return source_ != nullptr; } inline bool ready() const { return source_ != nullptr; }
}; };