1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibGUI: Add set_tab_index method

This method sets the current tab index to the value specified.
This commit is contained in:
TheMorc 2021-01-08 01:01:23 +01:00 committed by Andreas Kling
parent 5f364f5dc1
commit d0adaf4465
2 changed files with 10 additions and 0 deletions

View file

@ -113,6 +113,15 @@ void TabWidget::set_active_widget(Widget* widget)
update_bar();
}
void TabWidget::set_tab_index(int index)
{
if (m_tabs.at(index).widget == m_active_widget)
return;
set_active_widget(m_tabs.at(index).widget);
update_bar();
}
void TabWidget::resize_event(ResizeEvent& event)
{
if (!m_active_widget)