2121import  com .lukflug .panelstudio .setting .IEnumSetting ;
2222import  com .lukflug .panelstudio .setting .ILabeled ;
2323import  com .lukflug .panelstudio .setting .ISetting ;
24+ import  com .lukflug .panelstudio .setting .Labeled ;
2425import  com .lukflug .panelstudio .theme .ITheme ;
2526import  com .lukflug .panelstudio .theme .ThemeTuple ;
2627import  com .lukflug .panelstudio .widget .Button ;
@@ -33,16 +34,18 @@ public class CSGOLayout implements ILayout,IScrollSize {
3334	protected  Point  position ;
3435	protected  int  width ;
3536	protected  Supplier <Animation > animation ;
37+ 	protected  String  enabledButton ;
3638	protected  boolean  horizontal ,moduleColumn ;
3739	protected  int  weight ;
3840	protected  ChildMode  colorType ;
3941	protected  ChildUtil  util ;
4042
41- 	public  CSGOLayout  (ILabeled  label , Point  position , int  width , int  popupWidth , Supplier <Animation > animation , boolean  horizontal , boolean  moduleColumn , int  weight , ChildMode  colorType , PopupTuple  popupType ) {
43+ 	public  CSGOLayout  (ILabeled  label , Point  position , int  width , int  popupWidth , Supplier <Animation > animation , String   enabledButton ,  boolean  horizontal , boolean  moduleColumn , int  weight , ChildMode  colorType , PopupTuple  popupType ) {
4244		this .label =label ;
4345		this .position =position ;
4446		this .width =width ;
4547		this .animation =animation ;
48+ 		this .enabledButton =enabledButton ;
4649		this .horizontal =horizontal ;
4750		this .moduleColumn =moduleColumn ;
4851		this .weight =weight ;
@@ -53,7 +56,7 @@ public CSGOLayout (ILabeled label, Point position, int width, int popupWidth, Su
5356	@ Override 
5457	public  void  populateGUI  (IComponentAdder  gui , IComponentGenerator  components , IClient  client , ITheme  theme ) {
5558		Button  title =new  Button (label ,theme .getButtonRenderer (Void .class ,0 ,0 ,true ));
56- 		HorizontalContainer  window =new  HorizontalContainer (label ,theme .getContainerRenderer (0 ,0 ,true ));
59+ 		HorizontalContainer  window =new  HorizontalContainer (label ,theme .getContainerRenderer (0 ,horizontal ? 1 : 0 ,true ));
5760		IEnumSetting  catSelect ;
5861		if  (horizontal ) {
5962			VerticalContainer  container =new  VerticalContainer (label ,theme .getContainerRenderer (0 ,0 ,false ));
@@ -66,10 +69,11 @@ public void populateGUI (IComponentAdder gui, IComponentGenerator components, IC
6669		}
6770		client .getCategories ().forEach (category ->{
6871			if  (moduleColumn ) {
69- 				IEnumSetting  modSelect =addContainer (category ,category .getModules ().map (mod ->mod ),window ,new  ThemeTuple (theme ,1 ,1 ),false ,button ->wrapColumn (button ,new  ThemeTuple (theme ,1 ,1 ),1 ),()->catSelect .getValueName ()==category .getDisplayName ());
72+ 				IEnumSetting  modSelect =addContainer (category ,category .getModules ().map (mod ->mod ),window ,new  ThemeTuple (theme ,1 ,1 ),false ,button ->wrapColumn (button ,new  ThemeTuple (theme ,0 ,1 ),1 ),()->catSelect .getValueName ()==category .getDisplayName ());
7073				category .getModules ().forEach (module ->{
7174					VerticalContainer  container =new  VerticalContainer (module ,theme .getContainerRenderer (1 ,1 ,false ));
7275					window .addComponent (wrapColumn (container ,new  ThemeTuple (theme ,1 ,1 ),weight ),()->catSelect .getValueName ()==category .getDisplayName ()&&modSelect .getValueName ()==module .getDisplayName ());
76+ 					if  (module .isEnabled ()!=null ) container .addComponent (new  ToggleButton (new  Labeled (enabledButton ,null ,()->true ),module .isEnabled (),theme .getButtonRenderer (Boolean .class ,1 ,2 ,false )));
7377					module .getSettings ().forEach (setting ->addSettingsComponent (setting ,container ,gui ,components ,new  ThemeTuple (theme ,2 ,2 )));
7478				});
7579			} else  {
0 commit comments