@ -369,7 +369,6 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- nav: NavFlattened: broken: in typical usage scenario, the items of a fully clipped child are currently not considered to enter into a NavFlattened child.
- nav: NavFlattened: broken: in typical usage scenario, the items of a fully clipped child are currently not considered to enter into a NavFlattened child.
- nav: NavFlattened: cannot access menu-bar of a flattened child window with Alt/menu key (not a very common use case..).
- nav: NavFlattened: cannot access menu-bar of a flattened child window with Alt/menu key (not a very common use case..).
- nav: simulate right-click or context activation? (SHIFT+F10)
- nav: simulate right-click or context activation? (SHIFT+F10)
- nav/tabbing: refactor old tabbing system and turn into navigation, should pass through all widgets (in submission order?).
- nav/popup: esc/enter default behavior for popups, e.g. be able to mark an "ok" or "cancel" button that would get triggered by those keys, default validation button, etc.
- nav/popup: esc/enter default behavior for popups, e.g. be able to mark an "ok" or "cancel" button that would get triggered by those keys, default validation button, etc.
- nav/treenode: left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
- nav/treenode: left within a tree node block as a fallback (ImGuiTreeNodeFlags_NavLeftJumpsBackHere by default?)
- nav/menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
- nav/menus: pressing left-right on a vertically clipped menu bar tends to jump to the collapse/close buttons.
g.TabFocusRequestNextCounterTabStop=window->DC.FocusCounterTabStop+(g.IO.KeyShift?(is_tab_stop?-1:0):+1);// Modulo on index will be applied at the end of frame once we've got the total counter of items.
// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
// The reason this is exposed in imgui_internal.h is: on touch-based system that don't have hovering, we want to dispatch inputs to the right target (imgui vs imgui+app)
voidImGui::UpdateHoveredWindowAndCaptureFlags()
voidImGui::UpdateHoveredWindowAndCaptureFlags()
{
{
@ -4339,9 +4265,6 @@ void ImGui::NewFrame()
// Mouse wheel scrolling, scale
// Mouse wheel scrolling, scale
UpdateMouseWheel();
UpdateMouseWheel();
// Update legacy TAB focus
UpdateTabFocus();
// Mark all windows as not visible and compact unused memory.
// Mark all windows as not visible and compact unused memory.
NavMoveRequestSubmit(ImGuiDir_None,ImGuiDir_None,ImGuiNavMoveFlags_Tabbing,scroll_flags);// FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
NavMoveRequestSubmit(ImGuiDir_None,offset <0?ImGuiDir_Up:ImGuiDir_Down,ImGuiNavMoveFlags_Tabbing|ImGuiNavMoveFlags_FocusApi,scroll_flags);// FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
// [WIP] Tab stop handling (previously was using internal FocusableItemRegister() api)
// FIXME-NAV: We would now want to move this before the clipping test, but this would require being able to scroll and currently this would mean an extra frame. (#4079, #343)
if(extra_flags&ImGuiItemFlags_Inputable)
ItemInputable(window,id);
// We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them)
// We need to calculate this now to take account of the current clipping rectangle (as items like Selectable may change them)
// Handle "scoring" of an item for a tabbing/focusing request initiated by NavUpdateCreateTabbingRequest().
// Note that SetKeyboardFocusHere() API calls are considered tabbing requests!
// - Case 1: no nav/active id: set result to first eligible item, stop storing.
// - Case 2: tab forward: on ref id set counter, on counter elapse store result
// - Case 3: tab forward wrap: set result to first eligible item (preemptively), on ref id set counter, on next frame if counter hasn't elapsed store result. // FIXME-TABBING: Could be done as a next-frame forwarded request
// - Case 4: tab backward: store all results, on ref id pick prev, stop storing
// - Case 5: tab backward wrap: store all results, on ref id if no result keep storing until last // FIXME-TABBING: Could be done as next-frame forwarded requested
// (this is ALWAYS ENABLED, regardless of ImGuiConfigFlags_NavEnableKeyboard flag!)
// Initially this was designed to use counters and modulo arithmetic, but that could not work with unsubmitted items (list clipper). Instead we use a strategy close to other move requests.
// See NavProcessItemForTabbingRequest() for a description of the various forward/backward tabbing cases with and without wrapping.
//// FIXME: We use (g.ActiveId == 0) but (g.NavDisableHighlight == false) might be righter once we can tab through anything
NavMoveRequestSubmit(ImGuiDir_None,clip_dir,ImGuiNavMoveFlags_Tabbing,scroll_flags);// FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
g.NavTabbingResultFirst.Clear();
g.NavTabbingCounter=-1;
}
// Apply result from previous frame navigation directional move request. Always called from NavUpdate()
// Apply result from previous frame navigation directional move request. Always called from NavUpdate()
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
ImGuiIDNavActivateInputId;// ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
ImGuiIDNavActivateInputId;// ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
ImGuiActivateFlagsNavActivateFlags;
ImGuiActivateFlagsNavActivateFlags;
ImGuiIDNavJustTabbedId;// Just tabbed to this id.
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToId;// Just navigated to this id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToFocusScopeId;// Just navigated to this focus scope id (result of a successfully MoveRequest).
ImGuiIDNavJustMovedToFocusScopeId;// Just navigated to this focus scope id (result of a successfully MoveRequest).
ImGuiKeyModFlagsNavJustMovedToKeyMods;
ImGuiKeyModFlagsNavJustMovedToKeyMods;
@ -1774,7 +1774,6 @@ struct ImGuiContext
ImGuiActivateFlagsNavNextActivateFlags;
ImGuiActivateFlagsNavNextActivateFlags;
ImGuiInputSourceNavInputSource;// Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
ImGuiInputSourceNavInputSource;// Keyboard or Gamepad mode? THIS WILL ONLY BE None or NavGamepad or NavKeyboard.
ImGuiNavLayerNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
ImGuiNavLayerNavLayer;// Layer we are navigating on. For now the system is hard-coded for 0=main contents and 1=menu/title bar, may expose layers later.
intNavIdTabCounter;// == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRectRel is valid
boolNavIdIsAlive;// Nav widget has been seen this frame ~~ NavRectRel is valid
boolNavMousePosDirty;// When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
boolNavMousePosDirty;// When set we will update mouse position if (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) if set (NB: this not enabled by default)
boolNavDisableHighlight;// When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
boolNavDisableHighlight;// When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
@ -1798,10 +1797,12 @@ struct ImGuiContext
ImRectNavScoringRect;// Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
ImRectNavScoringRect;// Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
ImRectNavScoringNoClipRect;// Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted
ImRectNavScoringNoClipRect;// Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted
intNavScoringDebugCount;// Metrics for debugging
intNavScoringDebugCount;// Metrics for debugging
intNavTabbingInputableRemaining;// >0 when counting items for tabbing
intNavTabbingDir;// Generally -1 or +1, 0 when tabbing without a nav id
intNavTabbingCounter;// >0 when counting items for tabbing
ImGuiNavItemDataNavMoveResultLocal;// Best move request candidate within NavWindow
ImGuiNavItemDataNavMoveResultLocal;// Best move request candidate within NavWindow
ImGuiNavItemDataNavMoveResultLocalVisible;// Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
ImGuiNavItemDataNavMoveResultLocalVisible;// Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
ImGuiNavItemDataNavMoveResultOther;// Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
ImGuiNavItemDataNavMoveResultOther;// Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
ImGuiNavItemDataNavTabbingResultFirst;// First tabbing request candidate within NavWindow and flattened hierarchy
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
ImGuiWindow*NavWindowingTarget;// Target window when doing CTRL+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most!
ImGuiWindow*NavWindowingTarget;// Target window when doing CTRL+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most!
@ -1811,13 +1812,6 @@ struct ImGuiContext
floatNavWindowingHighlightAlpha;
floatNavWindowingHighlightAlpha;
boolNavWindowingToggleLayer;
boolNavWindowingToggleLayer;
// Legacy Focus/Tabbing system (older than Nav, active even if Nav is disabled, misnamed. FIXME-NAV: This needs a redesign!)
ImGuiWindow*TabFocusRequestCurrWindow;//
ImGuiWindow*TabFocusRequestNextWindow;//
intTabFocusRequestCurrCounterTabStop;// Tab item being requested for focus, stored as an index
intTabFocusRequestNextCounterTabStop;// "
boolTabFocusPressed;// Set in NewFrame() when user pressed Tab
// Render
// Render
floatDimBgRatio;// 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
floatDimBgRatio;// 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
intCurrentTableIdx;// Current table index (into g.Tables)
intCurrentTableIdx;// Current table index (into g.Tables)
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeLayoutType;
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
ImGuiLayoutTypeParentLayoutType;// Layout type of parent window at the time of Begin()
intFocusCounterTabStop;// (Legacy Focus/Tabbing system) Same, but only count widgets which you can Tab through.
// Local parameters stacks
// Local parameters stacks
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.