@@ -46,6 +46,13 @@ public struct ListLabel
4646 }
4747 public List < ListLabel > labels = new List < ListLabel > ( ) ;
4848
49+ List < string > tokens = new List < string > ( )
50+ {
51+ Viewer . Catalog . GetString ( "BP" ) ,
52+ Viewer . Catalog . GetString ( "EQ" ) ,
53+ Viewer . Catalog . GetString ( "V" )
54+ } ;
55+
4956 /// <summary>
5057 /// Table of Colors to client-side color codes.
5158 /// </summary>
@@ -266,7 +273,7 @@ protected internal override void Initialize()
266273 {
267274 base . Initialize ( ) ;
268275 // Reset window size
269- UpdateWindowSize ( ) ;
276+ if ( Visible ) UpdateWindowSize ( ) ;
270277 }
271278
272279 protected override ControlLayout Layout ( ControlLayout layout )
@@ -276,6 +283,16 @@ protected override ControlLayout Layout(ControlLayout layout)
276283 {
277284 var colWidth = labels . Max ( x => x . FirstColWidth ) + ( normalTextMode ? 15 : 20 ) ;
278285 var TimeHboxPositionY = 0 ;
286+
287+ // search wider
288+ var tokenOffset = 0 ;
289+ var tokenWidth = 0 ;
290+ foreach ( var data in tokens . Where ( ( string d ) => ! string . IsNullOrWhiteSpace ( d ) ) )
291+ {
292+ tokenWidth = Owner . TextFontDefault . MeasureString ( data ) ;
293+ tokenOffset = tokenWidth > tokenOffset ? tokenWidth : tokenOffset ;
294+ }
295+
279296 foreach ( var data in labels . ToList ( ) )
280297 {
281298 if ( data . FirstCol . Contains ( "NwLn" ) )
@@ -368,7 +385,16 @@ protected override ControlLayout Layout(ControlLayout layout)
368385 }
369386 else
370387 {
371- hbox . Add ( indicator = new Label ( colWidth , hbox . RemainingHeight , LastCol ) ) ;
388+ var iniLastCol = Viewer . Catalog . GetString ( LastCol ) . IndexOf ( " " ) ;
389+ if ( tokens . Any ( LastCol . Contains ) && iniLastCol >= 0 )
390+ {
391+ hbox . Add ( indicator = new Label ( tokenOffset + ( normalTextMode ? 5 : 3 ) , hbox . RemainingHeight , LastCol . Substring ( 0 , iniLastCol ) ) ) ;
392+ hbox . Add ( indicator = new Label ( colWidth , hbox . RemainingHeight , LastCol . Substring ( iniLastCol , Viewer . Catalog . GetString ( LastCol ) . Length - iniLastCol ) . TrimStart ( ) ) ) ;
393+ }
394+ else
395+ {
396+ hbox . Add ( indicator = new Label ( colWidth , hbox . RemainingHeight , LastCol ) ) ;
397+ }
372398 indicator . Color = Color . White ; // Default color
373399 }
374400 }
@@ -839,7 +865,6 @@ void AddSeparator() => AddLabel(new ListLabel
839865 index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "BC" ) ) ;
840866
841867 brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . Length - index ) . TrimEnd ( ) ;
842- brakeInfoValue = brakeInfoValue . StartsWith ( Viewer . Catalog . GetString ( "V" ) ) ? brakeInfoValue . Replace ( Viewer . Catalog . GetString ( "V" ) , Viewer . Catalog . GetString ( "V" ) + " " ) : brakeInfoValue ;
843868 AddLabel ( new ListLabel
844869 {
845870 LastCol = brakeInfoValue ,
0 commit comments