Revert "Cleanup tooltips."

This reverts commit d23267d333.
This commit is contained in:
brunoherbelin
2021-01-31 20:09:11 +01:00
committed by Bruno
parent d23267d333
commit d76dfa4a9d
3 changed files with 17 additions and 13 deletions

View File

@@ -226,8 +226,12 @@ bool ImGuiToolkit::IconToggle(int i, int j, int i_toggle, int j_toggle, bool* to
} }
int tooltipid = *toggle ? 1 : 0; int tooltipid = *toggle ? 1 : 0;
if (tooltips != nullptr && IM_ARRAYSIZE(*tooltips) > 1 && ImGui::IsItemHovered()) if (tooltips != nullptr && tooltips[tooltipid] != nullptr && ImGui::IsItemHovered())
ImGuiToolkit::ToolTip(tooltips[tooltipid]); {
ImGui::BeginTooltip();
ImGui::Text("%s", tooltips[tooltipid]);
ImGui::EndTooltip();
}
ImGui::PopID(); ImGui::PopID();
return ret; return ret;
@@ -338,7 +342,7 @@ void ImGuiToolkit::ToolTip(const char* desc, const char* shortcut)
{ {
ImGuiToolkit::PushFont(ImGuiToolkit::FONT_DEFAULT); ImGuiToolkit::PushFont(ImGuiToolkit::FONT_DEFAULT);
ImGui::BeginTooltip(); ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 13.0f); ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
ImGui::TextUnformatted(desc); ImGui::TextUnformatted(desc);
ImGui::PopTextWrapPos(); ImGui::PopTextWrapPos();

View File

@@ -421,15 +421,15 @@ void ImGuiVisitor::visit (Source& s)
// Inform on workspace // Inform on workspace
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + ImGui::GetFrameHeightWithSpacing()) ); ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + ImGui::GetFrameHeightWithSpacing()) );
if (s.workspace() == Source::BACKGROUND) if (s.workspace() == Source::BACKGROUND)
ImGuiToolkit::HelpIcon(" in Background",10, 16); ImGuiToolkit::HelpIcon("Background",10, 16);
else if (s.workspace() == Source::FOREGROUND) else if (s.workspace() == Source::FOREGROUND)
ImGuiToolkit::HelpIcon(" in Foreground",12, 16); ImGuiToolkit::HelpIcon("Foreground",12, 16);
else else
ImGuiToolkit::HelpIcon(" on Stage",11, 16); ImGuiToolkit::HelpIcon("Stage",11, 16);
// locking // locking
ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.f * ImGui::GetFrameHeightWithSpacing()) ); ImGui::SetCursorPos( ImVec2(preview_width + 20, pos.y + 2.f * ImGui::GetFrameHeightWithSpacing()) );
const char *tooltip[2] = {"Unlocked\n(clic to toggle)", "Locked\n(clic to toggle)"}; const char *tooltip[2] = {"Unlocked", "Locked"};
bool l = s.locked(); bool l = s.locked();
if (ImGuiToolkit::IconToggle(15,6,17,6, &l, tooltip ) ) if (ImGuiToolkit::IconToggle(15,6,17,6, &l, tooltip ) )
s.setLocked(l); s.setLocked(l);

View File

@@ -2254,8 +2254,8 @@ void Navigator::RenderSourcePannel(Source *s)
ImGui::Text("Source"); ImGui::Text("Source");
ImGui::PopFont(); ImGui::PopFont();
ImGui::SetCursorPos(ImVec2(pannel_width_ - 40.f, 15.f)); ImGui::SetCursorPos(ImVec2(pannel_width_ - 35.f, 15.f));
const char *tooltip[2] = {"Panel unpined:\nDouble-clic on a source to open the source panel.", "Panel pined:\nSingle-clic on a source to open the source panel."}; const char *tooltip[2] = {"Pin pannel\nCurrent: double-clic on source", "Un-pin Pannel\nCurrent: single-clic on source"};
ImGuiToolkit::IconToggle(5,2,4,2, &Settings::application.pannel_stick, tooltip ); ImGuiToolkit::IconToggle(5,2,4,2, &Settings::application.pannel_stick, tooltip );
static char buf5[128]; static char buf5[128];
@@ -2533,7 +2533,7 @@ void Navigator::RenderNewPannel()
// Indication // Indication
ImGui::SameLine(); ImGui::SameLine();
ImGuiToolkit::HelpMarker("Create a source getting images from connected devices or machines;\n- webcams or frame grabbers\n- screen capture\n- vimix shared stream"); ImGuiToolkit::HelpMarker("Create a source getting images from connected devices or machines;\n- webcams or frame grabbers\n- screen capture\n- vimix stream from connected machines");
} }
@@ -2602,7 +2602,7 @@ void Navigator::RenderTransitionPannel()
if ( ImGui::Button( ICON_FA_DOOR_OPEN " Exit", ImVec2(IMGUI_RIGHT_ALIGN, 0)) ) if ( ImGui::Button( ICON_FA_DOOR_OPEN " Exit", ImVec2(IMGUI_RIGHT_ALIGN, 0)) )
Mixer::manager().setView(View::MIXING); Mixer::manager().setView(View::MIXING);
ImGui::SameLine(); ImGui::SameLine();
ImGuiToolkit::HelpMarker("Exit transition leaves the output 'as is', with the newly openned session as a source if the transition is not finished."); ImGuiToolkit::HelpMarker("Exit transition leaves the output 'as is',\nwith the newly openned session as a source\nif the transition is not finished.");
} }
ImGui::End(); ImGui::End();
@@ -2624,7 +2624,7 @@ void Navigator::RenderMainPannel()
// Icon to switch fullscreen // Icon to switch fullscreen
ImGui::SetCursorPos(ImVec2(pannel_width_ - 40.f, 13.f)); ImGui::SetCursorPos(ImVec2(pannel_width_ - 40.f, 13.f));
const char *tooltip[2] = {"Enter Fullscreen " CTRL_MOD "Shift+F", "Exit Fullscreen " CTRL_MOD "Shift+F)"}; const char *tooltip[2] = {"Enter Fullscreen (" CTRL_MOD "Shift+F)", "Exit Fullscreen (" CTRL_MOD "Shift+F)"};
bool fs = Rendering::manager().mainWindow().isFullscreen(); bool fs = Rendering::manager().mainWindow().isFullscreen();
if ( ImGuiToolkit::IconToggle(4,15,3,15, &fs, tooltip ) ) { if ( ImGuiToolkit::IconToggle(4,15,3,15, &fs, tooltip ) ) {
Rendering::manager().mainWindow().toggleFullscreen(); Rendering::manager().mainWindow().toggleFullscreen();
@@ -2794,7 +2794,7 @@ void Navigator::RenderMainPannel()
pos = ImGui::GetCursorPos(); pos = ImGui::GetCursorPos();
ImGui::SameLine(); ImGui::SameLine();
ImGuiToolkit::HelpMarker("Quick access to Session files;\nSelect the history of recently opened files or a folder, and double-clic a filename to open."); ImGuiToolkit::HelpMarker("Quick access to Session files;\nSelect the history of recently\nopened files or a folder, and\ndouble-clic a filename to open.");
ImGui::SetCursorPos(pos); ImGui::SetCursorPos(pos);
// done the selection ! // done the selection !