Skip to content

Commit 948b95e

Browse files
oliviacrainjslobodzian
authored andcommitted
[ISO] Fix display update issues in ManualPartitionWidget (#1249)
* Refresh title when backing out of add partition page * Fix display of incorrect disk's space remaining
1 parent 8198624 commit 948b95e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

toolkit/tools/imagegen/attendedinstaller/views/diskview/manualpartitionwidget/manualpartitionwidget.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ func (mp *ManualPartitionWidget) HandleInput(event *tcell.EventKey) *tcell.Event
255255
return tcell.NewEventKey(tcell.KeyTab, 0, tcell.ModNone)
256256
case tcell.KeyEsc:
257257
mp.pages.HidePage(addPartitionPage)
258+
mp.refreshTitle()
258259
}
259260
} else {
260261
// The front page is the partition table
@@ -309,9 +310,14 @@ func (mp *ManualPartitionWidget) Primitive() tview.Primitive {
309310
return mp.pages
310311
}
311312

312-
// SetSystemDeviceIndex updates the system device used
313+
// SetSystemDeviceIndex updates the system device used.
314+
// Panics if the space label cannot be updated.
313315
func (mp *ManualPartitionWidget) SetSystemDeviceIndex(index int) {
314316
mp.deviceIndex = index
317+
318+
err := mp.updateSpaceLabel()
319+
logger.PanicOnError(err, "Failed to update space label")
320+
315321
mp.flex.SetTitle(fmt.Sprintf(uitext.DiskAdvanceTitleFmt, mp.systemDevices[mp.deviceIndex].DevicePath))
316322
}
317323

0 commit comments

Comments
 (0)