Menus: Tweaked horizontal overlap between parent and child menu (to help convey relative depth) from using style.ItemSpacing.x to style.ItemInnerSpacing.x, the later being expected to be smaller. (#1086)
@ -159,6 +159,7 @@ It's mostly a bunch of personal notes, probably incomplete. Feel free to query i
- listbox: user may want to initial scroll to focus on the one selected value?
- listbox: user may want to initial scroll to focus on the one selected value?
- listbox: expose hovered item for a basic ListBox
- listbox: expose hovered item for a basic ListBox
- listbox: keyboard navigation.
- listbox: keyboard navigation.
- listbox: disable capturing mouse wheel if the listbox has no scrolling. (#1681)
- listbox: scrolling should track modified selection.
- listbox: scrolling should track modified selection.
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
!- popups/menus: clarify usage of popups id, how MenuItem/Selectable closing parent popups affects the ID, etc. this is quite fishy needs improvement! (#331, #402)
// Child menus typically request _any_ position within the parent menu item, and then our FindBestWindowPosForPopup() function will move the new menu outside the parent bounds.
// Child menus typically request _any_ position within the parent menu item, and then we move the new menu outside the parent bounds.
// This is how we end up with child menus appearing (most-commonly) on the right of the parent menu.
// This is how we end up with child menus appearing (most-commonly) on the right of the parent menu.
floathorizontal_overlap=g.Style.ItemSpacing.x;// We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x).
floathorizontal_overlap=g.Style.ItemInnerSpacing.x;// We want some overlap to convey the relative depth of each menu (currently the amount of overlap is hard-coded to style.ItemSpacing.x).
g.NavWindow=window;// Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent)
g.NavWindow=window;// Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent)
// The reference position stored in popup_pos will be used by Begin() to find a suitable position for the child menu (using FindBestWindowPosForPopup).
// The reference position stored in popup_pos will be used by Begin() to find a suitable position for the child menu,
// However the final position is going to be different! It is choosen by FindBestWindowPosForPopup().
// e.g. Menus tend to overlap each other horizontally to amplify relative Z-ordering.
floatextra=ImClamp(ImFabs(ta.x-tb.x)*0.30f,5.0f,30.0f);// add a bit of extra slack.
floatextra=ImClamp(ImFabs(ta.x-tb.x)*0.30f,5.0f,30.0f);// add a bit of extra slack.
ta.x+=(window->Pos.x<next_window->Pos.x)?-0.5f:+0.5f;// to avoid numerical issues
ta.x+=(window->Pos.x<next_window->Pos.x)?-0.5f:+0.5f;// to avoid numerical issues
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?
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?