2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/*************************************************************************/ 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*  tab_bar.cpp                                                          */ 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/*************************************************************************/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/*                       This file is part of:                           */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/*                           GODOT ENGINE                                */ 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-27 14:16:55 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/*                      https://godotengine.org                          */ 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/*************************************************************************/ 
							 
						 
					
						
							
								
									
										
										
										
											2021-01-01 20:13:46 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur.                 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md).   */ 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/*                                                                       */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* Permission is hereby granted, free of charge, to any person obtaining */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* a copy of this software and associated documentation files (the       */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* "Software"), to deal in the Software without restriction, including   */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* without limitation the rights to use, copy, modify, merge, publish,   */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* distribute, sublicense, and/or sell copies of the Software, and to    */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* permit persons to whom the Software is furnished to do so, subject to */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* the following conditions:                                             */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/*                                                                       */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* The above copyright notice and this permission notice shall be        */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* included in all copies or substantial portions of the Software.       */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/*                                                                       */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/*************************************************************************/ 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-05 00:50:27 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "tab_bar.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-11-07 19:33:38 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "core/object/message_queue.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "core/string/translation.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "scene/gui/box_container.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "scene/gui/label.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "scene/gui/texture_rect.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Size2  TabBar : : get_minimum_size ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_unselected  =  get_theme_stylebox ( SNAME ( " tab_unselected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_selected  =  get_theme_stylebox ( SNAME ( " tab_selected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_disabled  =  get_theme_stylebox ( SNAME ( " tab_disabled " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  y_margin  =  MAX ( MAX ( tab_unselected - > get_minimum_size ( ) . height ,  tab_selected - > get_minimum_size ( ) . height ) ,  tab_disabled - > get_minimum_size ( ) . height ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Size2  ms ( 0 ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for  ( int  i  =  0 ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Ref < Texture2D >  tex  =  tabs [ i ] . icon ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										if  ( tex . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . height  =  MAX ( ms . height ,  tex - > get_size ( ) . height ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( tabs [ i ] . text  ! =  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												ms . width  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ms . width  + =  Math : : ceil ( tabs [ i ] . text_buf - > get_size ( ) . x ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ms . height  =  MAX ( ms . height ,  tabs [ i ] . text_buf - > get_size ( ) . y  +  y_margin ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( tabs [ i ] . disabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . width  + =  tab_disabled - > get_minimum_size ( ) . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										}  else  if  ( current  = =  i )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . width  + =  tab_selected - > get_minimum_size ( ) . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . width  + =  tab_unselected - > get_minimum_size ( ) . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( tabs [ i ] . right_button . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  rb  =  tabs [ i ] . right_button ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Size2  bms  =  rb - > get_size ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											bms . width  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . width  + =  bms . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . height  =  MAX ( bms . height  +  tab_unselected - > get_minimum_size ( ) . height ,  ms . height ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ALWAYS  | |  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ACTIVE_ONLY  & &  i  = =  current ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  cb  =  get_theme_icon ( SNAME ( " close " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Size2  bms  =  cb - > get_size ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											bms . width  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . width  + =  bms . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ms . height  =  MAX ( bms . height  +  tab_unselected - > get_minimum_size ( ) . height ,  ms . height ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( clip_tabs )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ms . width  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									return  ms ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : gui_input ( const  Ref < InputEvent >  & p_event )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-04-05 08:52:21 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_COND ( p_event . is_null ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 12:38:03 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < InputEventMouseMotion >  mm  =  p_event ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 12:38:03 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( mm . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-03 10:54:24 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Point2  pos  =  mm - > get_position ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( buttons_visible )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  incr  =  get_theme_icon ( SNAME ( " increment " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  decr  =  get_theme_icon ( SNAME ( " decrement " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( is_layout_rtl ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( pos . x  <  decr - > get_width ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 14:24:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( highlight_arrow  ! =  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														highlight_arrow  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												}  else  if  ( pos . x  <  incr - > get_width ( )  +  decr - > get_width ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 14:24:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( highlight_arrow  ! =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														highlight_arrow  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												}  else  if  ( highlight_arrow  ! =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													highlight_arrow  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													update ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												int  limit_minus_buttons  =  get_size ( ) . width  -  incr - > get_width ( )  -  decr - > get_width ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( pos . x  >  limit_minus_buttons  +  decr - > get_width ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 14:24:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( highlight_arrow  ! =  1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														highlight_arrow  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												}  else  if  ( pos . x  >  limit_minus_buttons )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-18 14:24:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( highlight_arrow  ! =  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														highlight_arrow  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												}  else  if  ( highlight_arrow  ! =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													highlight_arrow  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													update ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-21 14:57:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										_update_hover ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-05-20 12:38:03 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < InputEventMouseButton >  mb  =  p_event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( mb . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( mb - > is_pressed ( )  & &  mb - > get_button_index ( )  = =  MouseButton : : WHEEL_UP  & &  ! mb - > is_command_pressed ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( scrolling_enabled  & &  buttons_visible )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( offset  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													offset - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( mb - > is_pressed ( )  & &  mb - > get_button_index ( )  = =  MouseButton : : WHEEL_DOWN  & &  ! mb - > is_command_pressed ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( scrolling_enabled  & &  buttons_visible )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( missing_right )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													offset + + ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-04 10:37:53 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													_ensure_no_over_offset ( ) ;  // Avoid overreaching when scrolling fast.
 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( rb_pressing  & &  ! mb - > is_pressed ( )  & &  mb - > get_button_index ( )  = =  MouseButton : : LEFT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( rb_hover  ! =  - 1 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												// pressed
 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												emit_signal ( SNAME ( " tab_rmb_clicked " ) ,  rb_hover ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											rb_pressing  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											update ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( cb_pressing  & &  ! mb - > is_pressed ( )  & &  mb - > get_button_index ( )  = =  MouseButton : : LEFT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( cb_hover  ! =  - 1 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												// pressed
 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-27 19:39:13 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												emit_signal ( SNAME ( " tab_close_pressed " ) ,  cb_hover ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											cb_pressing  =  false ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-08-13 16:31:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( mb - > is_pressed ( )  & &  ( mb - > get_button_index ( )  = =  MouseButton : : LEFT  | |  ( select_with_rmb  & &  mb - > get_button_index ( )  = =  MouseButton : : RIGHT ) ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											// clicks
 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-25 14:46:45 +05:45 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Point2  pos  =  mb - > get_position ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( buttons_visible )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Ref < Texture2D >  incr  =  get_theme_icon ( SNAME ( " increment " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												Ref < Texture2D >  decr  =  get_theme_icon ( SNAME ( " decrement " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( is_layout_rtl ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( pos . x  <  decr - > get_width ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if  ( missing_right )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															offset + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													}  else  if  ( pos . x  <  incr - > get_width ( )  +  decr - > get_width ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if  ( offset  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															offset - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													int  limit  =  get_size ( ) . width  -  incr - > get_width ( )  -  decr - > get_width ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( pos . x  >  limit  +  decr - > get_width ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if  ( missing_right )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															offset + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													}  else  if  ( pos . x  >  limit )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if  ( offset  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															offset - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														return ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-27 16:13:04 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( tabs . is_empty ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-20 14:37:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												// Return early if there are no actual tabs to handle input for.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											int  found  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-07 22:38:04 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											for  ( int  i  =  offset ;  i  < =  max_drawn_tab ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( tabs [ i ] . rb_rect . has_point ( pos ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													rb_pressing  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( tabs [ i ] . cb_rect . has_point ( pos ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													cb_pressing  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( pos . x  > =  get_tab_rect ( i ) . position . x  & &  pos . x  <  get_tab_rect ( i ) . position . x  +  tabs [ i ] . size_cache )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( ! tabs [ i ] . disabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														found  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( found  ! =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												set_current_tab ( found ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												emit_signal ( SNAME ( " tab_clicked " ) ,  found ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _shape ( int  p_tab )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < Font >  font  =  get_theme_font ( SNAME ( " font " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  font_size  =  get_theme_font_size ( SNAME ( " font_size " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 14:31:33 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . xl_text  =  atr ( tabs [ p_tab ] . text ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . text_buf - > clear ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-23 21:20:15 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . text_buf - > set_width ( - 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( tabs [ p_tab ] . text_direction  = =  Control : : TEXT_DIRECTION_INHERITED )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ p_tab ] . text_buf - > set_direction ( is_layout_rtl ( )  ?  TextServer : : DIRECTION_RTL  :  TextServer : : DIRECTION_LTR ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ p_tab ] . text_buf - > set_direction ( ( TextServer : : Direction ) tabs [ p_tab ] . text_direction ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . text_buf - > add_string ( tabs . write [ p_tab ] . xl_text ,  font ,  font_size ,  tabs [ p_tab ] . opentype_features ,  ( tabs [ p_tab ] . language  ! =  " " )  ?  tabs [ p_tab ] . language  :  TranslationServer : : get_singleton ( ) - > get_tool_locale ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _notification ( int  p_what )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									switch  ( p_what )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  NOTIFICATION_LAYOUT_DIRECTION_CHANGED :  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											_update_cache ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  break ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-04 16:21:52 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  NOTIFICATION_THEME_CHANGED : 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-05 13:50:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  NOTIFICATION_TRANSLATION_CHANGED :  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-30 13:56:20 +04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											for  ( int  i  =  0 ;  i  <  tabs . size ( ) ;  + + i )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												_shape ( i ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-30 13:56:20 +04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-05-05 13:50:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  break ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										case  NOTIFICATION_RESIZED :  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											_ensure_no_over_offset ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											ensure_tab_visible ( current ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										}  break ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										case  NOTIFICATION_DRAW :  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											RID  ci  =  get_canvas_item ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Ref < StyleBox >  tab_unselected  =  get_theme_stylebox ( SNAME ( " tab_unselected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < StyleBox >  tab_selected  =  get_theme_stylebox ( SNAME ( " tab_selected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < StyleBox >  tab_disabled  =  get_theme_stylebox ( SNAME ( " tab_disabled " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Color  font_selected_color  =  get_theme_color ( SNAME ( " font_selected_color " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Color  font_unselected_color  =  get_theme_color ( SNAME ( " font_unselected_color " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Color  font_disabled_color  =  get_theme_color ( SNAME ( " font_disabled_color " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  close  =  get_theme_icon ( SNAME ( " close " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Color  font_outline_color  =  get_theme_color ( SNAME ( " font_outline_color " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  outline_size  =  get_theme_constant ( SNAME ( " outline_size " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-25 23:45:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Vector2  size  =  get_size ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											bool  rtl  =  is_layout_rtl ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  h  =  get_size ( ) . height ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											int  w  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											int  mw  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											for  ( int  i  =  0 ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												tabs . write [ i ] . ofs_cache  =  mw ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												mw  + =  get_tab_width ( i ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( tab_align  = =  ALIGN_CENTER )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												w  =  ( get_size ( ) . width  -  mw )  /  2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											}  else  if  ( tab_align  = =  ALIGN_RIGHT )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												w  =  get_size ( ) . width  -  mw ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( w  <  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												w  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  incr  =  get_theme_icon ( SNAME ( " increment " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  decr  =  get_theme_icon ( SNAME ( " decrement " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  incr_hl  =  get_theme_icon ( SNAME ( " increment_highlight " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Ref < Texture2D >  decr_hl  =  get_theme_icon ( SNAME ( " decrement_highlight " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											int  limit  =  get_size ( ) . width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  limit_minus_buttons  =  get_size ( ) . width  -  incr - > get_width ( )  -  decr - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											missing_right  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 11:14:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											for  ( int  i  =  offset ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												tabs . write [ i ] . ofs_cache  =  w ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												int  lsize  =  tabs [ i ] . size_cache ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												Ref < StyleBox >  sb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												Color  col ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( tabs [ i ] . disabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													sb  =  tab_disabled ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													col  =  font_disabled_color ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												}  else  if  ( i  = =  current )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													sb  =  tab_selected ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													col  =  font_selected_color ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													sb  =  tab_unselected ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													col  =  font_unselected_color ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												int  new_width  =  w  +  lsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( new_width  >  limit  | |  ( i  <  tabs . size ( )  -  1  & &  new_width  >  limit_minus_buttons ) )  {  // For the last tab, we accept if the tab covers the buttons.
 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													max_drawn_tab  =  i  -  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													missing_right  =  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													max_drawn_tab  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Rect2  sb_rect ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( rtl )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													sb_rect  =  Rect2 ( size . width  -  w  -  tabs [ i ] . size_cache ,  0 ,  tabs [ i ] . size_cache ,  h ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													sb_rect  =  Rect2 ( w ,  0 ,  tabs [ i ] . size_cache ,  h ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 15:27:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												sb - > draw ( ci ,  sb_rect ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												w  + =  sb - > get_margin ( SIDE_LEFT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 15:27:58 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Size2i  sb_ms  =  sb - > get_minimum_size ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Ref < Texture2D >  icon  =  tabs [ i ] . icon ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												if  ( icon . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( rtl )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														icon - > draw ( ci ,  Point2i ( size . width  -  w  -  icon - > get_width ( ) ,  sb - > get_margin ( SIDE_TOP )  +  ( ( sb_rect . size . y  -  sb_ms . y )  -  icon - > get_height ( ) )  /  2 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														icon - > draw ( ci ,  Point2i ( w ,  sb - > get_margin ( SIDE_TOP )  +  ( ( sb_rect . size . y  -  sb_ms . y )  -  icon - > get_height ( ) )  /  2 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( tabs [ i ] . text  ! =  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														w  + =  icon - > get_width ( )  +  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( rtl )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-25 23:45:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Vector2  text_pos  =  Point2i ( size . width  -  w  -  tabs [ i ] . text_buf - > get_size ( ) . x ,  sb - > get_margin ( SIDE_TOP )  +  ( ( sb_rect . size . y  -  sb_ms . y )  -  tabs [ i ] . text_buf - > get_size ( ) . y )  /  2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( outline_size  >  0  & &  font_outline_color . a  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														tabs [ i ] . text_buf - > draw_outline ( ci ,  text_pos ,  outline_size ,  font_outline_color ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													tabs [ i ] . text_buf - > draw ( ci ,  text_pos ,  col ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-25 23:45:28 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Vector2  text_pos  =  Point2i ( w ,  sb - > get_margin ( SIDE_TOP )  +  ( ( sb_rect . size . y  -  sb_ms . y )  -  tabs [ i ] . text_buf - > get_size ( ) . y )  /  2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( outline_size  >  0  & &  font_outline_color . a  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														tabs [ i ] . text_buf - > draw_outline ( ci ,  text_pos ,  outline_size ,  font_outline_color ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													tabs [ i ] . text_buf - > draw ( ci ,  text_pos ,  col ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												w  + =  tabs [ i ] . size_text ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( tabs [ i ] . right_button . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Ref < StyleBox >  style  =  get_theme_stylebox ( SNAME ( " close_bg_highlight " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Ref < Texture2D >  rb  =  tabs [ i ] . right_button ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													w  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													Rect2  rb_rect ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													rb_rect . size  =  style - > get_minimum_size ( )  +  rb - > get_size ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( rtl )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														rb_rect . position . x  =  size . width  -  w  -  rb_rect . size . x ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														rb_rect . position . x  =  w ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													rb_rect . position . y  =  sb - > get_margin ( SIDE_TOP )  +  ( ( sb_rect . size . y  -  sb_ms . y )  -  ( rb_rect . size . y ) )  /  2 ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( rb_hover  = =  i )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														if  ( rb_pressing )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															get_theme_stylebox ( SNAME ( " button_pressed " ) ) - > draw ( ci ,  rb_rect ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															style - > draw ( ci ,  rb_rect ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( rtl )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														rb - > draw ( ci ,  Point2i ( size . width  -  w  -  rb_rect . size . x  +  style - > get_margin ( SIDE_LEFT ) ,  rb_rect . position . y  +  style - > get_margin ( SIDE_TOP ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														rb - > draw ( ci ,  Point2i ( w  +  style - > get_margin ( SIDE_LEFT ) ,  rb_rect . position . y  +  style - > get_margin ( SIDE_TOP ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													w  + =  rb - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													tabs . write [ i ] . rb_rect  =  rb_rect ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ALWAYS  | |  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ACTIVE_ONLY  & &  i  = =  current ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Ref < StyleBox >  style  =  get_theme_stylebox ( SNAME ( " close_bg_highlight " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Ref < Texture2D >  cb  =  close ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													w  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Rect2  cb_rect ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													cb_rect . size  =  style - > get_minimum_size ( )  +  cb - > get_size ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( rtl )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														cb_rect . position . x  =  size . width  -  w  -  cb_rect . size . x ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														cb_rect . position . x  =  w ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													cb_rect . position . y  =  sb - > get_margin ( SIDE_TOP )  +  ( ( sb_rect . size . y  -  sb_ms . y )  -  ( cb_rect . size . y ) )  /  2 ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( ! tabs [ i ] . disabled  & &  cb_hover  = =  i )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														if  ( cb_pressing )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															get_theme_stylebox ( SNAME ( " close_bg_pressed " ) ) - > draw ( ci ,  cb_rect ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															style - > draw ( ci ,  cb_rect ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( rtl )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														cb - > draw ( ci ,  Point2i ( size . width  -  w  -  cb_rect . size . x  +  style - > get_margin ( SIDE_LEFT ) ,  cb_rect . position . y  +  style - > get_margin ( SIDE_TOP ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														cb - > draw ( ci ,  Point2i ( w  +  style - > get_margin ( SIDE_LEFT ) ,  cb_rect . position . y  +  style - > get_margin ( SIDE_TOP ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													w  + =  cb - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													tabs . write [ i ] . cb_rect  =  cb_rect ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												w  + =  sb - > get_margin ( SIDE_RIGHT ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( offset  >  0  | |  missing_right )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  vofs  =  ( get_size ( ) . height  -  incr - > get_size ( ) . height )  /  2 ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( rtl )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( missing_right )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														draw_texture ( highlight_arrow  = =  1  ?  decr_hl  :  decr ,  Point2 ( 0 ,  vofs ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														draw_texture ( decr ,  Point2 ( 0 ,  vofs ) ,  Color ( 1 ,  1 ,  1 ,  0.5 ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( offset  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														draw_texture ( highlight_arrow  = =  0  ?  incr_hl  :  incr ,  Point2 ( incr - > get_size ( ) . width ,  vofs ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														draw_texture ( incr ,  Point2 ( incr - > get_size ( ) . width ,  vofs ) ,  Color ( 1 ,  1 ,  1 ,  0.5 ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													if  ( offset  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														draw_texture ( highlight_arrow  = =  0  ?  decr_hl  :  decr ,  Point2 ( limit_minus_buttons ,  vofs ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														draw_texture ( decr ,  Point2 ( limit_minus_buttons ,  vofs ) ,  Color ( 1 ,  1 ,  1 ,  0.5 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if  ( missing_right )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														draw_texture ( highlight_arrow  = =  1  ?  incr_hl  :  incr ,  Point2 ( limit_minus_buttons  +  decr - > get_size ( ) . width ,  vofs ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														draw_texture ( incr ,  Point2 ( limit_minus_buttons  +  decr - > get_size ( ) . width ,  vofs ) ,  Color ( 1 ,  1 ,  1 ,  0.5 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												buttons_visible  =  true ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												buttons_visible  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-12-14 10:24:28 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										}  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_tab_count ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									return  tabs . size ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_current_tab ( int  p_current )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( current  = =  p_current )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_current ,  get_tab_count ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-08 17:30:47 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									previous  =  current ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									current  =  p_current ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-05 17:56:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									emit_signal ( SNAME ( " tab_changed " ) ,  p_current ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_current_tab ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									return  current ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_previous_tab ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-08 17:30:47 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  previous ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_hovered_tab ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  hover ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_tab_offset ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  offset ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : get_offset_buttons_visible ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  buttons_visible ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_title ( int  p_tab ,  const  String  & p_title )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . text  =  p_title ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									_shape ( p_tab ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								String  TabBar : : get_tab_title ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . text ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_text_direction ( int  p_tab ,  Control : : TextDirection  p_text_direction )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ERR_FAIL_COND ( ( int ) p_text_direction  <  - 1  | |  ( int ) p_text_direction  >  3 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( tabs [ p_tab ] . text_direction  ! =  p_text_direction )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ p_tab ] . text_direction  =  p_text_direction ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										_shape ( p_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Control : : TextDirection  TabBar : : get_tab_text_direction ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  Control : : TEXT_DIRECTION_INHERITED ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . text_direction ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : clear_tab_opentype_features ( int  p_tab )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . opentype_features . clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									_shape ( p_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_opentype_feature ( int  p_tab ,  const  String  & p_name ,  int  p_value )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int32_t  tag  =  TS - > name_to_tag ( p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ! tabs [ p_tab ] . opentype_features . has ( tag )  | |  ( int ) tabs [ p_tab ] . opentype_features [ tag ]  ! =  p_value )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ p_tab ] . opentype_features [ tag ]  =  p_value ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										_shape ( p_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_tab_opentype_feature ( int  p_tab ,  const  String  & p_name )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  - 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int32_t  tag  =  TS - > name_to_tag ( p_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ! tabs [ p_tab ] . opentype_features . has ( tag ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . opentype_features [ tag ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_language ( int  p_tab ,  const  String  & p_language )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( tabs [ p_tab ] . language  ! =  p_language )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ p_tab ] . language  =  p_language ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										_shape ( p_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								String  TabBar : : get_tab_language ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . language ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_icon ( int  p_tab ,  const  Ref < Texture2D >  & p_icon )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . icon  =  p_icon ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Ref < Texture2D >  TabBar : : get_tab_icon ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  Ref < Texture2D > ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . icon ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_disabled ( int  p_tab ,  bool  p_disabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . disabled  =  p_disabled ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 14:29:06 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : get_tab_disabled ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  false ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . disabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_right_button ( int  p_tab ,  const  Ref < Texture2D >  & p_right_button )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_tab ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . write [ p_tab ] . right_button  =  p_right_button ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 14:29:06 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Ref < Texture2D >  TabBar : : get_tab_right_button ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  Ref < Texture2D > ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-07-26 10:44:10 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  tabs [ p_tab ] . right_button ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _update_hover ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-21 14:57:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! is_inside_tree ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									const  Point2  & pos  =  get_local_mouse_position ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									// test hovering to display right or close button
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  hover_now  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  hover_buttons  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 11:14:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for  ( int  i  =  offset ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-21 14:57:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Rect2  rect  =  get_tab_rect ( i ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( rect . has_point ( pos ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hover_now  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( tabs [ i ] . rb_rect . has_point ( pos ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											rb_hover  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											cb_hover  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hover_buttons  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  if  ( ! tabs [ i ] . disabled  & &  tabs [ i ] . cb_rect . has_point ( pos ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											cb_hover  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											rb_hover  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hover_buttons  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( hover  ! =  hover_now )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										hover  =  hover_now ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										emit_signal ( SNAME ( " tab_hovered " ) ,  hover ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-10-21 14:57:55 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( hover_buttons  = =  - 1 )  {  // no hover
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										rb_hover  =  hover_buttons ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										cb_hover  =  hover_buttons ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _update_cache ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_disabled  =  get_theme_stylebox ( SNAME ( " tab_disabled " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_unselected  =  get_theme_stylebox ( SNAME ( " tab_unselected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_selected  =  get_theme_stylebox ( SNAME ( " tab_selected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  incr  =  get_theme_icon ( SNAME ( " increment " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  decr  =  get_theme_icon ( SNAME ( " decrement " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  limit_minus_buttons  =  get_size ( ) . width  -  incr - > get_width ( )  -  decr - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  w  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  mw  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  size_fixed  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  count_resize  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( int  i  =  0 ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . ofs_cache  =  mw ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . size_cache  =  get_tab_width ( i ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . size_text  =  Math : : ceil ( tabs [ i ] . text_buf - > get_size ( ) . x ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . text_buf - > set_width ( - 1 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										mw  + =  tabs [ i ] . size_cache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( tabs [ i ] . size_cache  < =  min_width  | |  i  = =  current )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											size_fixed  + =  tabs [ i ] . size_cache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											count_resize + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  m_width  =  min_width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( count_resize  >  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										m_width  =  MAX ( ( limit_minus_buttons  -  size_fixed )  /  count_resize ,  min_width ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 11:14:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for  ( int  i  =  offset ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Ref < StyleBox >  sb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( tabs [ i ] . disabled )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											sb  =  tab_disabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  if  ( i  = =  current )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											sb  =  tab_selected ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											sb  =  tab_unselected ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  lsize  =  tabs [ i ] . size_cache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  slen  =  tabs [ i ] . size_text ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( min_width  >  0  & &  mw  >  limit_minus_buttons  & &  i  ! =  current )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( lsize  >  m_width )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-22 16:24:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												slen  =  m_width  -  ( sb - > get_margin ( SIDE_LEFT )  +  sb - > get_margin ( SIDE_RIGHT ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( tabs [ i ] . icon . is_valid ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													slen  - =  tabs [ i ] . icon - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													slen  - =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ALWAYS  | |  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ACTIVE_ONLY  & &  i  = =  current ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													Ref < Texture2D >  cb  =  get_theme_icon ( SNAME ( " close " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													slen  - =  cb - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													slen  - =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												slen  =  MAX ( slen ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												lsize  =  m_width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2018-07-25 03:11:03 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . ofs_cache  =  w ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . size_cache  =  lsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . size_text  =  slen ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										tabs . write [ i ] . text_buf - > set_width ( slen ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										w  + =  lsize ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _on_mouse_exited ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-22 23:07:00 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									rb_hover  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									cb_hover  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									hover  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									highlight_arrow  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : add_tab ( const  String  & p_str ,  const  Ref < Texture2D >  & p_icon )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									Tab  t ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . text  =  p_str ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-05-27 14:31:33 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . xl_text  =  atr ( p_str ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-06-17 16:03:09 -06:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . text_buf . instantiate ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . text_buf - > set_direction ( is_layout_rtl ( )  ?  TextServer : : DIRECTION_RTL  :  TextServer : : DIRECTION_LTR ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . text_buf - > add_string ( t . xl_text ,  get_theme_font ( SNAME ( " font " ) ) ,  get_theme_font_size ( SNAME ( " font_size " ) ) ,  Dictionary ( ) ,  TranslationServer : : get_singleton ( ) - > get_tool_locale ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . icon  =  p_icon ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . disabled  =  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									t . ofs_cache  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									t . size_cache  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									tabs . push_back ( t ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									call_deferred ( SNAME ( " _update_hover " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : clear_tabs ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs . clear ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									current  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-08 17:30:47 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									previous  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									call_deferred ( SNAME ( " _update_hover " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : remove_tab ( int  p_idx )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_idx ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									tabs . remove ( p_idx ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( current  > =  p_idx )  { 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										current - - ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									_update_cache ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									call_deferred ( SNAME ( " _update_hover " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( current  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										current  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-08 17:30:47 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										previous  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( current  > =  tabs . size ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										current  =  tabs . size ( )  -  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									_ensure_no_over_offset ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Variant  TabBar : : get_drag_data ( const  Point2  & p_point )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! drag_to_rearrange_enabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  Variant ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  tab_over  =  get_tab_idx_at_point ( p_point ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( tab_over  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  Variant ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									HBoxContainer  * drag_preview  =  memnew ( HBoxContainer ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ! tabs [ tab_over ] . icon . is_null ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										TextureRect  * tf  =  memnew ( TextureRect ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tf - > set_texture ( tabs [ tab_over ] . icon ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										drag_preview - > add_child ( tf ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-30 13:56:20 +04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Label  * label  =  memnew ( Label ( tabs [ tab_over ] . xl_text ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									drag_preview - > add_child ( label ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ! tabs [ tab_over ] . right_button . is_null ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										TextureRect  * tf  =  memnew ( TextureRect ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										tf - > set_texture ( tabs [ tab_over ] . right_button ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										drag_preview - > add_child ( tf ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									set_drag_preview ( drag_preview ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Dictionary  drag_data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									drag_data [ " type " ]  =  " tab_element " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									drag_data [ " tab_element " ]  =  tab_over ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									drag_data [ " from_path " ]  =  get_path ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  drag_data ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-05 15:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : can_drop_data ( const  Point2  & p_point ,  const  Variant  & p_data )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! drag_to_rearrange_enabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Dictionary  d  =  p_data ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! d . has ( " type " ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( String ( d [ " type " ] )  = =  " tab_element " )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										NodePath  from_path  =  d [ " from_path " ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										NodePath  to_path  =  get_path ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( from_path  = =  to_path )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  if  ( get_tabs_rearrange_group ( )  ! =  - 1 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											// drag and drop between other TabBars
 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											Node  * from_node  =  get_node ( from_path ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											TabBar  * from_tabs  =  Object : : cast_to < TabBar > ( from_node ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( from_tabs  & &  from_tabs - > get_tabs_rearrange_group ( )  = =  get_tabs_rearrange_group ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												return  true ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  false ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-05 15:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : drop_data ( const  Point2  & p_point ,  const  Variant  & p_data )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! drag_to_rearrange_enabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-07-05 15:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  hover_now  =  get_tab_idx_at_point ( p_point ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Dictionary  d  =  p_data ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! d . has ( " type " ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( String ( d [ " type " ] )  = =  " tab_element " )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  tab_from_id  =  d [ " tab_element " ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										NodePath  from_path  =  d [ " from_path " ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										NodePath  to_path  =  get_path ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( from_path  = =  to_path )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( hover_now  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												hover_now  =  get_tab_count ( )  -  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											move_tab ( tab_from_id ,  hover_now ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											emit_signal ( SNAME ( " active_tab_rearranged " ) ,  hover_now ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											set_current_tab ( hover_now ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  if  ( get_tabs_rearrange_group ( )  ! =  - 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											// drag and drop between Tabs
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Node  * from_node  =  get_node ( from_path ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											TabBar  * from_tabs  =  Object : : cast_to < TabBar > ( from_node ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( from_tabs  & &  from_tabs - > get_tabs_rearrange_group ( )  = =  get_tabs_rearrange_group ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( tab_from_id  > =  from_tabs - > get_tab_count ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												Tab  moving_tab  =  from_tabs - > tabs [ tab_from_id ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if  ( hover_now  <  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													hover_now  =  get_tab_count ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												tabs . insert ( hover_now ,  moving_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												from_tabs - > remove_tab ( tab_from_id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												set_current_tab ( hover_now ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												emit_signal ( SNAME ( " tab_changed " ) ,  hover_now ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												_update_cache ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-05 15:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_tab_idx_at_point ( const  Point2  & p_point )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-05 15:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  hover_now  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-07 22:38:04 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for  ( int  i  =  offset ;  i  < =  max_drawn_tab ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-05 15:44:53 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Rect2  rect  =  get_tab_rect ( i ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( rect . has_point ( p_point ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											hover_now  =  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  hover_now ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_align ( TabAlign  p_align )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-22 23:15:31 +07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_align ,  ALIGN_MAX ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tab_align  =  p_align ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								TabBar : : TabAlign  TabBar : : get_tab_align ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-22 00:03:19 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  tab_align ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_clip_tabs ( bool  p_clip_tabs )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( clip_tabs  = =  p_clip_tabs )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									clip_tabs  =  p_clip_tabs ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									minimum_size_changed ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : get_clip_tabs ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  clip_tabs ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : move_tab ( int  from ,  int  to )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( from  = =  to )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-12 16:48:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-12 16:48:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( from ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( to ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Tab  tab_from  =  tabs [ from ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tabs . remove ( from ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tabs . insert ( to ,  tab_from ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									_update_cache ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_tab_width ( int  p_idx )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_idx ,  tabs . size ( ) ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_unselected  =  get_theme_stylebox ( SNAME ( " tab_unselected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_selected  =  get_theme_stylebox ( SNAME ( " tab_selected " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < StyleBox >  tab_disabled  =  get_theme_stylebox ( SNAME ( " tab_disabled " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  x  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  tex  =  tabs [ p_idx ] . icon ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( tex . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  tex - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( tabs [ p_idx ] . text  ! =  " " )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											x  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									x  + =  Math : : ceil ( tabs [ p_idx ] . text_buf - > get_size ( ) . x ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-05-01 16:27:33 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( tabs [ p_idx ] . disabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-02-27 19:07:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  tab_disabled - > get_minimum_size ( ) . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									}  else  if  ( current  = =  p_idx )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  tab_selected - > get_minimum_size ( ) . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 13:11:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  tab_unselected - > get_minimum_size ( ) . width ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( tabs [ p_idx ] . right_button . is_valid ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-11 15:43:37 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Ref < Texture2D >  rb  =  tabs [ p_idx ] . right_button ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  rb - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ALWAYS  | |  ( cb_displaypolicy  = =  CLOSE_BUTTON_SHOW_ACTIVE_ONLY  & &  p_idx  = =  current ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										Ref < Texture2D >  cb  =  get_theme_icon ( SNAME ( " close " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  cb - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										x  + =  get_theme_constant ( SNAME ( " hseparation " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  x ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _ensure_no_over_offset ( )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! is_inside_tree ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  incr  =  get_theme_icon ( SNAME ( " increment " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  decr  =  get_theme_icon ( SNAME ( " decrement " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  limit  =  get_size ( ) . width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  limit_minus_buttons  =  get_size ( ) . width  -  incr - > get_width ( )  -  decr - > get_width ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									while  ( offset  >  0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  total_w  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-04-08 11:14:46 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										for  ( int  i  =  offset  -  1 ;  i  <  tabs . size ( ) ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											total_w  + =  tabs [ i ] . size_cache ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( ( buttons_visible  & &  total_w  <  limit_minus_buttons )  | |  total_w  <  limit )  {  // For the last tab, we accept if the tab covers the buttons.
 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-22 20:19:57 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											offset - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : ensure_tab_visible ( int  p_idx )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! is_inside_tree ( ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( tabs . size ( )  = =  0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-10 12:56:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 16:41:43 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_idx ,  tabs . size ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( p_idx  = =  offset )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( p_idx  <  offset )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										offset  =  p_idx ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  prev_offset  =  offset ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-07-17 18:22:52 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  incr  =  get_theme_icon ( SNAME ( " increment " ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Ref < Texture2D >  decr  =  get_theme_icon ( SNAME ( " decrement " ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  limit  =  get_size ( ) . width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  limit_minus_buttons  =  get_size ( ) . width  -  incr - > get_width ( )  -  decr - > get_width ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									for  ( int  i  =  offset ;  i  < =  p_idx ;  i + + )  { 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										int  total_w  =  tabs [ i ] . ofs_cache  +  tabs [ i ] . size_cache ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( total_w  >  limit  | |  ( buttons_visible  & &  total_w  >  limit_minus_buttons ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											offset + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( prev_offset  ! =  offset )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										update ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								Rect2  TabBar : : get_tab_rect ( int  p_tab )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-21 11:34:32 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX_V ( p_tab ,  tabs . size ( ) ,  Rect2 ( ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-03 14:22:16 +03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( is_layout_rtl ( ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  Rect2 ( get_size ( ) . width  -  tabs [ p_tab ] . ofs_cache  -  tabs [ p_tab ] . size_cache ,  0 ,  tabs [ p_tab ] . size_cache ,  get_size ( ) . height ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return  Rect2 ( tabs [ p_tab ] . ofs_cache ,  0 ,  tabs [ p_tab ] . size_cache ,  get_size ( ) . height ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-10 21:45:11 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tab_close_display_policy ( CloseButtonDisplayPolicy  p_policy )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-22 23:15:31 +07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ERR_FAIL_INDEX ( p_policy ,  CLOSE_BUTTON_MAX ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									cb_displaypolicy  =  p_policy ; 
							 
						 
					
						
							
								
									
										
										
										
											2016-01-13 07:39:31 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									update ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								TabBar : : CloseButtonDisplayPolicy  TabBar : : get_tab_close_display_policy ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-07-22 23:15:31 +07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  cb_displaypolicy ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_min_width ( int  p_width )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-06-16 00:30:03 +09:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									min_width  =  p_width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_scrolling_enabled ( bool  p_enabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									scrolling_enabled  =  p_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : get_scrolling_enabled ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  scrolling_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_drag_to_rearrange_enabled ( bool  p_enabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									drag_to_rearrange_enabled  =  p_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : get_drag_to_rearrange_enabled ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  drag_to_rearrange_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2020-05-14 14:29:06 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_tabs_rearrange_group ( int  p_group_id )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									tabs_rearrange_group  =  p_group_id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								int  TabBar : : get_tabs_rearrange_group ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  tabs_rearrange_group ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : set_select_with_rmb ( bool  p_enabled )  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 02:10:49 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									select_with_rmb  =  p_enabled ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bool  TabBar : : get_select_with_rmb ( )  const  { 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 02:10:49 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									return  select_with_rmb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  TabBar : : _bind_methods ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " _update_hover " ) ,  & TabBar : : _update_hover ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_count " ) ,  & TabBar : : get_tab_count ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_current_tab " ,  " tab_idx " ) ,  & TabBar : : set_current_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_current_tab " ) ,  & TabBar : : get_current_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_previous_tab " ) ,  & TabBar : : get_previous_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_title " ,  " tab_idx " ,  " title " ) ,  & TabBar : : set_tab_title ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_title " ,  " tab_idx " ) ,  & TabBar : : get_tab_title ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_text_direction " ,  " tab_idx " ,  " direction " ) ,  & TabBar : : set_tab_text_direction ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_text_direction " ,  " tab_idx " ) ,  & TabBar : : get_tab_text_direction ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_opentype_feature " ,  " tab_idx " ,  " tag " ,  " values " ) ,  & TabBar : : set_tab_opentype_feature ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_opentype_feature " ,  " tab_idx " ,  " tag " ) ,  & TabBar : : get_tab_opentype_feature ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " clear_tab_opentype_features " ,  " tab_idx " ) ,  & TabBar : : clear_tab_opentype_features ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_language " ,  " tab_idx " ,  " language " ) ,  & TabBar : : set_tab_language ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_language " ,  " tab_idx " ) ,  & TabBar : : get_tab_language ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_icon " ,  " tab_idx " ,  " icon " ) ,  & TabBar : : set_tab_icon ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_icon " ,  " tab_idx " ) ,  & TabBar : : get_tab_icon ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_disabled " ,  " tab_idx " ,  " disabled " ) ,  & TabBar : : set_tab_disabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_disabled " ,  " tab_idx " ) ,  & TabBar : : get_tab_disabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " remove_tab " ,  " tab_idx " ) ,  & TabBar : : remove_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " add_tab " ,  " title " ,  " icon " ) ,  & TabBar : : add_tab ,  DEFVAL ( " " ) ,  DEFVAL ( Ref < Texture2D > ( ) ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_align " ,  " align " ) ,  & TabBar : : set_tab_align ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_align " ) ,  & TabBar : : get_tab_align ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_clip_tabs " ,  " clip_tabs " ) ,  & TabBar : : set_clip_tabs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_clip_tabs " ) ,  & TabBar : : get_clip_tabs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_offset " ) ,  & TabBar : : get_tab_offset ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_offset_buttons_visible " ) ,  & TabBar : : get_offset_buttons_visible ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " ensure_tab_visible " ,  " idx " ) ,  & TabBar : : ensure_tab_visible ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_rect " ,  " tab_idx " ) ,  & TabBar : : get_tab_rect ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " move_tab " ,  " from " ,  " to " ) ,  & TabBar : : move_tab ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tab_close_display_policy " ,  " policy " ) ,  & TabBar : : set_tab_close_display_policy ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tab_close_display_policy " ) ,  & TabBar : : get_tab_close_display_policy ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_scrolling_enabled " ,  " enabled " ) ,  & TabBar : : set_scrolling_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_scrolling_enabled " ) ,  & TabBar : : get_scrolling_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_drag_to_rearrange_enabled " ,  " enabled " ) ,  & TabBar : : set_drag_to_rearrange_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_drag_to_rearrange_enabled " ) ,  & TabBar : : get_drag_to_rearrange_enabled ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_tabs_rearrange_group " ,  " group_id " ) ,  & TabBar : : set_tabs_rearrange_group ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_tabs_rearrange_group " ) ,  & TabBar : : get_tabs_rearrange_group ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " set_select_with_rmb " ,  " enabled " ) ,  & TabBar : : set_select_with_rmb ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ClassDB : : bind_method ( D_METHOD ( " get_select_with_rmb " ) ,  & TabBar : : get_select_with_rmb ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-02 02:10:49 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_SIGNAL ( MethodInfo ( " tab_changed " ,  PropertyInfo ( Variant : : INT ,  " tab " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_SIGNAL ( MethodInfo ( " tab_rmb_clicked " ,  PropertyInfo ( Variant : : INT ,  " tab " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-10-27 19:39:13 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_SIGNAL ( MethodInfo ( " tab_close_pressed " ,  PropertyInfo ( Variant : : INT ,  " tab " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2020-12-08 09:51:06 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_SIGNAL ( MethodInfo ( " tab_hovered " ,  PropertyInfo ( Variant : : INT ,  " tab " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-09-30 20:18:23 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_SIGNAL ( MethodInfo ( " active_tab_rearranged " ,  PropertyInfo ( Variant : : INT ,  " idx_to " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-09 09:41:26 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_SIGNAL ( MethodInfo ( " tab_clicked " ,  PropertyInfo ( Variant : : INT ,  " tab " ) ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-03-05 16:44:50 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_PROPERTY ( PropertyInfo ( Variant : : INT ,  " current_tab " ,  PROPERTY_HINT_RANGE ,  " -1,4096,1 " ,  PROPERTY_USAGE_EDITOR ) ,  " set_current_tab " ,  " get_current_tab " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-01-12 00:35:12 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_PROPERTY ( PropertyInfo ( Variant : : INT ,  " tab_align " ,  PROPERTY_HINT_ENUM ,  " Left,Center,Right " ) ,  " set_tab_align " ,  " get_tab_align " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2021-03-30 12:20:00 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_PROPERTY ( PropertyInfo ( Variant : : BOOL ,  " clip_tabs " ) ,  " set_clip_tabs " ,  " get_clip_tabs " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-11-08 11:30:02 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_PROPERTY ( PropertyInfo ( Variant : : INT ,  " tab_close_display_policy " ,  PROPERTY_HINT_ENUM ,  " Show Never,Show Active Only,Show Always " ) ,  " set_tab_close_display_policy " ,  " get_tab_close_display_policy " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-11-16 17:57:57 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_PROPERTY ( PropertyInfo ( Variant : : BOOL ,  " scrolling_enabled " ) ,  " set_scrolling_enabled " ,  " get_scrolling_enabled " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2018-02-07 08:01:45 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ADD_PROPERTY ( PropertyInfo ( Variant : : BOOL ,  " drag_to_rearrange_enabled " ) ,  " set_drag_to_rearrange_enabled " ,  " get_drag_to_rearrange_enabled " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2015-08-18 20:27:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-08-20 17:45:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( ALIGN_LEFT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( ALIGN_CENTER ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( ALIGN_RIGHT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( ALIGN_MAX ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-10-22 01:58:02 +07:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( CLOSE_BUTTON_SHOW_NEVER ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2017-08-20 17:45:01 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( CLOSE_BUTTON_SHOW_ACTIVE_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( CLOSE_BUTTON_SHOW_ALWAYS ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIND_ENUM_CONSTANT ( CLOSE_BUTTON_MAX ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2021-10-17 13:55:44 -03:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								TabBar : : TabBar ( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									connect ( " mouse_exited " ,  callable_mp ( this ,  & TabBar : : _on_mouse_exited ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2014-02-09 22:10:30 -03:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								}