@ -4277,7 +4277,7 @@ void ImGui::RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding)
}
// Render a triangle to denote expanded/collapsed state
void ImGui : : Render Triangle ( ImVec2 p_min , ImGuiDir dir , float scale )
void ImGui : : Render Arrow ( ImVec2 p_min , ImGuiDir dir , float scale )
{
ImGuiContext & g = * GImGui ;
ImGuiWindow * window = g . CurrentWindow ;
@ -6079,7 +6079,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
if ( ButtonBehavior ( bb , id , NULL , NULL ) )
window - > CollapseToggleWanted = true ; // Defer collapsing to next frame as we are too far in the Begin() function
RenderNavHighlight ( bb , id ) ;
Render Triangle ( window - > Pos + style . FramePadding , window - > Collapsed ? ImGuiDir_Right : ImGuiDir_Down , 1.0f ) ;
Render Arrow ( window - > Pos + style . FramePadding , window - > Collapsed ? ImGuiDir_Right : ImGuiDir_Down , 1.0f ) ;
}
// Close button
@ -7736,7 +7736,7 @@ bool ImGui::ArrowButton(ImGuiID id, ImGuiDir dir, ImVec2 padding, ImGuiButtonFla
const ImU32 col = GetColorU32 ( ( hovered & & held ) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) ;
RenderNavHighlight ( bb , id ) ;
RenderFrame ( bb . Min , bb . Max , col , true , style . FrameRounding ) ;
Render Triangle ( bb . Min + padding , dir , 1.0f ) ;
Render Arrow ( bb . Min + padding , dir , 1.0f ) ;
return pressed ;
}
@ -8066,7 +8066,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
// Framed type
RenderFrame ( frame_bb . Min , frame_bb . Max , col , true , style . FrameRounding ) ;
RenderNavHighlight ( frame_bb , id , ImGuiNavHighlightFlags_TypeThin ) ;
Render Triangle ( frame_bb . Min + ImVec2 ( padding . x , text_base_offset_y ) , is_open ? ImGuiDir_Down : ImGuiDir_Right , 1.0f ) ;
Render Arrow ( frame_bb . Min + ImVec2 ( padding . x , text_base_offset_y ) , is_open ? ImGuiDir_Down : ImGuiDir_Right , 1.0f ) ;
if ( g . LogEnabled )
{
// NB: '##' is normally used to hide text (as a library-wide feature), so we need to specify the text range to make sure the ## aren't stripped out here.
@ -8093,7 +8093,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
if ( flags & ImGuiTreeNodeFlags_Bullet )
RenderBullet ( frame_bb . Min + ImVec2 ( text_offset_x * 0.5f , g . FontSize * 0.50f + text_base_offset_y ) ) ;
else if ( ! ( flags & ImGuiTreeNodeFlags_Leaf ) )
Render Triangle ( frame_bb . Min + ImVec2 ( padding . x , g . FontSize * 0.15f + text_base_offset_y ) , is_open ? ImGuiDir_Down : ImGuiDir_Right , 0.70f ) ;
Render Arrow ( frame_bb . Min + ImVec2 ( padding . x , g . FontSize * 0.15f + text_base_offset_y ) , is_open ? ImGuiDir_Down : ImGuiDir_Right , 0.70f ) ;
if ( g . LogEnabled )
LogRenderedText ( & text_pos , " > " ) ;
RenderText ( text_pos , label , label_end , false ) ;
@ -10598,7 +10598,7 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
RenderNavHighlight ( frame_bb , id ) ;
RenderFrame ( frame_bb . Min , frame_bb . Max , GetColorU32 ( ImGuiCol_FrameBg ) , true , style . FrameRounding ) ;
RenderFrame ( ImVec2 ( frame_bb . Max . x - arrow_size , frame_bb . Min . y ) , frame_bb . Max , GetColorU32 ( popup_open | | hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button ) , true , style . FrameRounding ) ; // FIXME-ROUNDING
Render Triangle ( ImVec2 ( frame_bb . Max . x - arrow_size + style . FramePadding . y , frame_bb . Min . y + style . FramePadding . y ) , ImGuiDir_Down ) ;
Render Arrow ( ImVec2 ( frame_bb . Max . x - arrow_size + style . FramePadding . y , frame_bb . Min . y + style . FramePadding . y ) , ImGuiDir_Down ) ;
if ( preview_value ! = NULL )
RenderTextClipped ( frame_bb . Min + style . FramePadding , value_bb . Max , preview_value , NULL , NULL , ImVec2 ( 0.0f , 0.0f ) ) ;
if ( label_size . x > 0 )
@ -11150,7 +11150,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
float extra_w = ImMax ( 0.0f , GetContentRegionAvail ( ) . x - w ) ;
pressed = Selectable ( label , menu_is_open , ImGuiSelectableFlags_Menu | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_DrawFillAvailWidth | ( ! enabled ? ImGuiSelectableFlags_Disabled : 0 ) , ImVec2 ( w , 0.0f ) ) ;
if ( ! enabled ) PushStyleColor ( ImGuiCol_Text , g . Style . Colors [ ImGuiCol_TextDisabled ] ) ;
Render Triangle ( pos + ImVec2 ( window - > MenuColumns . Pos [ 2 ] + extra_w + g . FontSize * 0.30f , 0.0f ) , ImGuiDir_Right ) ;
Render Arrow ( pos + ImVec2 ( window - > MenuColumns . Pos [ 2 ] + extra_w + g . FontSize * 0.30f , 0.0f ) , ImGuiDir_Right ) ;
if ( ! enabled ) PopStyleColor ( ) ;
}