summaryrefslogtreecommitdiffstats
path: root/Header.c
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-09-18 15:37:20 +0200
committerChristian Göttsche <cgzones@googlemail.com>2021-09-18 17:21:32 +0200
commitbdb015ffa36ebedadc2bc5266660182e49596f3d (patch)
tree320958e0578fc3473d340ba4bffb7e0b0a77ed3f /Header.c
parent5000cefc138a8ca2c0a1dbef420cdb3a70116789 (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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Header.c b/Header.c
index 8940b368..26cd9236 100644
--- a/Header.c
+++ b/Header.c
@@ -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;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy