From 68ffa1f7f885ddaaa9f1810cc09cdb443a93f15b Mon Sep 17 00:00:00 2001 From: RickyRister Date: Tue, 14 Jan 2025 00:36:43 -0800 Subject: [PATCH] move addCloseButtonToTab up --- cockatrice/src/client/tabs/tab_supervisor.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cockatrice/src/client/tabs/tab_supervisor.cpp b/cockatrice/src/client/tabs/tab_supervisor.cpp index 66ba5c839..a2711e5e0 100644 --- a/cockatrice/src/client/tabs/tab_supervisor.cpp +++ b/cockatrice/src/client/tabs/tab_supervisor.cpp @@ -295,6 +295,15 @@ int TabSupervisor::myAddTab(Tab *tab) return idx; } +void TabSupervisor::addCloseButtonToTab(Tab *tab, int tabIndex) +{ + auto closeSide = static_cast( + tabBar()->style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, nullptr, tabBar())); + auto *closeButton = new CloseButton(tab); + connect(closeButton, &CloseButton::clicked, tab, [tab] { tab->closeRequest(); }); + tabBar()->setTabButton(tabIndex, closeSide, closeButton); +} + /** * Resets the tabs menu to the tabs that are always available */ @@ -535,15 +544,6 @@ void TabSupervisor::updatePingTime(int value, int max) setTabIcon(indexOf(tabServer), QIcon(PingPixmapGenerator::generatePixmap(15, value, max))); } -void TabSupervisor::addCloseButtonToTab(Tab *tab, int tabIndex) -{ - auto closeSide = static_cast( - tabBar()->style()->styleHint(QStyle::SH_TabBar_CloseButtonPosition, nullptr, tabBar())); - auto *closeButton = new CloseButton(tab); - connect(closeButton, &CloseButton::clicked, tab, [tab] { tab->closeRequest(); }); - tabBar()->setTabButton(tabIndex, closeSide, closeButton); -} - void TabSupervisor::gameJoined(const Event_GameJoined &event) { QMap roomGameTypes;