@@ -190,7 +190,6 @@ public ModernChemMasterWindow()
190190 SaveCustomPerChemMaster ( ) ;
191191 OnAmountSelected ? . Invoke ( _selectedAmount ) ;
192192 } ;
193- UpdateCustomAmountCentering ( ) ;
194193
195194 ApplyLayout ( ) ;
196195
@@ -336,26 +335,14 @@ private void SyncGrid(GridContainer grid)
336335 }
337336 }
338337
339- private void UpdateCustomAmountCentering ( )
340- {
341- var t = string . IsNullOrEmpty ( CustomAmountLineEdit . Text ) ? CustomAmountLineEdit . PlaceHolder ?? "" : CustomAmountLineEdit . Text ;
342- var p = Math . Max ( 0 , ( 40 - Math . Max ( 1 , t . Length ) * 8 ) / 2 ) ;
343- var b = new StyleBoxTexture { Texture = IoCManager . Resolve < IResourceCache > ( ) . GetResource < TextureResource > ( new ResPath ( "/Textures/Interface/Nano/lineedit.png" ) ) . Texture } ;
344- b . SetPatchMargin ( StyleBox . Margin . All , 3 ) ; b . SetContentMarginOverride ( StyleBox . Margin . Left , p ) ; b . SetContentMarginOverride ( StyleBox . Margin . Right , p ) ; b . SetContentMarginOverride ( StyleBox . Margin . Vertical , 2 ) ;
345- CustomAmountLineEdit . StyleBoxOverride = b ;
346- }
347-
348338 private void SaveCustomPerChemMaster ( ) { if ( _chemMasterNetEntity is { } id ) _customPerChemMaster [ id ] = ( CustomAmountLineEdit . Text , _customAmount , _customSelected ) ; }
349339
350340 private void HandleCustomAmountTextChanged ( LineEdit source , LineEdit target , bool isModern )
351341 {
352342 if ( target . Text != source . Text )
353343 target . Text = source . Text ;
354344 if ( isModern )
355- {
356345 CustomAmountButton . Disabled = ! IsCustomAmountValid ( source . Text ) ;
357- UpdateCustomAmountCentering ( ) ;
358- }
359346 SaveCustomPerChemMaster ( ) ;
360347 UpdateClassicCustomButtons ( ) ;
361348 }
@@ -389,7 +376,6 @@ public void SetChemMasterEntity(NetEntity id)
389376 CustomAmountButton . Disabled = string . IsNullOrWhiteSpace ( s . Text ) || ( CustomAmountLineEdit ! . IsValid != null && ! CustomAmountLineEdit ! . IsValid ( s . Text ) ) ;
390377 CustomAmountButton . Pressed = _customSelected && ! CustomAmountButton . Disabled ;
391378 _customSelected = CustomAmountButton . Pressed ;
392- UpdateCustomAmountCentering ( ) ;
393379 UpdateClassicCustomButtons ( ) ;
394380 SyncGrid ( AmountGrid ) ;
395381 }
@@ -405,7 +391,6 @@ private void ApplyLayout()
405391 SetSize = targetSize ;
406392 if ( ! _classicMode )
407393 {
408- UpdateCustomAmountCentering ( ) ;
409394 CustomAmountButton . Disabled = ! IsCustomAmountValid ( CustomAmountLineEdit . Text ) ;
410395 }
411396 else
0 commit comments