mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-11 00:04:24 +00:00
Tabs: fixed ImGuiTabBarFlags_FittingPolicyScroll not triggering (regression in 3ef6c84). (#3421, #8800)
This commit is contained in:
parent
c14d83d4e0
commit
250bd66b76
1 changed files with 2 additions and 1 deletions
|
|
@ -9689,7 +9689,8 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
|
||||||
// Horizontal scrolling buttons
|
// Horizontal scrolling buttons
|
||||||
// Important: note that TabBarScrollButtons() will alter BarRect.Max.x.
|
// Important: note that TabBarScrollButtons() will alter BarRect.Max.x.
|
||||||
const bool can_scroll = (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll) || (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyMixed);
|
const bool can_scroll = (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll) || (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyMixed);
|
||||||
tab_bar->ScrollButtonEnabled = ((width_all_tabs_after_min_width_shrink > tab_bar->BarRect.GetWidth() && tab_bar->Tabs.Size > 1) && !(tab_bar->Flags & ImGuiTabBarFlags_NoTabListScrollingButtons) && can_scroll);
|
const float width_all_tabs_to_use_for_scroll = (tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyScroll) ? tab_bar->WidthAllTabs : width_all_tabs_after_min_width_shrink;
|
||||||
|
tab_bar->ScrollButtonEnabled = ((width_all_tabs_to_use_for_scroll > tab_bar->BarRect.GetWidth() && tab_bar->Tabs.Size > 1) && !(tab_bar->Flags & ImGuiTabBarFlags_NoTabListScrollingButtons) && can_scroll);
|
||||||
if (tab_bar->ScrollButtonEnabled)
|
if (tab_bar->ScrollButtonEnabled)
|
||||||
if (ImGuiTabItem* scroll_and_select_tab = TabBarScrollingButtons(tab_bar))
|
if (ImGuiTabItem* scroll_and_select_tab = TabBarScrollingButtons(tab_bar))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue