diff options
author | Daniel Milde <daniel.milde@outreach.io> | 2023-06-06 01:13:54 +0200 |
---|---|---|
committer | Daniel Milde <daniel@milde.cz> | 2023-06-06 09:25:51 +0200 |
commit | 5ff551fe936a07a812db05cc3c017ecdefe07f28 (patch) | |
tree | fc945a013df02839c3ea59a3ff128967d21a7ec2 /tui/format.go | |
parent | a51e0624bf3a8663fd71ddd8dbee3bd257400e79 (diff) |
feat: use unicode block elements in size bar
config option `style.use-old-size-bar` added to revert back to legacy size bar
Diffstat (limited to 'tui/format.go')
-rw-r--r-- | tui/format.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tui/format.go b/tui/format.go index ce82b2e..efc683d 100644 --- a/tui/format.go +++ b/tui/format.go @@ -13,9 +13,9 @@ func (ui *UI) formatFileRow(item fs.Item, maxUsage int64, maxSize int64, marked var part int if ui.ShowApparentSize { - part = int(float64(item.GetSize()) / float64(maxSize) * 10.0) + part = int(float64(item.GetSize()) / float64(maxSize) * 100.0) } else { - part = int(float64(item.GetUsage()) / float64(maxUsage) * 10.0) + part = int(float64(item.GetUsage()) / float64(maxUsage) * 100.0) } row := string(item.GetFlag()) @@ -32,7 +32,11 @@ func (ui *UI) formatFileRow(item fs.Item, maxUsage int64, maxSize int64, marked row += fmt.Sprintf("%15s", ui.formatSize(item.GetUsage(), false, true)) } - row += getUsageGraph(part) + if ui.useOldSizeBar { + row += " " + getUsageGraphOld(part) + " " + } else { + row += getUsageGraph(part) + } if ui.showItemCount { if ui.UseColors && !marked { |