mirror of
				https://github.com/ocornut/imgui.git
				synced 2025-11-04 01:34:32 +00:00 
			
		
		
		
	Drag and Drop: BeginDragDropSource(): Offset tooltip position so it is off the mouse cursor, but also closer to it than regular tooltips, and not clamped by viewport. (#1739)
This commit is contained in:
		@@ -46,6 +46,8 @@ Other Changes:
 | 
			
		||||
 - Nav: To keep the navigated item in view we also attempt to scroll the parent window as well as the current window. (#787)
 | 
			
		||||
 - TreeNode: Fixed nodes with ImGuiTreeNodeFlags_Leaf flag always returning true which was meaningless.
 | 
			
		||||
 - ColorEdit3, ColorEdit4, ColorButton: Added ImGuiColorEditFlags_NoDragDrop flag to disable ColorEditX as drag target and ColorButton as drag source. (#1826) 
 | 
			
		||||
 - BeginDragDropSource(): Offset tooltip position so it is off the mouse cursor, but also closer to it than regular tooltips, and not clamped by viewport. (#1739)
 | 
			
		||||
 - BeginCombo(), BeginMainMenuBar(), BeginChildFrame(): Temporary style modification are restored at the end of BeginXXX instead of EndXXX, to not affect tooltips and child windows.
 | 
			
		||||
 - Examples: GLFW: Made it possible to Shutdown/Init the backend again (by reseting the time storage properly). (#1827) [@ice1000]
 | 
			
		||||
 | 
			
		||||
-----------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
@@ -13203,7 +13203,11 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
 | 
			
		||||
            // FIXME-DRAG
 | 
			
		||||
            //SetNextWindowPos(g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding);
 | 
			
		||||
            //PushStyleVar(ImGuiStyleVar_Alpha, g.Style.Alpha * 0.60f); // This is better but e.g ColorButton with checkboard has issue with transparent colors :(
 | 
			
		||||
            SetNextWindowPos(g.IO.MousePos);
 | 
			
		||||
 | 
			
		||||
            // The default tooltip position is a little offset to give space to see the context menu (it's also clamped within the current viewport/monitor)
 | 
			
		||||
            // In the context of a dragging tooltip we try to reduce that offset and we enforce following the cursor.
 | 
			
		||||
            ImVec2 tooltip_pos = g.IO.MousePos + ImVec2(16 * g.Style.MouseCursorScale, 8 * g.Style.MouseCursorScale);
 | 
			
		||||
            SetNextWindowPos(tooltip_pos);
 | 
			
		||||
            PushStyleColor(ImGuiCol_PopupBg, GetStyleColorVec4(ImGuiCol_PopupBg) * ImVec4(1.0f, 1.0f, 1.0f, 0.6f));
 | 
			
		||||
            BeginTooltip();
 | 
			
		||||
        }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user