Committed our own changes in ImGUI, see commits

042880ba2df913916b2cc77f7bb677e07bfd2c58
67c55c74901f1d337ef08f2090a87cfb4263bb0f
a94c952b40d36b1505fb77b87c0dd739e1034659
b3f8ae5ca75b52ef74e8da2be2392ea8339dcab2
2455df4017e4000347dc77b543c8674bd052b145
3ca3a544a87cc569b69351a77996c287763388a5
870aba8d15ec572460a1e288ed26b4718f4f3d0f
62c2095fe8297688c254ef70d9742f18fffe1b77

This should contain exactly the same changes.
This commit is contained in:
Lukas Matena 2021-07-15 10:24:11 +02:00
parent 63dfb8f5f2
commit 935675a35a
2 changed files with 49 additions and 3 deletions

View File

@ -113,9 +113,34 @@
//#define IMGUI_DEBUG_PARANOID //#define IMGUI_DEBUG_PARANOID
//---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files.
/*
namespace ImGui namespace ImGui
{ {
void MyFunction(const char* name, const MyMatrix44& v); // 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
// Special ASCII characters are used here as an ikons markers
const char PrintIconMarker = 0x4;
const char PrinterIconMarker = 0x5;
const char PrinterSlaIconMarker = 0x6;
const char FilamentIconMarker = 0x7;
const char MaterialIconMarker = 0x8;
const char CloseNotifButton = 0xB;
const char CloseNotifHoverButton = 0xC;
// const char TimerDotMarker = 0xE;
// const char TimerDotEmptyMarker = 0xF;
const char MinimalizeButton = 0xE;
const char MinimalizeHoverButton = 0xF;
const char WarningMarker = 0x10;
const char ErrorMarker = 0x11;
const char EjectButton = 0x12;
const char EjectHoverButton = 0x13;
const char CancelButton = 0x14;
const char CancelHoverButton = 0x15;
// void MyFunction(const char* name, const MyMatrix44& v);
} }
*/

View File

@ -34,6 +34,8 @@ Index of this file:
#endif #endif
#include "imgui_internal.h" #include "imgui_internal.h"
#include "imconfig.h"
#ifdef IMGUI_ENABLE_FREETYPE #ifdef IMGUI_ENABLE_FREETYPE
#include "misc/freetype/imgui_freetype.h" #include "misc/freetype/imgui_freetype.h"
#endif #endif
@ -3564,6 +3566,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
const ImU32 col_untinted = col | ~IM_COL32_A_MASK; const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
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) while (s < text_end)
{ {
if (word_wrap_enabled) if (word_wrap_enabled)
@ -3592,6 +3602,17 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
} }
} }
if (*s == ImGui::ColorMarkerStart) {
col = highlighCol;
s += 1;
}
else if (*s == ImGui::ColorMarkerEnd) {
col = defaultCol;
s += 1;
if (s == text_end)
break;
}
// Decode and advance source // Decode and advance source
unsigned int c = (unsigned int)*s; unsigned int c = (unsigned int)*s;
if (c < 0x80) if (c < 0x80)