Skip to content

Commit

Permalink
Also truncate the mount path in the bar chart
Browse files Browse the repository at this point in the history
Truncating could be improved by a lot if there is the possibility to know the rendered length of a string. Using a fixed size rather than a fixed string length will look even better.
  • Loading branch information
piegamesde authored and franglais125 committed Jun 8, 2018
1 parent 0c20561 commit d0b3a3a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion [email protected]/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,11 @@ const Pie = new Lang.Class({
Clutter.cairo_set_source_color(cr, this.colors[mount % this.colors.length]);
arc(r, this.gtop.blocks - this.gtop.bfree, this.gtop.blocks, -pi / 2);
cr.moveTo(0, yc - r + thickness / 2);
cr.showText(this.mounts[mount]);
var text = this.mounts[mount];
if (text.length > 10) {
text = text.split("/").pop();
}
cr.showText(text);
cr.stroke();
r -= (3 * thickness) / 2;
}
Expand Down

0 comments on commit d0b3a3a

Please sign in to comment.