@@ -200,8 +200,8 @@ def create_main_layout(self):
200200 view_names = [view_name for view_name in view_names if view_name in self .views .keys ()]
201201 widgets_zone [zone ] = view_names
202202
203- self .make_dock (widgets_zone , ['zone1' , 'zone2' , 'zone5' , 'zone6' ], "left" )
204- self .make_dock (widgets_zone , ['zone3' , 'zone4' , 'zone7' , 'zone8' ], "right" )
203+ self .make_dock (widgets_zone , ['zone1' , 'zone2' , 'zone5' , 'zone6' ], "left" , col_shift = 0 )
204+ self .make_dock (widgets_zone , ['zone3' , 'zone4' , 'zone7' , 'zone8' ], "right" , col_shift = 2 )
205205
206206 # make tabs
207207 for zone , view_names in widgets_zone .items ():
@@ -217,7 +217,7 @@ def create_main_layout(self):
217217 # make visible the first of each zone
218218 self .docks [view_name0 ].raise_ ()
219219
220- def make_dock (self , widgets_zone , all_zones , side_of_window ):
220+ def make_dock (self , widgets_zone , all_zones , side_of_window , col_shift ):
221221
222222 all_zones_array = np .transpose (np .reshape (all_zones , (2 ,2 )))
223223 is_zone = np .array ([(widgets_zone .get (zone ) is not None ) and (len (widgets_zone .get (zone )) > 0 ) for zone in all_zones ])
@@ -228,8 +228,8 @@ def make_dock(self, widgets_zone, all_zones, side_of_window):
228228 if np .any (zones_in_columns ):
229229 first_is_top = zones_in_columns [0 ]
230230 if not first_is_top :
231- top_zone = f"zone{ column_index + 1 } "
232- bottom_zone = f"zone{ column_index + 5 } "
231+ top_zone = f"zone{ column_index + 1 + col_shift } "
232+ bottom_zone = f"zone{ column_index + 5 + col_shift } "
233233 widgets_zone [top_zone ] = widgets_zone [bottom_zone ]
234234 widgets_zone [bottom_zone ] = []
235235 continue
@@ -247,7 +247,7 @@ def make_dock(self, widgets_zone, all_zones, side_of_window):
247247 is_a_zone = original_zone_array [:,col ]
248248 num_row_0 , _ = get_size_top_row (0 , col , is_zone_array , original_zone_array )
249249 # this function affects is_zone_array so must be run
250- _ , _ = get_size_bottom_row (0 , col , is_zone_array , original_zone_array )
250+ _ , _ = get_size_bottom_row (1 , col , is_zone_array , original_zone_array )
251251
252252 if num_row_0 == 2 :
253253 if len (group ) > 0 :
@@ -262,6 +262,9 @@ def make_dock(self, widgets_zone, all_zones, side_of_window):
262262 if len (group ) > 0 :
263263 all_groups .append (group )
264264
265+ if len (all_groups ) == 0 :
266+ return
267+
265268 first_zone = all_groups [0 ][0 ]
266269 first_dock = widgets_zone [first_zone ][0 ]
267270 dock = self .docks [first_dock ]
0 commit comments