Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/imgui
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2020-04-01 12:51:44 +0300
committerYuSanka <yusanka@gmail.com>2020-04-01 16:28:07 +0300
commit67c55c74901f1d337ef08f2090a87cfb4263bb0f (patch)
tree1eefd53e09f40831c0fe54dae26257ee0b7e8643 /src/imgui
parent042880ba2df913916b2cc77f7bb677e07bfd2c58 (diff)
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
Diffstat (limited to 'src/imgui')
-rw-r--r--src/imgui/imconfig.h3
-rw-r--r--src/imgui/imgui_draw.cpp9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/imgui/imconfig.h b/src/imgui/imconfig.h
index 26dccd5c3..c425bbef2 100644
--- a/src/imgui/imconfig.h
+++ b/src/imgui/imconfig.h
@@ -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
diff --git a/src/imgui/imgui_draw.cpp b/src/imgui/imgui_draw.cpp
index bee1fdfa7..4e6f1374b 100644
--- a/src/imgui/imgui_draw.cpp
+++ b/src/imgui/imgui_draw.cpp
@@ -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) {