Added code for deactivating of search toolbar item

+ invalidated its unused callbacks.

 + ImGui::Selectable function is copied to InGuiWrapper.cpp and a little beat modified to change a label text, when item is hovered
This commit is contained in:
YuSanka 2020-04-01 11:51:44 +02:00
parent 042880ba2d
commit 67c55c7490
5 changed files with 173 additions and 12 deletions

View file

@ -100,6 +100,9 @@
namespace ImGui
{
// Special ASCII character is used here as markup symbols for tokens to be highlighted as a for hovered item
const char ColorMarkerHovered = 0x1; // STX
// Special ASCII characters STX and ETX are used here as markup symbols for tokens to be highlighted.
const char ColorMarkerStart = 0x2; // STX
const char ColorMarkerEnd = 0x3; // ETX

View file

@ -2993,6 +2993,13 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
ImU32 defaultCol = col;
ImU32 highlighCol = ImGui::GetColorU32(ImGuiCol_ButtonHovered);
// if text is started with ColorMarkerHovered symbol, we should use another color for a highlighting
if (*s == ImGui::ColorMarkerHovered) {
highlighCol = ImGui::GetColorU32(ImGuiCol_FrameBg);
s += 1;
}
while (s < text_end)
{
@ -3023,7 +3030,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
}
if (*s == ImGui::ColorMarkerStart) {
col = ImGui::GetColorU32(ImGuiCol_ButtonHovered);
col = highlighCol;
s += 1;
}
else if (*s == ImGui::ColorMarkerEnd) {