@@ -45,6 +45,13 @@ public struct ListLabel
4545 }
4646 public List < ListLabel > labels = new List < ListLabel > ( ) ;
4747
48+ List < string > tokens = new List < string > ( )
49+ {
50+ Viewer . Catalog . GetString ( "BP" ) ,
51+ Viewer . Catalog . GetString ( "EQ" ) ,
52+ Viewer . Catalog . GetString ( "V" )
53+ } ;
54+
4855 /// <summary>
4956 /// Table of Colors to client-side color codes.
5057 /// </summary>
@@ -265,7 +272,7 @@ protected internal override void Initialize()
265272 {
266273 base . Initialize ( ) ;
267274 // Reset window size
268- UpdateWindowSize ( ) ;
275+ if ( Visible ) UpdateWindowSize ( ) ;
269276 }
270277
271278 protected override ControlLayout Layout ( ControlLayout layout )
@@ -275,6 +282,16 @@ protected override ControlLayout Layout(ControlLayout layout)
275282 {
276283 var colWidth = labels . Max ( x => x . FirstColWidth ) + ( normalTextMode ? 15 : 20 ) ;
277284 var TimeHboxPositionY = 0 ;
285+
286+ // search wider
287+ var tokenOffset = 0 ;
288+ var tokenWidth = 0 ;
289+ foreach ( var data in tokens . Where ( ( string d ) => ! string . IsNullOrWhiteSpace ( d ) ) )
290+ {
291+ tokenWidth = Owner . TextFontDefault . MeasureString ( data ) ;
292+ tokenOffset = tokenWidth > tokenOffset ? tokenWidth : tokenOffset ;
293+ }
294+
278295 foreach ( var data in labels . ToList ( ) )
279296 {
280297 if ( data . FirstCol . Contains ( "NwLn" ) )
@@ -367,7 +384,16 @@ protected override ControlLayout Layout(ControlLayout layout)
367384 }
368385 else
369386 {
370- hbox . Add ( indicator = new Label ( colWidth , hbox . RemainingHeight , LastCol ) ) ;
387+ var iniLastCol = Viewer . Catalog . GetString ( LastCol ) . IndexOf ( " " ) ;
388+ if ( tokens . Any ( LastCol . Contains ) && iniLastCol >= 0 )
389+ {
390+ hbox . Add ( indicator = new Label ( tokenOffset + ( normalTextMode ? 5 : 3 ) , hbox . RemainingHeight , LastCol . Substring ( 0 , iniLastCol ) ) ) ;
391+ hbox . Add ( indicator = new Label ( colWidth , hbox . RemainingHeight , LastCol . Substring ( iniLastCol , Viewer . Catalog . GetString ( LastCol ) . Length - iniLastCol ) . TrimStart ( ) ) ) ;
392+ }
393+ else
394+ {
395+ hbox . Add ( indicator = new Label ( colWidth , hbox . RemainingHeight , LastCol ) ) ;
396+ }
371397 indicator . Color = Color . White ; // Default color
372398 }
373399 }
@@ -838,7 +864,6 @@ void AddSeparator() => AddLabel(new ListLabel
838864 index = trainBrakeStatus . IndexOf ( Viewer . Catalog . GetString ( "BC" ) ) ;
839865
840866 brakeInfoValue = trainBrakeStatus . Substring ( index , trainBrakeStatus . Length - index ) . TrimEnd ( ) ;
841- brakeInfoValue = brakeInfoValue . StartsWith ( Viewer . Catalog . GetString ( "V" ) ) ? brakeInfoValue . Replace ( Viewer . Catalog . GetString ( "V" ) , Viewer . Catalog . GetString ( "V" ) + " " ) : brakeInfoValue ;
842867 AddLabel ( new ListLabel
843868 {
844869 LastCol = brakeInfoValue ,
0 commit comments