@ -1,4 +1,4 @@
// dear imgui, v1.5 3
// dear imgui, v1.5 4 WIP
// (main code and documentation)
// ** EXPERIMENTAL GAMEPAD/KEYBOARD NAVIGATION BRANCH
@ -3721,7 +3721,7 @@ void ImGui::EndFrame()
IM_ASSERT ( g . CurrentWindowStack . Size = = 1 ) ; // Mismatched Begin()/End() calls
if ( g . CurrentWindow & & ! g . CurrentWindow - > WriteAccessed )
g . CurrentWindow - > Active = false ;
ImGui: : End( ) ;
End( ) ;
if ( g . ActiveId = = 0 & & g . HoveredId = = 0 )
{
@ -4579,7 +4579,7 @@ void ImGui::BeginTooltip()
void ImGui : : EndTooltip ( )
{
IM_ASSERT ( GetCurrentWindowRead ( ) - > Flags & ImGuiWindowFlags_Tooltip ) ; // Mismatched BeginTooltip()/EndTooltip() calls
ImGui: : End( ) ;
End( ) ;
}
// Mark popup as open (toggle toward open state).
@ -4751,7 +4751,7 @@ bool ImGui::BeginPopupModal(const char* name, bool* p_open, ImGuiWindowFlags ext
}
// Center modal windows by default
if ( ( window - > SetWindowPosAllowFlags & g . SetNextWindowPosCond ) = = 0 )
if ( g . SetNextWindowPosCond = = 0 )
SetNextWindowPos ( g . IO . DisplaySize * 0.5f , ImGuiCond_Appearing , ImVec2 ( 0.5f , 0.5f ) ) ;
ImGuiWindowFlags flags = extra_flags | ImGuiWindowFlags_Popup | ImGuiWindowFlags_Modal | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings ;
@ -4903,7 +4903,7 @@ void ImGui::EndChild()
IM_ASSERT ( window - > Flags & ImGuiWindowFlags_ChildWindow ) ; // Mismatched BeginChild()/EndChild() callss
if ( window - > BeginCount > 1 )
{
ImGui: : End( ) ;
End( ) ;
}
else
{
@ -4913,7 +4913,7 @@ void ImGui::EndChild()
sz . x = ImMax ( 4.0f , sz . x ) ;
if ( window - > AutoFitChildAxises & ( 1 < < ImGuiAxis_Y ) )
sz . y = ImMax ( 4.0f , sz . y ) ;
ImGui: : End( ) ;
End( ) ;
ImGuiWindow * parent_window = GetCurrentWindow ( ) ;
ImRect bb ( parent_window - > DC . CursorPos , parent_window - > DC . CursorPos + sz ) ;
@ -7743,7 +7743,8 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
// - OpenOnArrow .................... single-click on arrow to open
// - OpenOnDoubleClick|OpenOnArrow .. single-click on arrow or double-click anywhere to open
ImGuiButtonFlags button_flags = ImGuiButtonFlags_NoKeyModifiers | ( ( flags & ImGuiTreeNodeFlags_AllowItemOverlap ) ? ImGuiButtonFlags_AllowItemOverlap : 0 ) ;
button_flags | = ImGuiButtonFlags_PressedOnDragDropHold ;
if ( ! ( flags & ImGuiTreeNodeFlags_Leaf ) )
button_flags | = ImGuiButtonFlags_PressedOnDragDropHold ;
if ( flags & ImGuiTreeNodeFlags_OpenOnDoubleClick )
button_flags | = ImGuiButtonFlags_PressedOnDoubleClick | ( ( flags & ImGuiTreeNodeFlags_OpenOnArrow ) ? ImGuiButtonFlags_PressedOnClickRelease : 0 ) ;
@ -10337,14 +10338,15 @@ bool ImGui::BeginCombo(const char* label, const char* preview_value, ImGuiComboF
// Peak into expected window size so we can position it
if ( ImGuiWindow * popup_window = FindWindowByName ( name ) )
{
ImVec2 size_contents = CalcSizeContents ( popup_window ) ;
ImVec2 size_expected = CalcSizeAfterConstraint ( popup_window , CalcSizeAutoFit ( popup_window , size_contents ) ) ;
if ( flags & ImGuiComboFlags_PopupAlignLeft )
popup_window - > AutoPosLastDirection = ImGuiDir_Left ;
ImVec2 pos = FindBestWindowPosForPopup ( frame_bb . GetBL ( ) , size_expected , & popup_window - > AutoPosLastDirection , frame_bb , ImGuiPopupPositionPolicy_ComboBox ) ;
SetNextWindowPos ( pos ) ;
}
if ( popup_window - > WasActive )
{
ImVec2 size_contents = CalcSizeContents ( popup_window ) ;
ImVec2 size_expected = CalcSizeAfterConstraint ( popup_window , CalcSizeAutoFit ( popup_window , size_contents ) ) ;
if ( flags & ImGuiComboFlags_PopupAlignLeft )
popup_window - > AutoPosLastDirection = ImGuiDir_Left ;
ImVec2 pos = FindBestWindowPosForPopup ( frame_bb . GetBL ( ) , size_expected , & popup_window - > AutoPosLastDirection , frame_bb , ImGuiPopupPositionPolicy_ComboBox ) ;
SetNextWindowPos ( pos ) ;
}
ImGuiWindowFlags window_flags = ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_Popup | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings ;
if ( ! Begin ( name , NULL , window_flags ) )
@ -10755,7 +10757,7 @@ bool ImGui::BeginMenuBar()
// We remove 1 worth of rounding to Max.x to that text in long menus don't tend to display over the lower-right rounded area, which looks particularly glitchy.
ImRect bar_rect = window - > MenuBarRect ( ) ;
ImRect clip_rect ( ImFloor ( bar_rect . Min . x + 0.5f ) , ImFloor ( bar_rect . Min . y + window - > WindowBorderSize + 0.5f ) , ImFloor ( ImMax ( bar_rect . Min . x , bar_rect . Max . x - window - > WindowRounding ) + 0.5f ) , ImFloor ( bar_rect . Max . y + 0.5f ) ) ;
clip_rect . ClipWith ( window - > Rect( ) ) ;
clip_rect . ClipWith ( window - > WindowRectClipped ) ;
PushClipRect ( clip_rect . Min , clip_rect . Max , false ) ;
window - > DC . CursorPos = ImVec2 ( bar_rect . Min . x + window - > DC . MenuBarOffsetX , bar_rect . Min . y ) ; // + g.Style.FramePadding.y);
@ -12653,6 +12655,12 @@ void ImGui::EndDragDropTarget()
IM_ASSERT ( g . DragDropActive ) ;
}
bool ImGui : : IsDragDropActive ( )
{
ImGuiContext & g = * GImGui ;
return g . DragDropActive ;
}
//-----------------------------------------------------------------------------
// PLATFORM DEPENDENT HELPERS
//-----------------------------------------------------------------------------
@ -12905,6 +12913,7 @@ void ImGui::ShowMetricsWindow(bool* p_open)
ImGui : : Text ( " NavUsable: %d, NavActive: %d " , g . IO . NavUsable , g . IO . NavActive ) ;
ImGui : : Text ( " NavActivateId: 0x%08X, NavInputId: 0x%08X " , g . NavActivateId , g . NavInputId ) ;
ImGui : : Text ( " NavDisableHighlight: %d, NavDisableMouseHover: %d " , g . NavDisableHighlight , g . NavDisableMouseHover ) ;
ImGui : : Text ( " DragDrop: %d, SourceId = 0x%08X, Payload \" %s \" (%d bytes) " , g . DragDropActive , g . DragDropPayload . SourceId , g . DragDropPayload . DataType , g . DragDropPayload . DataSize ) ;
ImGui : : TreePop ( ) ;
}
}