From cbe821779031c4ad578cafb111705c2bcb8356df Mon Sep 17 00:00:00 2001 From: Bruno Herbelin Date: Sun, 5 Mar 2023 23:35:06 +0100 Subject: [PATCH] UX improvements, highlight icon button, ComboIcon, reset value label Major changes in ImGuiVisitor (all image filtering and ImageProcessingShader), new imGuiToolkit ComboIcon (replacing previous ComboIcon widget), new icons, --- rsc/images/icons.dds | Bin 1638528 -> 1638528 bytes src/FrameBufferFilter.cpp | 12 +- src/FrameBufferFilter.h | 7 +- src/ImGuiToolkit.cpp | 149 +++++++------- src/ImGuiToolkit.h | 4 +- src/ImGuiVisitor.cpp | 368 ++++++++++++++++++++--------------- src/InfoVisitor.cpp | 4 +- src/RenderSource.cpp | 4 +- src/RenderSource.h | 2 +- src/UserInterfaceManager.cpp | 20 +- src/defines.h | 2 +- 11 files changed, 333 insertions(+), 239 deletions(-) diff --git a/rsc/images/icons.dds b/rsc/images/icons.dds index 4c190c2599bb2e24b7c518087bd2c2ca93ca251b..1bd6f5f7868fef5c7aa7239c28c145b3661844be 100644 GIT binary patch delta 1331 zcmcIjYe*DP6rMZo?CLh-%s$lghb{KfN=y-xv=V|6DR2v^UzHe=2qi{=MeGhusnNqp z=+c99g)sUNyOiF@NY|8}xNc-rKb!<9ied|lYE5tV&N^z~-_D&gGvA!=e&^hK&v@ni zUUDfwVU;+=q;QH^u_*CMf?`z`-Q`coaD)ey=)-o<2GFUK{2!Yt7a%k$JOiCF=rTHOW%5W=$+!~>i>%;i9DQG zYqEoBxb-PpgZvNqupP>8`4wpzO|2Id!lCKV?~s967;JFXFJq_~-=bI_y#}UFjHlqP z9b66Sd&vihXaMBIPlRFv-mFVFp7gJTC#nxvTFo_~;SYR(%ozkZDP%@u0#E3Qv>w1T zUnT%H_E@$F98MsE7>%f2SA0w)>Vc(at<5ML<^6O$AP4&Uot3Tb^qhH&cFIT;DC6tG zjJsBk+L(sMGK6+Q0_=h^-CT_-yHL15S4vu#^o(mj!7`zb$YilDNuxE#j8^`;H7xJ5 z(4{2cRQRSYF4Gq6rCUl*D7LsM=pN4@%<6n46C&$W<#Pxy;O!jO8Lhm_8 z8anevv^Ze+73WVGcTIZn$2ob7HSED_TJMb%qLweBO!?bv+GF!>pg z(YZLobCyDW;swXokDRzI39lycXl{CEGz!FY956ts^L)Gg>J|`)Tl^(m#Mkoh`Mg$%Py%e-dYv)7I zEf#|%ocm)R=6g{*`V1dQGlz-}Sn!RhcJHOeFncw&QzJD{UBwv*1 zr$EJ~Fbb>K6^Bxw>{0eAPNnb(H!S1fZWw}SIcbmJ;agnVgXIC(57GOi{lTP+I4_n( zMub?K;#REljCEG!3jBJBd*k&JkXeMv6cuuabP%1O@Rx!+DDb?n83kY3LU>_~oAx4k zUttu9J)Ek_B3}H(#q&%Jc%_Kf@=T3*wThp}Gtt1Ke14!0zia1T zPQnwn`PHl+>S$48T2Sx`C!v+3U7M62@^s)q+aScjDu)Wga-7Fq9tS>}@W2TuLC-uZR#^OtF zT{S{=^o%5 z*fN)13tlm#m!wQ=)C1s{#aE?PB(4|PnOQK0z8-*eJe{A|O}Z)_eyX}F1Q^_OVXJMw%d-pX*acyGTFlBy`e?AlI zwivhx>T?=Dfi)j(%?F0ELz&Dp8CpllUQYmCLtDL`@}|oHD~cp$`~sz$+-hz2bNwM3 zDK%mGov7;!+oDEF@MMjU|ls$QxBRUg%2s(z{^SZgZP G=l%lWyjN)e diff --git a/src/FrameBufferFilter.cpp b/src/FrameBufferFilter.cpp index 055cf21..374b5c1 100644 --- a/src/FrameBufferFilter.cpp +++ b/src/FrameBufferFilter.cpp @@ -5,8 +5,16 @@ #include "FrameBufferFilter.h" #include "FrameBufferFilter.h" -const char* FrameBufferFilter::type_label[FrameBufferFilter::FILTER_INVALID] = { - "None", "Delay", "Resample", "Blur", "Sharpen", "Smooth & Noise", "Edge", "Alpha", "Custom shader" +std::vector< std::tuple > FrameBufferFilter::Types = { + { ICON_FILTER_NONE, std::string("None") }, + { ICON_FILTER_DELAY, std::string("Delay") }, + { ICON_FILTER_RESAMPLE, std::string("Resample") }, + { ICON_FILTER_BLUR, std::string("Blur") }, + { ICON_FILTER_SHARPEN, std::string("Sharpen") }, + { ICON_FILTER_SMOOTH, std::string("Smooth & Noise") }, + { ICON_FILTER_EDGE, std::string("Edge") }, + { ICON_FILTER_ALPHA, std::string("Alpha") }, + { ICON_FILTER_IMAGE, std::string("Custom shader") } }; FrameBufferFilter::FrameBufferFilter() : enabled_(true), input_(nullptr) diff --git a/src/FrameBufferFilter.h b/src/FrameBufferFilter.h index 73ef0c5..e226ade 100644 --- a/src/FrameBufferFilter.h +++ b/src/FrameBufferFilter.h @@ -1,13 +1,15 @@ #ifndef FRAMEBUFFERFILTER_H #define FRAMEBUFFERFILTER_H +#include +#include #include #include class Visitor; class FrameBuffer; - +#define ICON_FILTER_NONE 7, 11 #define ICON_FILTER_DELAY 10, 15 #define ICON_FILTER_RESAMPLE 1, 10 #define ICON_FILTER_BLUR 0, 9 @@ -17,7 +19,6 @@ class FrameBuffer; #define ICON_FILTER_ALPHA 13, 4 #define ICON_FILTER_IMAGE 1, 4 - class FrameBufferFilter { bool enabled_; @@ -40,7 +41,7 @@ public: FILTER_IMAGE, FILTER_INVALID } Type; - static const char* type_label[FILTER_INVALID]; + static std::vector< std::tuple > Types; virtual Type type () const = 0; // get the texture id of the rendered filtered framebuffer diff --git a/src/ImGuiToolkit.cpp b/src/ImGuiToolkit.cpp index 960e0b8..eb75724 100644 --- a/src/ImGuiToolkit.cpp +++ b/src/ImGuiToolkit.cpp @@ -169,6 +169,26 @@ bool ImGuiToolkit::ButtonSwitch(const char* label, bool* toggle, const char* sho /// 13 4, 13 5, 14 16, 15 1, 15 6, 15 12, 15 16, 16 1, 16 5, 16 7, 16 10, 16 16, 17 6, /// 18 1, 18 5, 18 12, 18 13, 18 15, 19 6, 19 12, + + +void _drawIcon(ImVec2 screenpos, int i, int j, bool enabled = true) +{ + // icons.dds is a 20 x 20 grid of icons + if (textureicons == 0) + textureicons = Resource::getTextureDDS("images/icons.dds"); + + ImVec2 uv0( static_cast(i) * 0.05, static_cast(j) * 0.05 ); + ImVec2 uv1( uv0.x + 0.05, uv0.y + 0.05 ); + + ImVec4 tint_color = ImGui::GetStyle().Colors[ImGuiCol_Text]; + if (!enabled) + tint_color = ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]; + + ImGuiWindow* window = ImGui::GetCurrentWindow(); + ImRect bb(screenpos, screenpos + ImVec2(ImGui::GetTextLineHeightWithSpacing(), ImGui::GetTextLineHeightWithSpacing())); + window->DrawList->AddImage((void*)(intptr_t)textureicons, bb.Min, bb.Max, uv0, uv1, ImGui::GetColorU32(tint_color) ); +} + void ImGuiToolkit::Icon(int i, int j, bool enabled) { // icons.dds is a 20 x 20 grid of icons @@ -274,7 +294,7 @@ bool ImGuiToolkit::IconButton(int i, int j, const char *tooltip, const char* sho // draw icon with hovered color const ImVec4* colors = ImGui::GetStyle().Colors; - ImGui::PushStyleColor( ImGuiCol_Text, hovered ? colors[ImGuiCol_NavWindowingHighlight] : colors[ImGuiCol_Text] ); + ImGui::PushStyleColor( ImGuiCol_Text, hovered ? colors[ImGuiCol_NavHighlight] : colors[ImGuiCol_Text] ); Icon(i, j, !pressed); ImGui::PopStyleColor(); @@ -302,7 +322,7 @@ bool ImGuiToolkit::IconButton(const char* icon, const char *tooltip, const char* // draw with hovered color const ImVec4* colors = ImGui::GetStyle().Colors; - ImGui::PushStyleColor( ImGuiCol_Text, ImGui::IsItemHovered() ? colors[ImGuiCol_NavWindowingHighlight] : colors[ImGuiCol_Text] ); + ImGui::PushStyleColor( ImGuiCol_Text, ImGui::IsItemHovered() ? colors[ImGuiCol_NavHighlight] : colors[ImGuiCol_Text] ); ImGui::Text("%s", icon); ImGui::PopStyleColor(); @@ -310,6 +330,48 @@ bool ImGuiToolkit::IconButton(const char* icon, const char *tooltip, const char* return ret; } +bool ImGuiToolkit::TextButton(const char* text, const char *tooltip, const char* shortcut) +{ + ImGuiContext& g = *GImGui; + bool ret = false; + + // identifyer + ImGui::PushID( text ); + + // button size + ImVec2 button_size = ImGui::CalcTextSize( text ); + button_size.y = g.FontSize + g.Style.FramePadding.y * 2.0f; + + // remember position where button starts + ImVec2 draw_pos = ImGui::GetCursorScreenPos(); + + // invisible button + ImGui::InvisibleButton("##hiddenTextbutton", button_size); + if (ImGui::IsItemClicked()) + ret = true; + if (tooltip != nullptr && ImGui::IsItemHovered()) + ImGuiToolkit::ToolTip(tooltip, shortcut); + + // remember position where button ends + ImVec2 end_pos = ImGui::GetCursorScreenPos(); + + // draw text at button start (centered verticaly) + // with highlight color on button hovered + draw_pos.y += g.Style.FramePadding.y; + ImGui::SetCursorScreenPos(draw_pos); + ImGui::PushStyleColor( ImGuiCol_Text, ImGui::IsItemHovered() ? g.Style.Colors[ImGuiCol_NavHighlight] : g.Style.Colors[ImGuiCol_Text] ); + ImGui::Text("%s", text); + ImGui::PopStyleColor(); + + // back position to end of button + ImGui::SetCursorScreenPos(end_pos); + + ImGui::PopID(); + + // return if button pressed + return ret; +} + bool ImGuiToolkit::IconToggle(int i, int j, int i_toggle, int j_toggle, bool* toggle, const char *tooltips[]) { @@ -329,7 +391,7 @@ bool ImGuiToolkit::IconToggle(int i, int j, int i_toggle, int j_toggle, bool* to // draw with hovered color const ImVec4* colors = ImGui::GetStyle().Colors; - ImGui::PushStyleColor( ImGuiCol_Text, ImGui::IsItemHovered() ? colors[ImGuiCol_NavWindowingHighlight] : colors[ImGuiCol_Text] ); + ImGui::PushStyleColor( ImGuiCol_Text, ImGui::IsItemHovered() ? colors[ImGuiCol_NavHighlight] : colors[ImGuiCol_Text] ); ImGui::SetCursorScreenPos(draw_pos); if (*toggle) { Icon(i_toggle, j_toggle, !ret); @@ -401,56 +463,14 @@ bool ImGuiToolkit::ButtonIconMultistate(std::vector > icons, return ret; } -bool ImGuiToolkit::ComboIcon (std::vector > icons, std::vector labels, int* state) -{ - bool ret = false; - Sum id = std::for_each(icons.begin(), icons.end(), Sum()); - ImGui::PushID( id.sum ); - - ImVec2 draw_pos = ImGui::GetCursorScreenPos(); - float w = ImGui::GetTextLineHeight(); - ImGui::SetNextItemWidth(w * 2.7f); - if (ImGui::BeginCombo("##ComboIcon", " ") ) - { - char space_buf[] = " "; - const ImVec2 space_size = ImGui::CalcTextSize(" ", NULL); - const int space_num = static_cast( ceil(ImGui::GetTextLineHeightWithSpacing() / space_size.x) ); - space_buf[space_num]='\0'; - - std::vector >::iterator it_icon = icons.begin(); - std::vector::iterator it_label = labels.begin(); - for(int i = 0 ; it_icon != icons.end(); i++, ++it_icon, ++it_label) { - ImGui::PushID( id.sum + i + 1); - ImVec2 pos = ImGui::GetCursorScreenPos(); - // combo selectable item - char text_buf[256]; - ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%s %s", space_buf, it_label->c_str()); - if ( ImGui::Selectable(text_buf, i == *state )){ - *state = i; - ret = true; - } - // draw item icon - ImGui::SetCursorScreenPos( pos + ImVec2(w/6.f,0) ); - Icon( (*it_icon).first, (*it_icon).second ); - ImGui::PopID(); - } - ImGui::EndCombo(); - } - - // redraw current ad preview value - ImGui::SetCursorScreenPos(draw_pos + ImVec2(w/9.f,w/9.f)); - Icon(icons[*state].first, icons[*state].second ); - - ImGui::PopID(); - return ret; -} - -bool ImGuiToolkit::ComboIcon (const char* label, std::vector > icons, std::vector items, int* i) +bool ImGuiToolkit::ComboIcon (const char* label, int* current_item, std::vector< std::tuple > items) { bool ret = false; ImGuiContext& g = *GImGui; ImVec2 draw_pos = ImGui::GetCursorScreenPos() + g.Style.FramePadding * 0.5; + *current_item = CLAMP( *current_item, 0, (int) items.size() - 1); + // make some space char space_buf[] = " "; const ImVec2 space_size = ImGui::CalcTextSize(" ", NULL); @@ -458,25 +478,26 @@ bool ImGuiToolkit::ComboIcon (const char* label, std::vector space_buf[space_num]='\0'; char text_buf[256]; - ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%s %s", space_buf, items[*i].c_str()); + ImFormatString(text_buf, IM_ARRAYSIZE(text_buf), "%s %s", space_buf, std::get<2>( items.at(*current_item) ).c_str()); + + if ( ImGui::BeginCombo( label, text_buf, ImGuiComboFlags_None) ) { - if (ImGui::BeginCombo(label, text_buf)) - { for (int p = 0; p < (int) items.size(); ++p){ - if (ImGuiToolkit::SelectableIcon( items[p].c_str(), icons[p].first, icons[p].second, p == *i) ) { - *i = p; + ImGui::PushID((void*)(intptr_t)p); + if (ImGuiToolkit::SelectableIcon( std::get<2>( items.at(p) ).c_str(), + std::get<0>( items.at(p) ), + std::get<1>( items.at(p) ), + p == *current_item) ) { + *current_item = p; ret = true; } + ImGui::PopID(); } ImGui::EndCombo(); } - ImVec2 end_pos = ImGui::GetCursorScreenPos(); - // draw icon - ImGui::SetCursorScreenPos(draw_pos); - Icon(icons[*i].first, icons[*i].second); - - ImGui::SetCursorScreenPos(end_pos); + // overlay of icon on top of first item + _drawIcon(draw_pos, std::get<0>( items.at(*current_item) ), std::get<1>( items.at(*current_item) )); return ret; } @@ -497,13 +518,9 @@ bool ImGuiToolkit::SelectableIcon(const char* label, int i, int j, bool selected // draw menu item bool ret = ImGui::Selectable(text_buf, selected); - ImVec2 end_pos = ImGui::GetCursorScreenPos(); - // draw icon - ImGui::SetCursorScreenPos(draw_pos); - Icon(i, j); - - ImGui::SetCursorScreenPos(end_pos); + // overlay of icon on top of first item + _drawIcon(draw_pos, i, j); return ret; } @@ -1710,7 +1727,7 @@ void ImGuiToolkit::SetAccentColor(accent_color color) colors[ImGuiCol_PlotHistogram] = ImVec4(0.66f, 0.40f, 0.83f, 1.00f); colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.75f, 0.60f, 0.84f, 1.00f); colors[ImGuiCol_TextSelectedBg] = ImVec4(0.47f, 0.62f, 0.49f, 0.71f); - colors[ImGuiCol_NavHighlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f); + colors[ImGuiCol_NavHighlight] = ImVec4(0.58f, 0.84f, 0.67f, 1.00f); } else { // default BLUE diff --git a/src/ImGuiToolkit.h b/src/ImGuiToolkit.h index 10a2411..745704c 100644 --- a/src/ImGuiToolkit.h +++ b/src/ImGuiToolkit.h @@ -28,14 +28,14 @@ namespace ImGuiToolkit bool ButtonIconMultistate (std::vector > icons, int* state, std::vector tooltips); bool MenuItemIcon (int i, int j, const char* label, bool selected = false, bool enabled = true); bool SelectableIcon(const char* label, int i, int j, bool selected = false); - bool ComboIcon (std::vector > icons, std::vector labels, int* state); - bool ComboIcon (const char* label, std::vector > icons, std::vector items, int* i); + bool ComboIcon (const char* label, int* current_item, std::vector > items); // buttons bool ButtonToggle (const char* label, bool* toggle, const char *tooltip = nullptr); bool ButtonSwitch (const char* label, bool* toggle, const char *shortcut = nullptr); void ButtonOpenUrl (const char* label, const char* url, const ImVec2& size_arg = ImVec2(0,0)); void ButtonDisabled(const char* label, const ImVec2& size_arg = ImVec2(0,0)); + bool TextButton (const char* text, const char *tooltip = nullptr, const char *shortcut = nullptr); // tooltip and mouse over help void setToolTipsEnabled (bool on); diff --git a/src/ImGuiVisitor.cpp b/src/ImGuiVisitor.cpp index 2c76a04..7b79e4e 100644 --- a/src/ImGuiVisitor.cpp +++ b/src/ImGuiVisitor.cpp @@ -263,110 +263,146 @@ void ImGuiVisitor::visit(Shader &n) void ImGuiVisitor::visit(ImageProcessingShader &n) { + std::ostringstream oss; ImGui::PushID(std::to_string(n.id()).c_str()); - if (ImGuiToolkit::IconButton(6, 4)) { - n.gamma = glm::vec4(1.f, 1.f, 1.f, 1.f); - Action::manager().store("Gamma & Color"); - } - ImGui::SameLine(0, IMGUI_SAME_LINE); + /// + /// GAMMA + /// ImGui::ColorEdit3("Gamma Color", glm::value_ptr(n.gamma), ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel) ; - if (ImGui::IsItemDeactivatedAfterEdit()) - Action::manager().store("Gamma Color changed"); + if (ImGui::IsItemDeactivatedAfterEdit()) { + char buf[64]; + ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp((int)ceil(255.f * n.gamma.x),0,255), + ImClamp((int)ceil(255.f * n.gamma.y),0,255), ImClamp((int)ceil(255.f * n.gamma.z),0,255)); + oss << "Gamma color " << buf; + Action::manager().store(oss.str()); + } - ImGui::SameLine(0, 5); + ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGui::SliderFloat("Gamma", &n.gamma.w, 0.5f, 10.f, "%.2f", 2.f); + ImGui::SliderFloat("##Gamma", &n.gamma.w, 0.5f, 10.f, "%.2f", 2.f); if (ImGui::IsItemDeactivatedAfterEdit()){ - std::ostringstream oss; oss << "Gamma " << std::setprecision(2) << n.gamma.w; Action::manager().store(oss.str()); } - -// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); -// ImGui::SliderFloat4("Levels", glm::value_ptr(n.levels), 0.0, 1.0); - - if (ImGuiToolkit::IconButton(5, 16)) { - n.brightness = 0.f; - n.contrast = 0.f; - Action::manager().store("B & C 0.0 0.0"); - } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - float bc[2] = { n.brightness, n.contrast}; - if ( ImGui::SliderFloat2("B & C", bc, -1.0, 1.0) ) - { - n.brightness = bc[0]; - n.contrast = bc[1]; - } - if (ImGui::IsItemDeactivatedAfterEdit()){ - std::ostringstream oss; - oss << "B & C " << std::setprecision(2) << n.brightness << " " << n.contrast; + if (ImGuiToolkit::TextButton("Gamma")) { + n.gamma = glm::vec4(1.f, 1.f, 1.f, 1.f); + oss << "Gamma 1.0, #FFFFFF"; Action::manager().store(oss.str()); } - if (ImGuiToolkit::IconButton(9, 16)) { - n.saturation = 0.f; - Action::manager().store("Saturation 0.0"); + /// + /// BRIGHTNESS + /// + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + ImGui::SliderFloat("##Brightness", &n.brightness, -1.0, 1.0); + if (ImGui::IsItemDeactivatedAfterEdit()){ + oss << "Brightness " << std::setprecision(2) << n.brightness; + Action::manager().store(oss.str()); } ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Brightness")) { + n.brightness = 0.f; + oss << "Brightness " << std::setprecision(2) << n.brightness; + Action::manager().store(oss.str()); + } + + /// + /// CONTRAST + /// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGui::SliderFloat("Saturation", &n.saturation, -1.0, 1.0); + ImGui::SliderFloat("##Contrast", &n.contrast, -1.0, 1.0); if (ImGui::IsItemDeactivatedAfterEdit()){ - std::ostringstream oss; + oss << "Contrast " << std::setprecision(2) << n.contrast; + Action::manager().store(oss.str()); + } + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Contrast")) { + n.contrast = 0.f; + oss << "Contrast " << std::setprecision(2) << n.contrast; + Action::manager().store(oss.str()); + } + + /// + /// SATURATION + /// + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + ImGui::SliderFloat("##Saturation", &n.saturation, -1.0, 1.0); + if (ImGui::IsItemDeactivatedAfterEdit()){ + oss << "Saturation " << std::setprecision(2) << n.saturation; + Action::manager().store(oss.str()); + } + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Saturation")) { + n.saturation = 0.f; oss << "Saturation " << std::setprecision(2) << n.saturation; Action::manager().store(oss.str()); } - if (ImGuiToolkit::IconButton(12, 4)) { - n.hueshift = 0.f; - Action::manager().store("Hue shift 0.0"); - } - ImGui::SameLine(0, IMGUI_SAME_LINE); + /// + /// HUE SHIFT + /// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGui::SliderFloat("Hue", &n.hueshift, 0.0, 1.0); + ImGui::SliderFloat("##Hue", &n.hueshift, 0.0, 1.0); if (ImGui::IsItemDeactivatedAfterEdit()){ - std::ostringstream oss; oss << "Hue shift " << std::setprecision(2) << n.hueshift; Action::manager().store(oss.str()); } - - if (ImGuiToolkit::IconButton(8, 1)) { - n.threshold = 0.f; - Action::manager().store("Threshold None"); - } ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Hue ")) { + n.hueshift = 0.f; + oss << "Hue shift " << std::setprecision(2) << n.hueshift; + Action::manager().store(oss.str()); + } + + /// + /// THRESHOLD + /// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGui::SliderFloat("Threshold", &n.threshold, 0.0, 1.0, n.threshold < 0.001 ? "None" : "%.2f"); + ImGui::SliderFloat("##Threshold", &n.threshold, 0.0, 1.0, n.threshold < 0.001 ? "None" : "%.2f"); if (ImGui::IsItemDeactivatedAfterEdit()){ - std::ostringstream oss; oss << "Threshold "; if (n.threshold < 0.001) oss << "None"; else oss << std::setprecision(2) << n.threshold; Action::manager().store(oss.str()); } - - if (ImGuiToolkit::IconButton(18, 1)) { - n.nbColors = 0; - Action::manager().store("Posterize None"); - } ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Threshold ")) { + n.threshold = 0.f; + oss << "Threshold None"; + Action::manager().store(oss.str()); + } + + /// + /// POSTERIZATION + /// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGui::SliderInt("Posterize", &n.nbColors, 0, 16, n.nbColors == 0 ? "None" : "%d colors"); + ImGui::SliderInt("##Posterize", &n.nbColors, 0, 16, n.nbColors == 0 ? "None" : "%d colors"); if (ImGui::IsItemDeactivatedAfterEdit()){ std::ostringstream oss; oss << "Posterize "; if (n.nbColors == 0) oss << "None"; else oss << n.nbColors; Action::manager().store(oss.str()); } - - if (ImGuiToolkit::IconButton(6, 16)) { - n.invert = 0; - Action::manager().store("Invert None"); - } ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Posterize ")) { + n.nbColors = 0.f; + oss << "Posterize None"; + Action::manager().store(oss.str()); + } + + /// + /// INVERSION + /// ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - if (ImGui::Combo("Invert", &n.invert, "None\0Color RGB\0Luminance\0")) + if (ImGui::Combo("##Invert", &n.invert, "None\0Color RGB\0Luminance\0")) Action::manager().store("Invert " + std::string(n.invert<1 ? "None": (n.invert>1 ? "Luminance" : "Color"))); + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Invert ")) { + n.invert = 0; + oss << "Invert None"; + Action::manager().store(oss.str()); + } ImGui::PopID(); @@ -746,7 +782,7 @@ void ImGuiVisitor::visit (RenderSource& s) ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); int m = (int) s.renderingProvenance(); - if (ImGui::Combo("Render", &m, RenderSource::rendering_provenance_label, IM_ARRAYSIZE(RenderSource::rendering_provenance_label)) ) + if (ImGuiToolkit::ComboIcon("##SelectRender", &m, RenderSource::ProvenanceMethod)) s.setRenderingProvenance((RenderSource::RenderSourceProvenance)m); } @@ -763,39 +799,43 @@ void ImGuiVisitor::visit (PassthroughFilter&) void ImGuiVisitor::visit (DelayFilter& f) { - if (ImGuiToolkit::IconButton(ICON_FILTER_DELAY)) { - f.setDelay(0.f); - Action::manager().store("Delay 0 s"); - } - ImGui::SameLine(0, IMGUI_SAME_LINE); +// if (ImGuiToolkit::IconButton(ICON_FILTER_DELAY)) { +// f.setDelay(0.f); +// Action::manager().store("Delay 0 s"); +// } +// ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); float d = f.delay(); - if (ImGui::SliderFloat("Delay", &d, 0.f, 2.f, "%.2f s")) + if (ImGui::SliderFloat("##Delay", &d, 0.f, 2.f, "%.2f s")) f.setDelay(d); if (ImGui::IsItemDeactivatedAfterEdit()) { std::ostringstream oss; oss << "Delay " << std::setprecision(3) << d << " s"; Action::manager().store(oss.str()); } + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Delay ")) { + f.setDelay(0.5f); + Action::manager().store("Delay 0.5 s"); + } } void ImGuiVisitor::visit (ResampleFilter& f) { std::ostringstream oss; - // Resampling Factor selection - if (ImGuiToolkit::IconButton(ICON_FILTER_RESAMPLE)) { - f.setFactor( 0 ); - oss << "Resample " << ResampleFilter::factor_label[0]; + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + int m = (int) f.factor(); + if (ImGui::Combo("##Factor", &m, ResampleFilter::factor_label, IM_ARRAYSIZE(ResampleFilter::factor_label) )) { + f.setFactor( m ); + oss << "Resample " << ResampleFilter::factor_label[m]; Action::manager().store(oss.str()); info.reset(); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int m = (int) f.factor(); - if (ImGui::Combo("Factor", &m, ResampleFilter::factor_label, IM_ARRAYSIZE(ResampleFilter::factor_label) )) { - f.setFactor( m ); - oss << "Resample " << ResampleFilter::factor_label[m]; + if (ImGuiToolkit::TextButton("Factor")) { + f.setFactor( 0 ); + oss << "Resample " << ResampleFilter::factor_label[0]; Action::manager().store(oss.str()); info.reset(); } @@ -808,21 +848,21 @@ void list_parameters_(ImageFilter &f, std::ostringstream &oss) { ImGui::PushID( param->first.c_str() ); float v = param->second; - if (ImGuiToolkit::IconButton(13, 14)) { - v = 0.f; - f.setProgramParameter(param->first, v); - oss << " : " << param->first << " " << std::setprecision(3) << v; - Action::manager().store(oss.str()); - } - ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - if (ImGui::SliderFloat( param->first.c_str(), &v, 0.f, 1.f, "%.2f")) { + if (ImGui::SliderFloat( "##ImageFilterParameterEdit", &v, 0.f, 1.f, "%.2f")) { f.setProgramParameter(param->first, v); } if (ImGui::IsItemDeactivatedAfterEdit()) { oss << " : " << param->first << " " << std::setprecision(3) <second; Action::manager().store(oss.str()); } + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton( param->first.c_str() )) { + v = 0.5f; + f.setProgramParameter(param->first, v); + oss << " : " << param->first << " " << std::setprecision(3) << v; + Action::manager().store(oss.str()); + } ImGui::PopID(); } } @@ -833,17 +873,17 @@ void ImGuiVisitor::visit (BlurFilter& f) oss << "Blur "; // Method selection - if (ImGuiToolkit::IconButton(ICON_FILTER_BLUR)) { - f.setMethod( 0 ); - oss << BlurFilter::method_label[0]; + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + int m = (int) f.method(); + if (ImGui::Combo("##MethodBlur", &m, BlurFilter::method_label, IM_ARRAYSIZE(BlurFilter::method_label) )) { + f.setMethod( m ); + oss << BlurFilter::method_label[m]; Action::manager().store(oss.str()); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int m = (int) f.method(); - if (ImGui::Combo("Method", &m, BlurFilter::method_label, IM_ARRAYSIZE(BlurFilter::method_label) )) { - f.setMethod( m ); - oss << BlurFilter::method_label[m]; + if (ImGuiToolkit::TextButton("Method ")) { + f.setMethod( 0 ); + oss << BlurFilter::method_label[0]; Action::manager().store(oss.str()); } @@ -857,17 +897,17 @@ void ImGuiVisitor::visit (SharpenFilter& f) oss << "Sharpen "; // Method selection - if (ImGuiToolkit::IconButton(ICON_FILTER_SHARPEN)) { - f.setMethod( 0 ); - oss << SharpenFilter::method_label[0]; + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + int m = (int) f.method(); + if (ImGui::Combo("##MethodSharpen", &m, SharpenFilter::method_label, IM_ARRAYSIZE(SharpenFilter::method_label) )) { + f.setMethod( m ); + oss << SharpenFilter::method_label[m]; Action::manager().store(oss.str()); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int m = (int) f.method(); - if (ImGui::Combo("Method", &m, SharpenFilter::method_label, IM_ARRAYSIZE(SharpenFilter::method_label) )) { - f.setMethod( m ); - oss << SharpenFilter::method_label[m]; + if (ImGuiToolkit::TextButton("Method")) { + f.setMethod( 0 ); + oss << SharpenFilter::method_label[0]; Action::manager().store(oss.str()); } @@ -881,17 +921,17 @@ void ImGuiVisitor::visit (SmoothFilter& f) oss << "Smooth "; // Method selection - if (ImGuiToolkit::IconButton(ICON_FILTER_SMOOTH)) { - f.setMethod( 0 ); - oss << SmoothFilter::method_label[0]; + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + int m = (int) f.method(); + if (ImGui::Combo("##MethodSmooth", &m, SmoothFilter::method_label, IM_ARRAYSIZE(SmoothFilter::method_label) )) { + f.setMethod( m ); + oss << SmoothFilter::method_label[m]; Action::manager().store(oss.str()); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int m = (int) f.method(); - if (ImGui::Combo("Method", &m, SmoothFilter::method_label, IM_ARRAYSIZE(SmoothFilter::method_label) )) { - f.setMethod( m ); - oss << SmoothFilter::method_label[m]; + if (ImGuiToolkit::TextButton("Method")) { + f.setMethod( 0 ); + oss << SmoothFilter::method_label[0]; Action::manager().store(oss.str()); } @@ -905,17 +945,17 @@ void ImGuiVisitor::visit (EdgeFilter& f) oss << "Edge "; // Method selection - if (ImGuiToolkit::IconButton(ICON_FILTER_EDGE)) { - f.setMethod( 0 ); - oss << EdgeFilter::method_label[0]; + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + int m = (int) f.method(); + if (ImGui::Combo("##MethodEdge", &m, EdgeFilter::method_label, IM_ARRAYSIZE(EdgeFilter::method_label) )) { + f.setMethod( m ); + oss << EdgeFilter::method_label[m]; Action::manager().store(oss.str()); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int m = (int) f.method(); - if (ImGui::Combo("Method", &m, EdgeFilter::method_label, IM_ARRAYSIZE(EdgeFilter::method_label) )) { - f.setMethod( m ); - oss << EdgeFilter::method_label[m]; + if (ImGuiToolkit::TextButton("Method")) { + f.setMethod( 0 ); + oss << EdgeFilter::method_label[0]; Action::manager().store(oss.str()); } @@ -928,18 +968,18 @@ void ImGuiVisitor::visit (AlphaFilter& f) std::ostringstream oss; oss << "Alpha "; - // Method selection - if (ImGuiToolkit::IconButton(ICON_FILTER_ALPHA)) { - f.setOperation( 0 ); - oss << AlphaFilter::operation_label[0]; + // Alpha operation selection + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + int m = (int) f.operation(); + if (ImGui::Combo("##Operation", &m, AlphaFilter::operation_label, IM_ARRAYSIZE(AlphaFilter::operation_label) )) { + f.setOperation( m ); + oss << AlphaFilter::operation_label[m]; Action::manager().store(oss.str()); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int m = (int) f.operation(); - if (ImGui::Combo("Operation", &m, AlphaFilter::operation_label, IM_ARRAYSIZE(AlphaFilter::operation_label) )) { - f.setOperation( m ); - oss << AlphaFilter::operation_label[m]; + if (ImGuiToolkit::TextButton("Operation")) { + f.setOperation( 0 ); + oss << AlphaFilter::operation_label[0]; Action::manager().store(oss.str()); } @@ -949,13 +989,8 @@ void ImGuiVisitor::visit (AlphaFilter& f) if ( m == AlphaFilter::ALPHA_CHROMAKEY || m == AlphaFilter::ALPHA_LUMAKEY) { float t = filter_parameters["Threshold"]; - if (ImGuiToolkit::IconButton(13, 14)) { - t = 0.f; - f.setProgramParameter("Threshold", t); - } - ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - if (ImGui::SliderFloat( "Threshold", &t, 0.f, 1.f, "%.2f")) { + if (ImGui::SliderFloat( "##Threshold", &t, 0.f, 1.f, "%.2f")) { f.setProgramParameter("Threshold", t); } if (ImGui::IsItemDeactivatedAfterEdit()) { @@ -963,15 +998,18 @@ void ImGuiVisitor::visit (AlphaFilter& f) oss << " : " << "Threshold" << " " << std::setprecision(3) << t; Action::manager().store(oss.str()); } + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Threshold")) { + t = 0.f; + f.setProgramParameter("Threshold", t); + oss << AlphaFilter::operation_label[ f.operation() ]; + oss << " : " << "Threshold" << " " << std::setprecision(3) << t; + Action::manager().store(oss.str()); + } float v = filter_parameters["Tolerance"]; - if (ImGuiToolkit::IconButton(13, 14)) { - v = 0.f; - f.setProgramParameter("Tolerance", v); - } - ImGui::SameLine(0, IMGUI_SAME_LINE); ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - if (ImGui::SliderFloat( "Tolerance", &v, 0.f, 1.f, "%.2f")) { + if (ImGui::SliderFloat( "##Tolerance", &v, 0.f, 1.f, "%.2f")) { f.setProgramParameter("Tolerance", v); } if (ImGui::IsItemDeactivatedAfterEdit()) { @@ -979,6 +1017,14 @@ void ImGuiVisitor::visit (AlphaFilter& f) oss << " : " << "Tolerance" << " " << std::setprecision(3) << v; Action::manager().store(oss.str()); } + ImGui::SameLine(0, IMGUI_SAME_LINE); + if (ImGuiToolkit::TextButton("Tolerance")) { + v = 0.f; + f.setProgramParameter("Tolerance", v); + oss << AlphaFilter::operation_label[ f.operation() ]; + oss << " : " << "Tolerance" << " " << std::setprecision(3) << v; + Action::manager().store(oss.str()); + } } if ( m == AlphaFilter::ALPHA_CHROMAKEY || m == AlphaFilter::ALPHA_FILL) @@ -995,6 +1041,13 @@ void ImGuiVisitor::visit (AlphaFilter& f) f.setProgramParameter("Green", color[1]); f.setProgramParameter("Blue", color[2]); } + if (ImGui::IsItemDeactivatedAfterEdit()) { + char buf[64]; + ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp((int)ceil(255.f * color[0]),0,255), + ImClamp((int)ceil(255.f * color[1]),0,255), ImClamp((int)ceil(255.f * color[2]),0,255)); + oss << " Color " << buf; + Action::manager().store(oss.str()); + } // offer to pick color ImGui::SameLine(0, IMGUI_SAME_LINE); @@ -1009,7 +1062,13 @@ void ImGuiVisitor::visit (AlphaFilter& f) } } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::Text("Color"); + if (ImGuiToolkit::TextButton("Color")) { + f.setProgramParameter("Red", 0.f); + f.setProgramParameter("Green", 1.f); + f.setProgramParameter("Blue", 0.f); + oss << " Color #00FF00"; + Action::manager().store(oss.str()); + } // get picked color if dialog finished if (colordialog.closed()){ @@ -1017,6 +1076,11 @@ void ImGuiVisitor::visit (AlphaFilter& f) f.setProgramParameter("Red", std::get<0>(c)); f.setProgramParameter("Green", std::get<1>(c)); f.setProgramParameter("Blue", std::get<2>(c)); + char buf[64]; + ImFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", ImClamp((int)ceil(255.f * std::get<0>(c)),0,255), + ImClamp((int)ceil(255.f * std::get<1>(c)),0,255), ImClamp((int)ceil(255.f * std::get<2>(c)),0,255)); + oss << " Color " << buf; + Action::manager().store(oss.str()); } } @@ -1024,18 +1088,14 @@ void ImGuiVisitor::visit (AlphaFilter& f) void ImGuiVisitor::visit (ImageFilter& f) { - // Selection of Algorithm - if (ImGuiToolkit::IconButton(ICON_FILTER_IMAGE)) { - FilteringProgram target; - f.setProgram( target ); - } - // Open Editor - ImGui::SameLine(0, IMGUI_SAME_LINE); if ( ImGui::Button( ICON_FA_CODE " Open editor", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) UserInterface::manager().shadercontrol.setVisible(true); ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::Text("Code"); + if (ImGuiToolkit::TextButton("Code")) { + FilteringProgram target; + f.setProgram( target ); + } } void ImGuiVisitor::visit (CloneSource& s) @@ -1073,18 +1133,18 @@ void ImGuiVisitor::visit (CloneSource& s) // filter selection std::ostringstream oss; oss << s.name(); - if (ImGuiToolkit::IconButton(1, 7)) { - s.setFilter( FrameBufferFilter::FILTER_PASSTHROUGH ); - oss << ": Filter None"; + int type = (int) s.filter()->type(); + ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); + if (ImGuiToolkit::ComboIcon("##SelectFilter", &type, FrameBufferFilter::Types)) { + s.setFilter( FrameBufferFilter::Type(type) ); + oss << ": Filter " << std::get<2>(FrameBufferFilter::Types[type]); Action::manager().store(oss.str()); info.reset(); } ImGui::SameLine(0, IMGUI_SAME_LINE); - ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - int type = (int) s.filter()->type(); - if (ImGui::Combo("Filter", &type, FrameBufferFilter::type_label, IM_ARRAYSIZE(FrameBufferFilter::type_label), FrameBufferFilter::FILTER_INVALID)) { - s.setFilter( FrameBufferFilter::Type(type) ); - oss << ": Filter " << FrameBufferFilter::type_label[type]; + if (ImGuiToolkit::TextButton("Filter")) { + s.setFilter( FrameBufferFilter::FILTER_PASSTHROUGH ); + oss << ": Filter None"; Action::manager().store(oss.str()); info.reset(); } diff --git a/src/InfoVisitor.cpp b/src/InfoVisitor.cpp index bce9a76..2cff27e 100644 --- a/src/InfoVisitor.cpp +++ b/src/InfoVisitor.cpp @@ -211,7 +211,7 @@ void InfoVisitor::visit (RenderSource& s) } else { oss << "Rendering Output ("; - oss << RenderSource::rendering_provenance_label[s.renderingProvenance()] << ") " << std::endl; + oss << std::get<2>(RenderSource::ProvenanceMethod[s.renderingProvenance()]) << ") " << std::endl; oss << (s.frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA" : "RGB") << std::endl; oss << s.frame()->width() << " x " << s.frame()->height(); } @@ -237,7 +237,7 @@ void InfoVisitor::visit (CloneSource& s) if (s.origin()) oss << "Clone of '" << s.origin()->name() << "' " << std::endl; oss << (s.frame()->flags() & FrameBuffer::FrameBuffer_alpha ? "RGBA, " : "RGB, "); - oss << FrameBufferFilter::type_label[s.filter()->type()] << " filter" << std::endl; + oss << std::get<2>(FrameBufferFilter::Types[s.filter()->type()]) << " filter" << std::endl; oss << s.frame()->width() << " x " << s.frame()->height(); } } diff --git a/src/RenderSource.cpp b/src/RenderSource.cpp index 72e2479..c296d9d 100644 --- a/src/RenderSource.cpp +++ b/src/RenderSource.cpp @@ -29,7 +29,9 @@ #include "RenderSource.h" -const char* RenderSource::rendering_provenance_label[2] = { "Loopback", "Non-recursive" }; +std::vector< std::tuple > RenderSource::ProvenanceMethod = { + { 16, 12, "Loopback" }, { 15, 12, "Non-recursive"} +}; RenderSource::RenderSource(uint64_t id) : Source(id), session_(nullptr), runtime_(0), rendered_output_(nullptr), rendered_surface_(nullptr), paused_(false), provenance_(RENDER_TEXTURE) diff --git a/src/RenderSource.h b/src/RenderSource.h index 5317cdb..8899a22 100644 --- a/src/RenderSource.h +++ b/src/RenderSource.h @@ -31,7 +31,7 @@ public: RENDER_TEXTURE = 0, RENDER_EXCLUSIVE } RenderSourceProvenance; - static const char* rendering_provenance_label[2]; + static std::vector< std::tuple > ProvenanceMethod; void setRenderingProvenance(RenderSourceProvenance m) { provenance_ = m; } RenderSourceProvenance renderingProvenance() const { return provenance_; } diff --git a/src/UserInterfaceManager.cpp b/src/UserInterfaceManager.cpp index 2bb13b9..7e52e89 100644 --- a/src/UserInterfaceManager.cpp +++ b/src/UserInterfaceManager.cpp @@ -3870,16 +3870,22 @@ void SourceController::RenderMediaPlayer(MediaSource *ms) ImGui::Spacing(); static int l = 0; - static std::vector< std::pair > icons_loc = { {19,7}, {18,7}, {0,8} }; - static std::vector< std::string > labels_loc = { "Fade in", "Fade out", "Auto fade in & out" }; + static std::vector< std::tuple > fading_options = { + {19, 7, "Fade in"}, + {18, 7, "Fade out"}, + { 0, 8, "Auto fade in & out"} + }; ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGuiToolkit::ComboIcon("Fading", icons_loc, labels_loc, &l); + ImGuiToolkit::ComboIcon("Fading", &l, fading_options); static int c = 0; - static std::vector< std::pair > icons_curve = { {18,3}, {19,3}, {17,3} }; - static std::vector< std::string > labels_curve = { "Linear", "Progressive", "Abrupt" }; + static std::vector< std::tuple > curve_options = { + {18, 3, "Linear"}, + {19, 3, "Progressive"}, + {17, 3, "Abrupt"} + }; ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); - ImGuiToolkit::ComboIcon("Curve", icons_curve, labels_curve, &c); + ImGuiToolkit::ComboIcon("Curve", &c, curve_options); static uint d = 1000; ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); @@ -7334,7 +7340,7 @@ void Navigator::RenderNewPannel() ImGui::SetNextItemWidth(IMGUI_RIGHT_ALIGN); if (ImGui::BeginCombo("##Source", "Select object")) { - std::string label = "Rendering output"; + std::string label = "Rendering Loopback"; if (ImGui::Selectable( label.c_str() )) { new_source_preview_.setSource( Mixer::manager().createSourceRender(), label); } diff --git a/src/defines.h b/src/defines.h index 4d408f6..e456f6f 100644 --- a/src/defines.h +++ b/src/defines.h @@ -83,7 +83,7 @@ #define IMGUI_LABEL_RECENT_FILES " Recent files" #define IMGUI_LABEL_RECENT_RECORDS " Recent recordings" #define IMGUI_RIGHT_ALIGN -3.5f * ImGui::GetTextLineHeightWithSpacing() -#define IMGUI_SAME_LINE 10 +#define IMGUI_SAME_LINE 8 #define IMGUI_TOP_ALIGN 10 #define IMGUI_COLOR_OVERLAY IM_COL32(5, 5, 5, 150) #define IMGUI_COLOR_LIGHT_OVERLAY IM_COL32(5, 5, 5, 50)