diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-09-18 15:37:20 +0200 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-09-18 17:21:32 +0200 |
commit | bdb015ffa36ebedadc2bc5266660182e49596f3d (patch) | |
tree | 320958e0578fc3473d340ba4bffb7e0b0a77ed3f /Header.c | |
parent | 5000cefc138a8ca2c0a1dbef420cdb3a70116789 (diff) |
Header: do not let multi-column meters expand to empty neighbors
Extending to right neighbors is intended for text meters with an
overlong content, so the whole text is shown if possible.
Multi column meters, like the combined memory and swap meter, position
its text depending on the given total width; keep the position to the
original assigned header slot.
Short term resolution for #796
Diffstat (limited to 'Header.c')
-rw-r--r-- | Header.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -212,7 +212,10 @@ void Header_draw(const Header* this) { Meter* meter = (Meter*) Vector_get(meters, i); float actualWidth = colWidth; - if (meter->mode == TEXT_METERMODE) { + + /* Let meters in text mode expand to the right on empty neighbors; + except for multi column meters. */ + if (meter->mode == TEXT_METERMODE && !Meter_isMultiColumn(meter)) { for (int j = 1; j < meter->columnWidthCount; j++) { actualWidth += (float)width * HeaderLayout_layouts[this->headerLayout].widths[col + j] / 100.0F; } |