mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-20 02:42:11 +00:00
Clean up multi-mount disk cell labels
This commit is contained in:
@@ -178,7 +178,7 @@ export function StackedDiskBar(props: StackedDiskBarProps) {
|
||||
fill={disk.color}
|
||||
/>
|
||||
</svg>
|
||||
<span class="absolute inset-0 flex min-w-0 items-center justify-center overflow-hidden px-px text-center text-[8px] font-semibold leading-none text-base-content">
|
||||
<span class="absolute inset-0 flex min-w-0 items-center justify-center overflow-hidden px-px text-center text-[9px] font-semibold leading-none text-base-content">
|
||||
<span class="min-w-0 truncate">{disk.inlineText}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -128,7 +128,7 @@ function getShortDiskLabel(label: string): string {
|
||||
}
|
||||
|
||||
function estimateInlineTextWidth(text: string): number {
|
||||
return text.length * 4.6 + 4;
|
||||
return text.length * 5.4 + 4;
|
||||
}
|
||||
|
||||
function getInlineDiskText(shortLabel: string, percentLabel: string, slotWidth: number): string {
|
||||
@@ -136,12 +136,12 @@ function getInlineDiskText(shortLabel: string, percentLabel: string, slotWidth:
|
||||
if (slotWidth <= 0 || estimateInlineTextWidth(fullText) <= slotWidth) {
|
||||
return fullText;
|
||||
}
|
||||
if (estimateInlineTextWidth(shortLabel) <= slotWidth) {
|
||||
return shortLabel;
|
||||
}
|
||||
if (estimateInlineTextWidth(percentLabel) <= slotWidth) {
|
||||
return percentLabel;
|
||||
}
|
||||
if (estimateInlineTextWidth(shortLabel) <= slotWidth) {
|
||||
return shortLabel;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user