@@ -172,19 +172,22 @@ func setupLayout(w fyne.Window, state *InstallerState) *fyne.Container {
172172
173173func mainLayout (w fyne.Window , state * InstallerState ) * fyne.Container {
174174 pathHeaderLabel := widget .NewLabel ("Install Path: " )
175+ pathHeaderLabel .TextStyle = fyne.TextStyle {Bold : true }
175176 pathLabel := widget .NewLabelWithData (state .folderPath )
176177 pathContainer := container .New (layout .NewHBoxLayout (),
177178 pathHeaderLabel ,
178179 pathLabel )
179180
180181 sourceHeaderLabel := widget .NewLabel ("Source: " )
182+ sourceHeaderLabel .TextStyle = fyne.TextStyle {Bold : true }
181183 sourceLabel := widget .NewLabel (state .baseUrl )
182184 sourceContainer := container .New (layout .NewHBoxLayout (),
183185 sourceHeaderLabel ,
184186 sourceLabel )
185187
186188 // Create active file bars
187189 fileLabel := widget .NewLabel ("File: " )
190+ fileLabel .TextStyle = fyne.TextStyle {Bold : true }
188191 fileHeader1 := widget .NewLabelWithData (state .fileTitle1 )
189192 fileHeader1 .Alignment = fyne .TextAlignLeading
190193 fileHeader1 .Wrapping = fyne .TextTruncate
@@ -212,7 +215,6 @@ func mainLayout(w fyne.Window, state *InstallerState) *fyne.Container {
212215 progressBarTotal := widget .NewProgressBarWithData (state .progressBarTotal )
213216 totalLabel := canvas .NewText ("Total Progress..." , color .White )
214217
215- rateLimitLabel := widget .NewLabel ("Download Speed Limit:" )
216218 rateLimitCurrentLabel := widget .NewLabelWithData (state .formatRateLimit )
217219 rateLimitEntry := widget .NewEntryWithData (state .rateLimitEntry )
218220 rateLimitSet := widget .NewButton ("Set (KB/s)" , func () {
@@ -260,11 +262,7 @@ func mainLayout(w fyne.Window, state *InstallerState) *fyne.Container {
260262 }
261263 })
262264
263- rateLimContainer := container .New (layout .NewVBoxLayout (),
264- container .New (layout .NewHBoxLayout (),
265- rateLimitLabel ,
266- rateLimitCurrentLabel ),
267- container .NewBorder (nil , nil , nil , rateLimitSet , rateLimitEntry ))
265+ rateLimContainer := container .NewBorder (nil , nil , nil , rateLimitSet , rateLimitEntry )
268266
269267 // Create buttons
270268 button1 := widget .NewButton ("Start" , func () {
@@ -306,8 +304,7 @@ func mainLayout(w fyne.Window, state *InstallerState) *fyne.Container {
306304 // Create a row with buttons
307305 buttonsRow := container .NewHBox (button1 , button2 , button3 )
308306
309- // Create 3 additional labels
310- downloadedHeaderLabel := widget .NewLabel ("Downloaded:" )
307+ // Create stats labels
311308 downloadedLabel := widget .NewLabelWithData (state .formatDownloadedSize )
312309 downloadedLabel .Alignment = fyne .TextAlignLeading
313310 downloadedLabel .TextStyle = fyne.TextStyle {Monospace : true }
@@ -319,23 +316,30 @@ func mainLayout(w fyne.Window, state *InstallerState) *fyne.Container {
319316 widget .NewLabel ("/" ),
320317 totalSizeLabel )
321318
322- speedHeaderLabel := widget .NewLabel ("Average Speed:" )
323- speedHeaderLabel .Alignment = fyne .TextAlignLeading
324319 speedLabel := widget .NewLabelWithData (state .formatDownloadSpeed )
325320 speedLabel .Alignment = fyne .TextAlignLeading
326321 speedLabel .TextStyle = fyne.TextStyle {Monospace : true }
327322
323+ statsForm := & widget.Form {
324+ Items : []* widget.FormItem {
325+ {Text : "Downloaded:" , Widget : downloadedContainer },
326+ {Text : "Average Speed:" , Widget : speedLabel },
327+ {Text : "Download Speed Limit:" , Widget : rateLimitCurrentLabel },
328+ },
329+ }
330+
328331 leftMainContent := container .New (layout .NewVBoxLayout (),
329332 pathContainer ,
330- sourceContainer ,
331333 totalLabel ,
332334 progressBarTotal ,
335+ statsForm ,
333336 layout .NewSpacer (),
334337 rateLimContainer ,
335338 buttonsRow ,
336339 )
337340
338341 rightMainContent := container .New (layout .NewVBoxLayout (),
342+ sourceContainer ,
339343 fileContainer1 ,
340344 fileProgressBar1 ,
341345 fileContainer2 ,
@@ -347,21 +351,8 @@ func mainLayout(w fyne.Window, state *InstallerState) *fyne.Container {
347351
348352 mainContent := container .NewBorder (nil , nil , leftMainContent , nil , rightMainContent )
349353
350- line := canvas .NewLine (color.Gray {Y : 0x55 })
351- line .StrokeWidth = 2
352-
353- leftSideContent := container .New (layout .NewHBoxLayout (),
354- container .New (layout .NewVBoxLayout (),
355- layout .NewSpacer (),
356- downloadedHeaderLabel ,
357- downloadedContainer ,
358- speedHeaderLabel ,
359- speedLabel ),
360- line ,
361- )
362-
363354 // Combine the grid layout and sidebar label in a horizontal box
364- mainLayout := container .NewBorder (topBarLayout ("install" ), nil , leftSideContent , nil , mainContent )
355+ mainLayout := container .NewBorder (topBarLayout ("install" ), nil , nil , nil , mainContent )
365356
366357 return mainLayout
367358}
@@ -461,7 +452,7 @@ func FormatBytes(size int64) string {
461452
462453 var unitIndex int
463454 floatSize := float64 (size )
464- for unitIndex = 0 ; unitIndex < len (units ); unitIndex ++ {
455+ for unitIndex = 0 ; unitIndex < len (units )- 1 ; unitIndex ++ {
465456 if floatSize < 1024.0 {
466457 break
467458 }
0 commit comments