mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-11 19:54:03 +00:00
GUI: Setting the active tab also ensures it is visible in the tab bar
This commit is contained in:
parent
54230af9fd
commit
50847f9e03
@ -199,6 +199,12 @@ void TabWidget::setActiveTab(int tabID) {
|
||||
}
|
||||
_activeTab = tabID;
|
||||
_firstWidget = _tabs[tabID].firstWidget;
|
||||
|
||||
// Also ensure the tab is visible in the tab bar
|
||||
if (_firstVisibleTab > tabID)
|
||||
_firstVisibleTab = tabID;
|
||||
else if (_firstVisibleTab + _w / _tabWidth <= tabID)
|
||||
_firstVisibleTab = tabID - _w / _tabWidth + 1;
|
||||
|
||||
_boss->draw();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user