@@ -57,6 +57,9 @@ public static string[] BasicFilters
57
57
GUIContent AddConfigButton ;
58
58
GUILayoutOption [ ] AddConfigButtonOptions ;
59
59
GUIStyle buttonStyle ;
60
+ // delete config button styles:
61
+ GUIContent deleteConfigButton ;
62
+ GUILayoutOption [ ] deleteConfigButtonOptions ;
60
63
61
64
// label styles:
62
65
GUIStyle centeredLabelStyle ;
@@ -150,6 +153,18 @@ private void SetupButtonStyles()
150
153
AddConfigButton = new GUIContent ( "Add new" , "create new config" ) ;
151
154
AddConfigButtonOptions = new GUILayoutOption [ ] { GUILayout . Width ( 65 ) } ;
152
155
}
156
+
157
+ // 'delete config' button styles
158
+ if ( deleteConfigIcon != null )
159
+ {
160
+ deleteConfigButton = new GUIContent ( deleteConfigIcon , "delete config permanently" ) ;
161
+ deleteConfigButtonOptions = new GUILayoutOption [ ] { GUILayout . Height ( 20 ) , GUILayout . Width ( 20 ) } ;
162
+ }
163
+ else
164
+ {
165
+ deleteConfigButton = new GUIContent ( "del" , "delete config permanently" ) ;
166
+ deleteConfigButtonOptions = new GUILayoutOption [ ] { GUILayout . Width ( 30 ) } ;
167
+ }
153
168
}
154
169
155
170
private void OnGUI ( )
@@ -477,25 +492,14 @@ private void PutPropertiesForObject_V<T>(List<T> Configs) where T : ScriptableOb
477
492
478
493
private void DeleteButton < T > ( T Config ) where T : ScriptableObject
479
494
{
480
- GUIContent deleteConfigButton ;
481
- GUILayoutOption [ ] deleteConfigButtonOptions ;
495
+
482
496
GUIStyle buttonStyle = new GUIStyle ( GUI . skin . button ) ;
483
497
484
498
if ( deleteConfigIcon != null )
485
499
{
486
- deleteConfigButton = new GUIContent ( deleteConfigIcon , "delete config permanently" ) ;
487
- deleteConfigButtonOptions = new GUILayoutOption [ ] { GUILayout . Height ( 20 ) , GUILayout . Width ( 20 ) } ;
488
-
489
- // Ýkon için padding'i azalt
490
500
buttonStyle . padding = new RectOffset ( 2 , 2 , 2 , 2 ) ;
491
- // Ýkonun buton içindeki boyutunu ayarla
492
501
buttonStyle . imagePosition = ImagePosition . ImageOnly ;
493
502
}
494
- else
495
- {
496
- deleteConfigButton = new GUIContent ( "del" , "delete config permanently" ) ;
497
- deleteConfigButtonOptions = new GUILayoutOption [ ] { GUILayout . Width ( 30 ) } ;
498
- }
499
503
500
504
if ( GUILayout . Button ( deleteConfigButton , buttonStyle , deleteConfigButtonOptions ) )
501
505
{
0 commit comments