@ -3897,18 +3897,22 @@ void ImGui::RenderBullet(ImVec2 pos)
window - > DrawList - > AddCircleFilled ( pos , GImGui - > FontSize * 0.20f , GetColorU32 ( ImGuiCol_Text ) , 8 ) ;
}
void ImGui : : RenderCheckMark ( ImVec2 pos , ImU32 col )
void ImGui : : RenderCheckMark ( ImVec2 pos , ImU32 col , float sz )
{
ImGuiContext & g = * GImGui ;
ImGuiWindow * window = g . CurrentWindow ;
float start_x = ( float ) ( int ) ( g . FontSize * 0.307f + 0.5f ) ;
float rem_third = ( float ) ( int ) ( ( g . FontSize - start_x ) / 3.0f ) ;
float bx = pos . x + 0.5f + start_x + rem_third ;
float by = pos . y - 1.0f + ( float ) ( int ) ( g . Font - > Ascent * ( g . FontSize / g . Font - > FontSize ) + 0.5f ) + ( float ) ( int ) ( g . Font - > DisplayOffset . y ) ;
window - > DrawList - > PathLineTo ( ImVec2 ( bx - rem_third , by - rem_third ) ) ;
float thickness = ImMax ( sz / 5.0f , 1.0f ) ;
sz - = thickness * 0.5f ;
pos + = ImVec2 ( thickness * 0.25f , thickness * 0.25f ) ;
float third = sz / 3.0f ;
float bx = pos . x + third ;
float by = pos . y + sz - third * 0.5f ;
window - > DrawList - > PathLineTo ( ImVec2 ( bx - third , by - third ) ) ;
window - > DrawList - > PathLineTo ( ImVec2 ( bx , by ) ) ;
window - > DrawList - > PathLineTo ( ImVec2 ( bx + rem_third * 2 , by - rem_third * 2 ) ) ;
window - > DrawList - > PathStroke ( col , false ) ;
window - > DrawList - > PathLineTo ( ImVec2 ( bx + third* 2 , by - third* 2 ) ) ;
window - > DrawList - > PathStroke ( col , false , thickness );
}
void ImGui : : RenderNavHighlight ( const ImRect & bb , ImGuiID id , ImGuiNavHighlightFlags flags )
@ -6786,8 +6790,12 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
if ( ( ( flags & ImGuiButtonFlags_PressedOnClick ) & & g . IO . MouseClicked [ 0 ] ) | | ( ( flags & ImGuiButtonFlags_PressedOnDoubleClick ) & & g . IO . MouseDoubleClicked [ 0 ] ) )
{
pressed = true ;
ClearActiveID ( ) ;
if ( flags & ImGuiButtonFlags_NoHoldingActiveID )
ClearActiveID ( ) ;
else
SetActiveID ( id , window ) ; // Hold on ID
FocusWindow ( window ) ;
g . ActiveIdClickOffset = g . IO . MousePos - bb . Min ;
}
if ( ( flags & ImGuiButtonFlags_PressedOnRelease ) & & g . IO . MouseReleased [ 0 ] )
{
@ -8630,7 +8638,7 @@ bool ImGui::Checkbox(const char* label, bool* v)
{
const float check_sz = ImMin ( check_bb . GetWidth ( ) , check_bb . GetHeight ( ) ) ;
const float pad = ImMax ( 1.0f , ( float ) ( int ) ( check_sz / 6.0f ) ) ;
window- > DrawList - > AddRectFilled ( check_bb . Min + ImVec2 ( pad , pad ) , check_bb . Max - ImVec2 ( pad , pad ) , GetColorU32 ( ImGuiCol_CheckMark ) , style. FrameRounding ) ;
RenderCheckMark( check_bb . Min + ImVec2 ( pad , pad ) , GetColorU32 ( ImGuiCol_CheckMark ) , check_bb. GetWidth ( ) - pad * 2.0f ) ;
}
if ( g . LogEnabled )
@ -9967,7 +9975,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
}
ImGuiButtonFlags button_flags = 0 ;
if ( flags & ImGuiSelectableFlags_Menu ) button_flags | = ImGuiButtonFlags_PressedOnClick ;
if ( flags & ImGuiSelectableFlags_Menu ) button_flags | = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_NoHoldingActiveID ;
if ( flags & ImGuiSelectableFlags_MenuItem ) button_flags | = ImGuiButtonFlags_PressedOnRelease ;
if ( flags & ImGuiSelectableFlags_Disabled ) button_flags | = ImGuiButtonFlags_Disabled ;
if ( flags & ImGuiSelectableFlags_AllowDoubleClick ) button_flags | = ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick ;
@ -10135,7 +10143,7 @@ bool ImGui::MenuItem(const char* label, const char* shortcut, bool selected, boo
}
if ( selected )
RenderCheckMark ( pos + ImVec2 ( window - > MenuColumns . Pos [ 2 ] + extra_w + g . FontSize * 0.20f , 0. 0f) , GetColorU32 ( enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled ) ) ;
RenderCheckMark ( pos + ImVec2 ( window - > MenuColumns . Pos [ 2 ] + extra_w + g . FontSize * ( 0.20f + 0.200f ) , g . FontSize * 0. 134f * 0.5 f) , GetColorU32 ( enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled ) , g . FontSize * 0.866f ) ;
return pressed ;
}