@@ -29,8 +29,9 @@ def __init__(self, settings: RareAppSettings, rcore: RareCore, parent):
2929 self .signals = rcore .signals ()
3030 self .args = rcore .args ()
3131
32- self .tab_bar = MainTabBar (parent = self )
33- self .setTabBar (self .tab_bar )
32+ self .main_bar = MainTabBar (parent = self )
33+ self .main_bar .installEventFilter (self )
34+ self .setTabBar (self .main_bar )
3435
3536 # Generate Tabs
3637 self .games_tab = GamesLibrary (self .settings , self .rcore , self )
@@ -52,11 +53,10 @@ def __init__(self, settings: RareAppSettings, rcore: RareCore, parent):
5253 # Space Tab
5354 space_index = self .addTab (QWidget (self ), "Rare" )
5455 self .setTabEnabled (space_index , False )
55- self .tab_bar .expanded_idx = space_index
56+ self .main_bar .expanded_idx = space_index
5657
5758 # Integrations Tab
5859 self .integrations_tab = IntegrationsTab (self .rcore , self )
59- self .integrations_tab .back_clicked .connect (lambda : self .setCurrentWidget (self .games_tab ))
6060 self .integrations_index = self .addTab (self .integrations_tab , self .tr ("Integrations" ))
6161
6262 # Account Tab
@@ -74,7 +74,7 @@ def __init__(self, settings: RareAppSettings, rcore: RareCore, parent):
7474 # Settings Tab
7575 self .settings_tab = SettingsTab (settings , rcore , self )
7676 self .settings_index = self .addTab (self .settings_tab , qta_icon ("fa.gear" , "fa6s.gear" ), "" )
77- self .settings_tab .about .update_available_ready .connect (lambda : self .tab_bar .setTabText (self .settings_index , "(!)" ))
77+ self .settings_tab .about .update_available_ready .connect (lambda : self .main_bar .setTabText (self .settings_index , "(!)" ))
7878
7979 # Open game list on click on Games tab button
8080 self .tabBarClicked .connect (self .mouse_clicked )
@@ -88,17 +88,16 @@ def __init__(self, settings: RareAppSettings, rcore: RareCore, parent):
8888 QShortcut ("Alt+5" , self ).activated .connect (lambda : self .setCurrentIndex (self .settings_index ))
8989
9090 self .setCurrentIndex (self .games_index )
91- self .tab_bar .installEventFilter (self )
9291
9392 def eventFilter (self , w : QObject , e : QEvent ) -> bool :
9493 if not isinstance (e , QEvent ):
9594 return True
96- if w is self .tab_bar and e .type () == QEvent .Type .MouseButtonPress :
97- tab_idx = self .tab_bar .tabAt (e .pos ())
95+ if w is self .main_bar and e .type () == QEvent .Type .MouseButtonPress :
96+ tab_idx = self .main_bar .tabAt (e .pos ())
9897 if tab_idx == self .account_index :
9998 if e .button () == Qt .MouseButton .LeftButton :
10099 self .account_menu .exec (
101- self .mapToGlobal (self .tab_bar .tabRect (tab_idx ).bottomRight () - self .account_menu .rect ().topRight ())
100+ self .mapToGlobal (self .main_bar .tabRect (tab_idx ).bottomRight () - self .account_menu .rect ().topRight ())
102101 )
103102 return True
104103 return False
@@ -138,7 +137,7 @@ def mouse_clicked(self, index):
138137 self .integrations_tab .show_import ()
139138
140139 def resizeEvent (self , event ):
141- self .tab_bar .setMinimumWidth (self .width ())
140+ self .main_bar .setMinimumWidth (self .width ())
142141 super (MainTabWidget , self ).resizeEvent (event )
143142
144143 @Slot (int )
0 commit comments