@ -318,6 +318,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- nav/menus: allow pressing Menu to leave a sub-menu.
- nav/menus: allow pressing Menu to leave a sub-menu.
- nav/menus: a way to access the main menu bar with Alt? (currently needs CTRL+TAB)
- nav/menus: a way to access the main menu bar with Alt? (currently needs CTRL+TAB)
- nav/menus: when using the main menu bar, even though we restore focus after, the underlying window loses its title bar highlight during menu manipulation. could we prevent it?
- nav/menus: when using the main menu bar, even though we restore focus after, the underlying window loses its title bar highlight during menu manipulation. could we prevent it?
- nav/menus: main menu bar currently cannot restore a NULL focus. Could save NavWindow at the time of being focused, similarly to what popup do?
- nav: simulate right-click or context activation? (SHIFT+F10)
- nav: simulate right-click or context activation? (SHIFT+F10)
- nav: tabs should go through most/all widgets (in submission order?).
- nav: tabs should go through most/all widgets (in submission order?).
- nav: when CTRL-Tab/windowing is active, the HoveredWindow detection doesn't take account of the window display re-ordering.
- nav: when CTRL-Tab/windowing is active, the HoveredWindow detection doesn't take account of the window display re-ordering.
// (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.)
// (NB: That term "drawing context / DC" lost its meaning a long time ago. Initially was meant to hold transient data only. Nowadays difference between window-> and window->DC-> is dubious.)
// Pressing CTRL+C while holding on a window copy its content to the clipboard
// Pressing CTRL+C while holding on a window copy its content to the clipboard
// This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope.
// This works but 1. doesn't handle multiple Begin/End pairs, 2. recursing into another Begin/End pair - so we need to work that out and add better logging scope.
// We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user.
// We may later decide to test for different NoXXXInputs based on the active navigation input (mouse vs nav) but that may feel more confusing to the user.
// FIXME: This code is faulty and we may want to eventually to replace or remove the 'apply_focus_to_window_under=true' path completely.
if(restore_focus_to_window_under_popup)
// Instead of using g.OpenPopupStack[remaining-1].Window etc. we should find the highest root window that is behind the popups we are closing.
// The current code will set focus to the parent of the popup window which is incorrect.
// It rarely manifested until now because UpdateMouseMovingWindowNewFrame() would call FocusWindow() again on the clicked window,
// leading to a chain of focusing A (clicked window) then B (parent window of the popup) then A again.
// However if the clicked window has the _NoMove flag set we would be left with B focused.
// For now, we have disabled this path when called from ClosePopupsOverWindow() because the users of ClosePopupsOverWindow() don't need to alter focus anyway,
draw_list->AddRectFilled(ImVec2(x,y),ImVec2(x+sz,y+thickness),col32);x+=sz+spacing;// Horizontal line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x,y),ImVec2(x+thickness,y+sz),col32);x+=spacing+spacing;// Vertical line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x,y),ImVec2(x+sz,y+thickness),col);x+=sz+spacing;// Horizontal line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x,y),ImVec2(x+1,y+1),col32);x+=sz;// Pixel (faster than AddLine)
draw_list->AddRectFilled(ImVec2(x,y),ImVec2(x+thickness,y+sz),col);x+=spacing*2.0f;// Vertical line (faster than AddLine, but only handle integer thickness)
draw_list->AddRectFilled(ImVec2(x,y),ImVec2(x+1,y+1),col);x+=sz;// Pixel (faster than AddLine)
@ -65,6 +65,7 @@ struct ImGuiColorMod; // Stacked color modifier, backup of modifie
structImGuiColumnData;// Storage data for a single column
structImGuiColumnData;// Storage data for a single column
structImGuiColumns;// Storage data for a columns set
structImGuiColumns;// Storage data for a columns set
structImGuiContext;// Main imgui context
structImGuiContext;// Main imgui context
structImGuiDataTypeInfo;// Type information associated to a ImGuiDataType enum
structImGuiDockContext;// Docking system context
structImGuiDockContext;// Docking system context
structImGuiDockNode;// Docking system node (hold a list of Windows OR two child dock nodes)
structImGuiDockNode;// Docking system node (hold a list of Windows OR two child dock nodes)
structImGuiDockNodeSettings;// Storage for a dock node in .ini file (we preserve those even if the associated dock node isn't active during the session)
structImGuiDockNodeSettings;// Storage for a dock node in .ini file (we preserve those even if the associated dock node isn't active during the session)
// Type information associated to one ImGuiDataType. Retrieve with DataTypeGetInfo().
structImGuiDataTypeInfo
{
size_tSize;// Size in byte
constchar*PrintFmt;// Default printf format for the type
constchar*ScanFmt;// Default scanf format for the type
};
// Stacked color modifier, backup of modified data so we can restore it
// Stacked color modifier, backup of modified data so we can restore it
structImGuiColorMod
structImGuiColorMod
{
{
@ -660,15 +669,17 @@ struct ImGuiSettingsHandler
};
};
// Storage for current popup stack
// Storage for current popup stack
structImGuiPopupRef
structImGuiPopupData
{
{
ImGuiIDPopupId;// Set on OpenPopup()
ImGuiIDPopupId;// Set on OpenPopup()
ImGuiWindow*Window;// Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
ImGuiWindow*Window;// Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
ImGuiWindow*ParentWindow;// Set on OpenPopup()
ImGuiWindow*SourceWindow;// Set on OpenPopup() copy of NavWindow at the time of opening the popup
intOpenFrameCount;// Set on OpenPopup()
intOpenFrameCount;// Set on OpenPopup()
ImGuiIDOpenParentId;// Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
ImGuiIDOpenParentId;// Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
ImVec2OpenPopupPos;// Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
ImVec2OpenPopupPos;// Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
ImVec2OpenMousePos;// Set on OpenPopup(), copy of mouse position at the time of opening popup
ImVec2OpenMousePos;// Set on OpenPopup(), copy of mouse position at the time of opening popup
IMGUI_APIboolIsPopupOpen(ImGuiIDid);// Test for id within current popup stack level (currently begin-ed into); this doesn't scan the whole popup stack!
IMGUI_APIboolIsPopupOpen(ImGuiIDid);// Test for id within current popup stack level (currently begin-ed into); this doesn't scan the whole popup stack!
ItemSize(ImVec2(0.0f,0.0f));// NB: we don't provide our width so that it doesn't get feed back into AutoFit, we don't provide height to not alter layout.
ItemSize(ImVec2(0.0f,1.0f));// NB: we don't provide our width so that it doesn't get feed back into AutoFit
ta.x+=(window->Pos.x<child_menu_window->Pos.x)?-0.5f:+0.5f;// to avoid numerical issues
floatextra=ImClamp(ImFabs(ta.x-tb.x)*0.30f,5.0f,30.0f);// add a bit of extra slack.
tb.y=ta.y+ImMax((tb.y-extra)-ta.y,-100.0f);// triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale?
ta.x+=(window->Pos.x<next_window->Pos.x)?-0.5f:+0.5f;// to avoid numerical issues
tc.y=ta.y+ImMin((tc.y+extra)-ta.y,+100.0f);
tb.y=ta.y+ImMax((tb.y-extra)-ta.y,-100.0f);// triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale?