@ -366,7 +366,8 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
return ;
return ;
// Render
// Render
RenderBullet ( bb . Min + ImVec2 ( style . FramePadding . x + g . FontSize * 0.5f , line_height * 0.5f ) ) ;
ImU32 text_col = GetColorU32 ( ImGuiCol_Text ) ;
RenderBullet ( window - > DrawList , bb . Min + ImVec2 ( style . FramePadding . x + g . FontSize * 0.5f , line_height * 0.5f ) , text_col ) ;
RenderText ( bb . Min + ImVec2 ( g . FontSize + style . FramePadding . x * 2 , text_base_offset_y ) , text_begin , text_end , false ) ;
RenderText ( bb . Min + ImVec2 ( g . FontSize + style . FramePadding . x * 2 , text_base_offset_y ) , text_begin , text_end , false ) ;
}
}
@ -703,10 +704,11 @@ bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiBu
bool pressed = ButtonBehavior ( bb , id , & hovered , & held , flags ) ;
bool pressed = ButtonBehavior ( bb , id , & hovered , & held , flags ) ;
// Render
// Render
const ImU32 col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ;
const ImU32 bg_col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ;
const ImU32 text_col = GetColorU32 ( ImGuiCol_Text ) ;
RenderNavHighlight ( bb , id ) ;
RenderNavHighlight ( bb , id ) ;
RenderFrame ( bb . Min , bb . Max , col, true , g . Style . FrameRounding ) ;
RenderFrame ( bb . Min , bb . Max , bg_ col, true , g . Style . FrameRounding ) ;
RenderArrow ( bb. Min + ImVec2 ( ImMax ( 0.0f , ( size . x - g . FontSize ) * 0.5f ) , ImMax ( 0.0f , ( size . y - g . FontSize ) * 0.5f ) ) , dir ) ;
RenderArrow ( window- > DrawList , bb. Min + ImVec2 ( ImMax ( 0.0f , ( size . x - g . FontSize ) * 0.5f ) , ImMax ( 0.0f , ( size . y - g . FontSize ) * 0.5f ) ) , text_col , dir ) ;
return pressed ;
return pressed ;
}
}
@ -759,11 +761,12 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
bool pressed = ButtonBehavior ( bb , id , & hovered , & held , ImGuiButtonFlags_None ) ;
bool pressed = ButtonBehavior ( bb , id , & hovered , & held , ImGuiButtonFlags_None ) ;
// Render
// Render
ImU32 col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ;
ImU32 bg_col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ;
ImU32 text_col = GetColorU32 ( ImGuiCol_Text ) ;
ImVec2 center = bb . GetCenter ( ) ;
ImVec2 center = bb . GetCenter ( ) ;
if ( hovered | | held )
if ( hovered | | held )
window - > DrawList - > AddCircleFilled ( center /* + ImVec2(0.0f, -0.5f)*/, g . FontSize * 0.5f + 1.0f , col, 12 ) ;
window - > DrawList - > AddCircleFilled ( center /* + ImVec2(0.0f, -0.5f)*/, g . FontSize * 0.5f + 1.0f , bg_ col, 12 ) ;
RenderArrow ( bb. Min + g . Style . FramePadding , window - > Collapsed ? ImGuiDir_Right : ImGuiDir_Down , 1.0f ) ;
RenderArrow ( window- > DrawList , bb. Min + g . Style . FramePadding , text_col , window - > Collapsed ? ImGuiDir_Right : ImGuiDir_Down , 1.0f ) ;
// Switch to moving the window after mouse is moved beyond the initial drag threshold
// Switch to moving the window after mouse is moved beyond the initial drag threshold
if ( IsItemActive ( ) & & IsMouseDragging ( ) )
if ( IsItemActive ( ) & & IsMouseDragging ( ) )
@ -1143,8 +1146,9 @@ void ImGui::Bullet()
}
}
// Render and stay on same line
// Render and stay on same line
RenderBullet ( bb . Min + ImVec2 ( style . FramePadding . x + g . FontSize * 0.5f , line_height * 0.5f ) ) ;
ImU32 text_col = GetColorU32 ( ImGuiCol_Text ) ;
SameLine ( 0 , style . FramePadding . x * 2 ) ;
RenderBullet ( window - > DrawList , bb . Min + ImVec2 ( style . FramePadding . x + g . FontSize * 0.5f , line_height * 0.5f ) , text_col ) ;
SameLine ( 0 , style . FramePadding . x * 2.0f ) ;
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
@ -1419,8 +1423,10 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
window - > DrawList - > AddRectFilled ( frame_bb . Min , ImVec2 ( value_x2 , frame_bb . Max . y ) , frame_col , style . FrameRounding , ( flags & ImGuiComboFlags_NoArrowButton ) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Left ) ;
window - > DrawList - > AddRectFilled ( frame_bb . Min , ImVec2 ( value_x2 , frame_bb . Max . y ) , frame_col , style . FrameRounding , ( flags & ImGuiComboFlags_NoArrowButton ) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Left ) ;
if ( ! ( flags & ImGuiComboFlags_NoArrowButton ) )
if ( ! ( flags & ImGuiComboFlags_NoArrowButton ) )
{
{
window - > DrawList - > AddRectFilled ( ImVec2 ( value_x2 , frame_bb . Min . y ) , frame_bb . Max , GetColorU32 ( ( popup_open | | hovered ) ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) , style . FrameRounding , ( w < = arrow_size ) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Right ) ;
ImU32 bg_col = GetColorU32 ( ( popup_open | | hovered ) ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ;
RenderArrow ( ImVec2 ( value_x2 + style . FramePadding . y , frame_bb . Min . y + style . FramePadding . y ) , ImGuiDir_Down ) ;
ImU32 text_col = GetColorU32 ( ImGuiCol_Text ) ;
window - > DrawList - > AddRectFilled ( ImVec2 ( value_x2 , frame_bb . Min . y ) , frame_bb . Max , bg_col , style . FrameRounding , ( w < = arrow_size ) ? ImDrawCornerFlags_All : ImDrawCornerFlags_Right ) ;
RenderArrow ( window - > DrawList , ImVec2 ( value_x2 + style . FramePadding . y , frame_bb . Min . y + style . FramePadding . y ) , text_col , ImGuiDir_Down ) ;
}
}
RenderFrameBorder ( frame_bb . Min , frame_bb . Max , style . FrameRounding ) ;
RenderFrameBorder ( frame_bb . Min , frame_bb . Max , style . FrameRounding ) ;
if ( preview_value ! = NULL & & ! ( flags & ImGuiComboFlags_NoPreview ) )
if ( preview_value ! = NULL & & ! ( flags & ImGuiComboFlags_NoPreview ) )
@ -5225,15 +5231,16 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
window - > DC . LastItemStatusFlags | = ImGuiItemStatusFlags_ToggledSelection ;
window - > DC . LastItemStatusFlags | = ImGuiItemStatusFlags_ToggledSelection ;
// Render
// Render
const ImU32 col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header ) ;
const ImU32 bg_col = GetColorU32 ( ( held & & hovered ) ? ImGuiCol_HeaderActive : hovered ? ImGuiCol_HeaderHovered : ImGuiCol_Header ) ;
const ImU32 text_col = GetColorU32 ( ImGuiCol_Text ) ;
const ImVec2 text_pos = frame_bb . Min + ImVec2 ( text_offset_x , text_base_offset_y ) ;
const ImVec2 text_pos = frame_bb . Min + ImVec2 ( text_offset_x , text_base_offset_y ) ;
ImGuiNavHighlightFlags nav_highlight_flags = ImGuiNavHighlightFlags_TypeThin ;
ImGuiNavHighlightFlags nav_highlight_flags = ImGuiNavHighlightFlags_TypeThin ;
if ( display_frame )
if ( display_frame )
{
{
// Framed type
// Framed type
RenderFrame ( frame_bb . Min , frame_bb . Max , col, true , style . FrameRounding ) ;
RenderFrame ( frame_bb . Min , frame_bb . Max , bg_ col, true , style . FrameRounding ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
RenderArrow ( frame_bb. Min + ImVec2 ( padding . x , text_base_offset_y ) , is_open ? ImGuiDir_Down : ImGuiDir_Right , 1.0f ) ;
RenderArrow ( window- > DrawList , frame_bb. Min + ImVec2 ( padding . x , text_base_offset_y ) , text_col , is_open ? ImGuiDir_Down : ImGuiDir_Right , 1.0f ) ;
if ( flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton )
if ( flags & ImGuiTreeNodeFlags_ClipLabelForTrailingButton )
frame_bb . Max . x - = g . FontSize + style . FramePadding . x ;
frame_bb . Max . x - = g . FontSize + style . FramePadding . x ;
if ( g . LogEnabled )
if ( g . LogEnabled )
@ -5255,14 +5262,14 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
// Unframed typed for tree nodes
// Unframed typed for tree nodes
if ( hovered | | selected )
if ( hovered | | selected )
{
{
RenderFrame ( frame_bb . Min , frame_bb . Max , col, false ) ;
RenderFrame ( frame_bb . Min , frame_bb . Max , bg_ col, false ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
RenderNavHighlight ( frame_bb , id , nav_highlight_flags ) ;
}
}
if ( flags & ImGuiTreeNodeFlags_Bullet )
if ( flags & ImGuiTreeNodeFlags_Bullet )
RenderBullet ( frame_bb. Min + ImVec2 ( text_offset_x * 0.5f , g . FontSize * 0.50f + text_base_offset_y ) ) ;
RenderBullet ( window- > DrawList , frame_bb. Min + ImVec2 ( text_offset_x * 0.5f , g . FontSize * 0.50f + text_base_offset_y ) , text_col ) ;
else if ( ! is_leaf )
else if ( ! is_leaf )
RenderArrow ( frame_bb. Min + ImVec2 ( padding . x , g . FontSize * 0.15f + text_base_offset_y ) , is_open ? ImGuiDir_Down : ImGuiDir_Right , 0.70f ) ;
RenderArrow ( window- > DrawList , frame_bb. Min + ImVec2 ( padding . x , g . FontSize * 0.15f + text_base_offset_y ) , text_col , is_open ? ImGuiDir_Down : ImGuiDir_Right , 0.70f ) ;
if ( g . LogEnabled )
if ( g . LogEnabled )
LogRenderedText ( & text_pos , " > " ) ;
LogRenderedText ( & text_pos , " > " ) ;
RenderText ( text_pos , label , label_end , false ) ;
RenderText ( text_pos , label , label_end , false ) ;
@ -6036,9 +6043,8 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
float w = window - > MenuColumns . DeclColumns ( label_size . x , 0.0f , ( float ) ( int ) ( g . FontSize * 1.20f ) ) ; // Feedback to next frame
float w = window - > MenuColumns . DeclColumns ( label_size . x , 0.0f , ( float ) ( int ) ( g . FontSize * 1.20f ) ) ; // Feedback to next frame
float extra_w = ImMax ( 0.0f , GetContentRegionAvail ( ) . x - w ) ;
float extra_w = ImMax ( 0.0f , GetContentRegionAvail ( ) . x - w ) ;
pressed = Selectable ( label , menu_is_open , ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_PressedOnClick | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | ( ! enabled ? ImGuiSelectableFlags_Disabled : 0 ) , ImVec2 ( w , 0.0f ) ) ;
pressed = Selectable ( label , menu_is_open , ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_PressedOnClick | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | ( ! enabled ? ImGuiSelectableFlags_Disabled : 0 ) , ImVec2 ( w , 0.0f ) ) ;
if ( ! enabled ) PushStyleColor ( ImGuiCol_Text , g . Style . Colors [ ImGuiCol_TextDisabled ] ) ;
ImU32 text_col = GetColorU32 ( enabled ? ImGuiCol_Text : ImGuiCol_TextDisabled ) ;
RenderArrow ( pos + ImVec2 ( window - > MenuColumns . Pos [ 2 ] + extra_w + g . FontSize * 0.30f , 0.0f ) , ImGuiDir_Right ) ;
RenderArrow ( window - > DrawList , pos + ImVec2 ( window - > MenuColumns . Pos [ 2 ] + extra_w + g . FontSize * 0.30f , 0.0f ) , text_col , ImGuiDir_Right ) ;
if ( ! enabled ) PopStyleColor ( ) ;
}
}
const bool hovered = enabled & & ItemHoverable ( window - > DC . LastItemRect , id ) ;
const bool hovered = enabled & & ItemHoverable ( window - > DC . LastItemRect , id ) ;
@ -7094,7 +7100,7 @@ bool ImGui::TabItemLabelAndCloseButton(ImDrawList* draw_list, const ImRect& bb,
const float ellipsis_x = text_pixel_clip_bb . Min . x + label_size_clipped_x + 1.0f ;
const float ellipsis_x = text_pixel_clip_bb . Min . x + label_size_clipped_x + 1.0f ;
if ( ! close_button_visible & & ellipsis_x + ellipsis_width < = bb . Max . x )
if ( ! close_button_visible & & ellipsis_x + ellipsis_width < = bb . Max . x )
RenderPixelEllipsis ( draw_list , ImVec2 ( ellipsis_x , text_pixel_clip_bb . Min . y ) , ellipsis_dot_count, GetColorU32( ImGuiCol_Text ) ) ;
RenderPixelEllipsis ( draw_list , ImVec2 ( ellipsis_x , text_pixel_clip_bb . Min . y ) , GetColorU32( ImGuiCol_Text ) , ellipsis_dot_count ) ;
}
}
else
else
{
{