@@ -153,7 +153,7 @@ DayProgressApplet.prototype = {
153153 this . menuManager . addMenu ( this . menu ) ;
154154
155155 // Menu items
156- this . menuElapsedContainer = new PopupMenu . PopupBaseMenuItem ( { reactive : false } ) ;
156+ this . menuElapsedContainer = new PopupMenu . PopupBaseMenuItem ( { reactive : false , style_class : "day-progress-label" } ) ;
157157 this . elapsedLabel = new St . Label ( {
158158 text : _ ( "Elapsed" ) ,
159159 x_align : Clutter . ActorAlign . START ,
@@ -164,7 +164,7 @@ DayProgressApplet.prototype = {
164164 this . menuElapsedContainer . addActor ( this . elapsedLabel ) ;
165165 this . menuElapsedContainer . addActor ( this . elapsedValue ) ;
166166
167- this . menuRemainingContainer = new PopupMenu . PopupBaseMenuItem ( { reactive : false } ) ;
167+ this . menuRemainingContainer = new PopupMenu . PopupBaseMenuItem ( { reactive : false , style_class : "day-progress-label" } ) ;
168168 this . remainingLabel = new St . Label ( {
169169 text : _ ( "Remaining" ) ,
170170 x_align : Clutter . ActorAlign . START ,
@@ -278,14 +278,18 @@ DayProgressApplet.prototype = {
278278 let elapsedMinutes = Math . floor ( ( percentElapsedOfPeriod * duration * 24 * 60 ) % 60 ) ;
279279 let remainingHours = Math . floor ( percentRemainingOfPeriod * duration * 24 ) ;
280280 let remainingMinutes = Math . floor ( ( percentRemainingOfPeriod * duration * 24 * 60 ) % 60 ) ;
281+ let percentElapsed = Math . round ( percentElapsedOfPeriod * 100 ) ;
282+ let percentRemaining = Math . round ( percentRemainingOfPeriod * 100 ) ;
281283
282- if ( elapsedHours < 10 ) elapsedHours = " " + elapsedHours ; else elapsedHours = "" + elapsedHours ;
283- if ( elapsedMinutes < 10 ) elapsedMinutes = " " + elapsedMinutes ; else elapsedMinutes = "" + elapsedMinutes ;
284- if ( remainingHours < 10 ) remainingHours = " " + remainingHours ; else remainingHours = "" + remainingHours ;
285- if ( remainingMinutes < 10 ) remainingMinutes = " " + remainingMinutes ; else remainingMinutes = "" + remainingMinutes ;
284+ elapsedHours = " " . repeat ( ( elapsedHours < 10 ) ? 1 : 0 ) + elapsedHours ;
285+ elapsedMinutes = " " . repeat ( ( elapsedMinutes < 10 ) ? 1 : 0 ) + elapsedMinutes ;
286+ remainingHours = " " . repeat ( ( remainingHours < 10 ) ? 1 : 0 ) + remainingHours ;
287+ remainingMinutes = " " . repeat ( ( remainingMinutes < 10 ) ? 1 : 0 ) + remainingMinutes ;
288+ percentElapsed = " " . repeat ( ( percentElapsed < 10 ) ? 1 : 0 ) + percentElapsed ;
289+ percentRemaining = " " . repeat ( ( percentRemaining < 10 ) ? 1 : 0 ) + percentRemaining ;
286290
287- this . elapsedValue . text = elapsedHours + 'h ' + elapsedMinutes + 'm | ' + Math . round ( percentElapsedOfPeriod * 100 ) + '%' ;
288- this . remainingValue . text = remainingHours + 'h ' + remainingMinutes + 'm | ' + Math . round ( percentRemainingOfPeriod * 100 ) + '%' ;
291+ this . elapsedValue . text = elapsedHours + 'h ' + elapsedMinutes + 'm | ' + percentElapsed + '%' ;
292+ this . remainingValue . text = remainingHours + 'h ' + remainingMinutes + 'm | ' + percentRemaining + '%' ;
289293
290294 this . _updateTooltip ( ) ;
291295 } ,
0 commit comments