Selectable: fixed ImGuiSelectableFlags_SelectOnNav triggering during NavInit.
Style Editor: fixed style/colors combo box applying style when opening Combo.
This commit is contained in:
parent
5a0ac1678c
commit
6d07f6eb09
@ -66,6 +66,8 @@ Other Changes:
|
|||||||
- Using <> scrolling buttons while the selected Tab is at either end of the
|
- Using <> scrolling buttons while the selected Tab is at either end of the
|
||||||
section mid-section but not fully visible always makes it fully visible
|
section mid-section but not fully visible always makes it fully visible
|
||||||
(before eventually selecting a Tab in the leading/trailing section)
|
(before eventually selecting a Tab in the leading/trailing section)
|
||||||
|
- Selectable:
|
||||||
|
- Fixed `ImGuiSelectableFlags_SelectOnNav` triggering during NavInit.
|
||||||
- Fonts:
|
- Fonts:
|
||||||
- Reworked `AddFontDefault()` to use `io.DisplayFrameBufferScale` as part of the heuristic
|
- Reworked `AddFontDefault()` to use `io.DisplayFrameBufferScale` as part of the heuristic
|
||||||
to select `AddFontDefaultVector()` by default, effectively using ProggyForever instead of
|
to select `AddFontDefaultVector()` by default, effectively using ProggyForever instead of
|
||||||
@ -105,6 +107,7 @@ Other Changes:
|
|||||||
Currently only supported by the OpenGL2/3 and SDLRenderer3 backend. (#9378)
|
Currently only supported by the OpenGL2/3 and SDLRenderer3 backend. (#9378)
|
||||||
- Demo:
|
- Demo:
|
||||||
- Added `Widgets->Mixed Values` section. (#5518, #5677, #6865)
|
- Added `Widgets->Mixed Values` section. (#5518, #5677, #6865)
|
||||||
|
- Style Editor: fixed style/colors combo box applying style when opening Combo.
|
||||||
- Backends:
|
- Backends:
|
||||||
- QNX: added QNX Screen backend. (#9492) [@mgorchak-blackberry]
|
- QNX: added QNX Screen backend. (#9492) [@mgorchak-blackberry]
|
||||||
- OpenGL2, OpenGL3: added support for `platform_io.DrawCallback_SetSamplerFromTex` draw
|
- OpenGL2, OpenGL3: added support for `platform_io.DrawCallback_SetSamplerFromTex` draw
|
||||||
|
|||||||
@ -4337,7 +4337,7 @@ ImGuiContext::ImGuiContext(ImFontAtlas* shared_font_atlas)
|
|||||||
|
|
||||||
NavJustMovedFromFocusScopeId = NavJustMovedToId = NavJustMovedToFocusScopeId = 0;
|
NavJustMovedFromFocusScopeId = NavJustMovedToId = NavJustMovedToFocusScopeId = 0;
|
||||||
NavJustMovedToKeyMods = ImGuiMod_None;
|
NavJustMovedToKeyMods = ImGuiMod_None;
|
||||||
NavJustMovedToIsTabbing = false;
|
NavJustMovedToIsTabbing = NavJustMovedToIsInit = false;
|
||||||
NavJustMovedToHasSelectionData = false;
|
NavJustMovedToHasSelectionData = false;
|
||||||
|
|
||||||
// All platforms use Ctrl+Tab but Ctrl<>Super are swapped on Mac...
|
// All platforms use Ctrl+Tab but Ctrl<>Super are swapped on Mac...
|
||||||
@ -14174,6 +14174,7 @@ void ImGui::NavInitRequestApplyResult()
|
|||||||
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
||||||
g.NavJustMovedToKeyMods = 0;
|
g.NavJustMovedToKeyMods = 0;
|
||||||
g.NavJustMovedToIsTabbing = false;
|
g.NavJustMovedToIsTabbing = false;
|
||||||
|
g.NavJustMovedToIsInit = true;
|
||||||
g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0;
|
g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14441,6 +14442,7 @@ void ImGui::NavMoveRequestApplyResult()
|
|||||||
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
g.NavJustMovedToFocusScopeId = result->FocusScopeId;
|
||||||
g.NavJustMovedToKeyMods = g.NavMoveKeyMods;
|
g.NavJustMovedToKeyMods = g.NavMoveKeyMods;
|
||||||
g.NavJustMovedToIsTabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0;
|
g.NavJustMovedToIsTabbing = (g.NavMoveFlags & ImGuiNavMoveFlags_IsTabbing) != 0;
|
||||||
|
g.NavJustMovedToIsInit = false;
|
||||||
g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0;
|
g.NavJustMovedToHasSelectionData = (result->ItemFlags & ImGuiItemFlags_HasSelectionUserData) != 0;
|
||||||
//IMGUI_DEBUG_LOG_NAV("[nav] NavJustMovedFromFocusScopeId = 0x%08X, NavJustMovedToFocusScopeId = 0x%08X\n", g.NavJustMovedFromFocusScopeId, g.NavJustMovedToFocusScopeId);
|
//IMGUI_DEBUG_LOG_NAV("[nav] NavJustMovedFromFocusScopeId = 0x%08X, NavJustMovedToFocusScopeId = 0x%08X\n", g.NavJustMovedFromFocusScopeId, g.NavJustMovedToFocusScopeId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2445,6 +2445,7 @@ struct ImGuiContext
|
|||||||
ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
|
ImGuiID NavJustMovedToFocusScopeId; // Just navigated to this focus scope id (result of a successfully MoveRequest).
|
||||||
ImGuiKeyChord NavJustMovedToKeyMods;
|
ImGuiKeyChord NavJustMovedToKeyMods;
|
||||||
bool NavJustMovedToIsTabbing; // Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
|
bool NavJustMovedToIsTabbing; // Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
|
||||||
|
bool NavJustMovedToIsInit; // Copy of ImGuiNavMoveFlags_IsTabbing. Maybe we should store whole flags.
|
||||||
bool NavJustMovedToHasSelectionData; // Copy of move result's ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
|
bool NavJustMovedToHasSelectionData; // Copy of move result's ItemFlags & ImGuiItemFlags_HasSelectionUserData). Maybe we should just store ImGuiNavItemData.
|
||||||
|
|
||||||
// Navigation: extra config options (will be made public eventually)
|
// Navigation: extra config options (will be made public eventually)
|
||||||
|
|||||||
@ -7616,7 +7616,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
|
|||||||
// - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope())
|
// - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope())
|
||||||
// - (2) usage will fail with clipped items
|
// - (2) usage will fail with clipped items
|
||||||
// The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API.
|
// The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API.
|
||||||
if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId)
|
if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId && !g.NavJustMovedToIsInit)
|
||||||
if (g.NavJustMovedToId == id && (g.NavJustMovedToKeyMods & ImGuiMod_Ctrl) == 0)
|
if (g.NavJustMovedToId == id && (g.NavJustMovedToKeyMods & ImGuiMod_Ctrl) == 0)
|
||||||
selected = pressed = auto_selected = true;
|
selected = pressed = auto_selected = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user