@@ -271,7 +271,7 @@ pub struct Tile {
271271 pub top_anchor : Handle < Border > ,
272272 pub bottom_anchor : Handle < Border > ,
273273 pub center_anchor : Handle < Border > ,
274- pub tabs : Handle < UiNode > ,
274+ pub tabs : Handle < TabControl > ,
275275 pub content : TileContent ,
276276 pub splitter : Handle < Border > ,
277277 pub dragging_splitter : bool ,
@@ -304,7 +304,7 @@ impl Control for Tile {
304304 return self . measure_vertical_with_minimized ( ui, available_size) ;
305305 }
306306 ui. measure_node ( self . tabs , Vector2 :: new ( available_size. x , f32:: INFINITY ) ) ;
307- available_size. y -= ui. node ( self . tabs ) . desired_size ( ) . y ;
307+ available_size. y -= ui[ self . tabs ] . desired_size ( ) . y ;
308308 for & child_handle in self . children ( ) {
309309 if child_handle == self . tabs {
310310 continue ;
@@ -347,7 +347,7 @@ impl Control for Tile {
347347 TileContent :: Empty => Vector2 :: default ( ) ,
348348 TileContent :: Window ( handle) => ui[ * handle] . desired_size ( ) ,
349349 TileContent :: MultiWindow { index, windows } => {
350- let tabs = ui. node ( self . tabs ) . desired_size ( ) ;
350+ let tabs = ui[ self . tabs ] . desired_size ( ) ;
351351 let body = windows
352352 . get ( * index as usize )
353353 . map ( |w| ui[ * w] . desired_size ( ) )
@@ -387,7 +387,7 @@ impl Control for Tile {
387387 return self . arrange_vertical_with_minimized ( ui, final_size) ;
388388 }
389389
390- let tabs_height = ui. node ( self . tabs ) . desired_size ( ) . y ;
390+ let tabs_height = ui[ self . tabs ] . desired_size ( ) . y ;
391391 ui. arrange_node ( self . tabs , & Rect :: new ( 0.0 , 0.0 , final_size. x , tabs_height) ) ;
392392 let full_bounds = Rect :: new ( 0.0 , tabs_height, final_size. x , final_size. y - tabs_height) ;
393393 for & child_handle in self . children ( ) {
@@ -494,7 +494,7 @@ impl Control for Tile {
494494 }
495495 TileContent :: MultiWindow { index, windows } => {
496496 send_visibility ( ui, self . splitter , false ) ;
497- let tabs = ui . node ( self . tabs ) . cast :: < TabControl > ( ) . unwrap ( ) ;
497+ let tabs = & ui [ self . tabs ] ;
498498 for tab in tabs. tabs . iter ( ) {
499499 let uuid = tab. uuid ;
500500 if !windows. iter ( ) . any ( |& h| ui[ h] . id == uuid) {
@@ -507,7 +507,7 @@ impl Control for Tile {
507507 for ( i, & w) in windows. iter ( ) . enumerate ( ) {
508508 let is_active = i as u32 == * index;
509509 let uuid = ui[ w] . id ;
510- let tabs = ui . node ( self . tabs ) . cast :: < TabControl > ( ) . unwrap ( ) ;
510+ let tabs = & ui [ self . tabs ] ;
511511 if tabs. get_tab_by_uuid ( uuid) . is_none ( ) {
512512 self . add_tab ( w, ui) ;
513513 }
0 commit comments