Skip to content

HorizontalBars: Use a smaller inner circle to meaningfully represent low values.

Trent McPheron requested to merge tiz/libksysguard:horizontalbar-tweaks into master

Hi there. I noticed that the current version of the horizontal bars face does not meaningfully present any values that are lower than its own height, including zero, which is problematic for sensors that can be regularly expected to show low values, such as total CPU usage and swap space usage. For sensors like these, it would always draw a circle of width equal to its own height as a minimum value, which completely throws away any nuance at the low end, including the ability for the bar to represent zero at all. This problem is especially noticeable when you place a horizontal bars sensor on a thin vertical panel.

When trying to fix this myself, I noticed that removing the width clamping code would cause the radius of the whole bar to get messed up regularly, because the radius seems to get clamped to (lowest dimension / 2), and the inner bar gets drawn on top of the outer bar.

I wasn't sure what to do, so I filed #422581 at the bug tracker.

But I decided to use a rudimentary fix that would at least allow the bars to convey some sort of meaning, by simply creating a smaller circle. @ngraham encouraged me to make a pull request for it, so here I am.

There is probably a more sophisticated way to fix this, but I am a very recent convert to Plasma from XFCE, and I am still just getting my toes wet in the ecosystem. 🙂

Merge request reports

Loading