Skip to content

Commit

Permalink
[ISO] Fix display update issues in ManualPartitionWidget (#1249)
Browse files Browse the repository at this point in the history
* Refresh title when backing out of add partition page

* Fix display of incorrect disk's space remaining
  • Loading branch information
oliviacrain authored and jslobodzian committed Aug 7, 2021
1 parent 8198624 commit 948b95e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ func (mp *ManualPartitionWidget) HandleInput(event *tcell.EventKey) *tcell.Event
return tcell.NewEventKey(tcell.KeyTab, 0, tcell.ModNone)
case tcell.KeyEsc:
mp.pages.HidePage(addPartitionPage)
mp.refreshTitle()
}
} else {
// The front page is the partition table
Expand Down Expand Up @@ -309,9 +310,14 @@ func (mp *ManualPartitionWidget) Primitive() tview.Primitive {
return mp.pages
}

// SetSystemDeviceIndex updates the system device used
// SetSystemDeviceIndex updates the system device used.
// Panics if the space label cannot be updated.
func (mp *ManualPartitionWidget) SetSystemDeviceIndex(index int) {
mp.deviceIndex = index

err := mp.updateSpaceLabel()
logger.PanicOnError(err, "Failed to update space label")

mp.flex.SetTitle(fmt.Sprintf(uitext.DiskAdvanceTitleFmt, mp.systemDevices[mp.deviceIndex].DevicePath))
}

Expand Down

0 comments on commit 948b95e

Please sign in to comment.