@ -7234,13 +7234,6 @@ static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar)
const ImVec2 backup_cursor_pos = window - > DC . CursorPos ;
const ImVec2 backup_cursor_pos = window - > DC . CursorPos ;
//window->DrawList->AddRect(ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width, tab_bar->BarRect.Min.y), ImVec2(tab_bar->BarRect.Max.x, tab_bar->BarRect.Max.y), IM_COL32(255,0,0,255));
//window->DrawList->AddRect(ImVec2(tab_bar->BarRect.Max.x - scrolling_buttons_width, tab_bar->BarRect.Min.y), ImVec2(tab_bar->BarRect.Max.x, tab_bar->BarRect.Max.y), IM_COL32(255,0,0,255));
const ImRect avail_bar_rect = tab_bar - > BarRect ;
bool want_clip_rect = ! avail_bar_rect . Contains ( ImRect ( window - > DC . CursorPos , window - > DC . CursorPos + ImVec2 ( scrolling_buttons_width , 0.0f ) ) ) ;
if ( want_clip_rect )
PushClipRect ( tab_bar - > BarRect . Min , tab_bar - > BarRect . Max + ImVec2 ( g . Style . ItemInnerSpacing . x , 0.0f ) , true ) ;
ImGuiTabItem * tab_to_select = NULL ;
int select_dir = 0 ;
int select_dir = 0 ;
ImVec4 arrow_col = g . Style . Colors [ ImGuiCol_Text ] ;
ImVec4 arrow_col = g . Style . Colors [ ImGuiCol_Text ] ;
arrow_col . w * = 0.5f ;
arrow_col . w * = 0.5f ;
@ -7251,30 +7244,29 @@ static ImGuiTabItem* ImGui::TabBarScrollingButtons(ImGuiTabBar* tab_bar)
const float backup_repeat_rate = g . IO . KeyRepeatRate ;
const float backup_repeat_rate = g . IO . KeyRepeatRate ;
g . IO . KeyRepeatDelay = 0.250f ;
g . IO . KeyRepeatDelay = 0.250f ;
g . IO . KeyRepeatRate = 0.200f ;
g . IO . KeyRepeatRate = 0.200f ;
window - > DC . CursorPos = ImVec2 ( tab_bar - > BarRect . Max . x - scrolling_buttons_width , tab_bar - > BarRect . Min . y ) ;
float x = ImMax ( tab_bar - > BarRect . Min . x , tab_bar - > BarRect . Max . x - scrolling_buttons_width ) ;
window - > DC . CursorPos = ImVec2 ( x , tab_bar - > BarRect . Min . y ) ;
if ( ArrowButtonEx ( " ##< " , ImGuiDir_Left , arrow_button_size , ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat ) )
if ( ArrowButtonEx ( " ##< " , ImGuiDir_Left , arrow_button_size , ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat ) )
select_dir = - 1 ;
select_dir = - 1 ;
window - > DC . CursorPos = ImVec2 ( tab_bar- > BarRect . Ma x. x - scrolling_buttons_width + arrow_button_size . x , tab_bar - > BarRect . Min . y ) ;
window - > DC . CursorPos = ImVec2 ( x + arrow_button_size . x , tab_bar - > BarRect . Min . y ) ;
if ( ArrowButtonEx ( " ##> " , ImGuiDir_Right , arrow_button_size , ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat ) )
if ( ArrowButtonEx ( " ##> " , ImGuiDir_Right , arrow_button_size , ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_Repeat ) )
select_dir = + 1 ;
select_dir = + 1 ;
PopStyleColor ( 2 ) ;
PopStyleColor ( 2 ) ;
g . IO . KeyRepeatRate = backup_repeat_rate ;
g . IO . KeyRepeatRate = backup_repeat_rate ;
g . IO . KeyRepeatDelay = backup_repeat_delay ;
g . IO . KeyRepeatDelay = backup_repeat_delay ;
if ( want_clip_rect )
ImGuiTabItem * tab_to_scroll_to = NULL ;
PopClipRect ( ) ;
if ( select_dir ! = 0 )
if ( select_dir ! = 0 )
if ( ImGuiTabItem * tab_item = TabBarFindTabByID ( tab_bar , tab_bar - > SelectedTabId ) )
if ( ImGuiTabItem * tab_item = TabBarFindTabByID ( tab_bar , tab_bar - > SelectedTabId ) )
{
{
int selected_order = tab_bar - > GetTabOrder ( tab_item ) ;
int selected_order = tab_bar - > GetTabOrder ( tab_item ) ;
int target_order = selected_order + select_dir ;
int target_order = selected_order + select_dir ;
tab_to_s elect = & tab_bar - > Tabs [ ( target_order > = 0 & & target_order < tab_bar - > Tabs . Size ) ? target_order : selected_order ] ; // If we are at the end of the list, still scroll to make our tab visible
tab_to_s croll_to = & tab_bar - > Tabs [ ( target_order > = 0 & & target_order < tab_bar - > Tabs . Size ) ? target_order : selected_order ] ; // If we are at the end of the list, still scroll to make our tab visible
}
}
window - > DC . CursorPos = backup_cursor_pos ;
window - > DC . CursorPos = backup_cursor_pos ;
tab_bar - > BarRect . Max . x - = scrolling_buttons_width + 1.0f ;
tab_bar - > BarRect . Max . x - = scrolling_buttons_width + 1.0f ;
return tab_to_s elect ;
return tab_to_s croll_to ;
}
}
static ImGuiTabItem * ImGui : : TabBarTabListPopupButton ( ImGuiTabBar * tab_bar )
static ImGuiTabItem * ImGui : : TabBarTabListPopupButton ( ImGuiTabBar * tab_bar )