| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
All uses of meter drawing "mode" numbers now have the type
`MeterModeId`, including the uses in structures and arrays.
`MeterModeId` is defined as `unsigned int`, as (currently) it doesn't
save any code size by defining it to any smaller type.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
| |
The Meter objects have their own 'h' properties.
Avoid access to the `Meter_modes` array.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Let the respective `MeterClass.updateMode` functions initialize the
meter mode instead. The `updateMode` function is always called after the
`MeterClass.init` function by `Meter_new()`.
This not only simplifies the init functions of meter subclasses, but
avoids the use of the global `Meter_modes` array when it's unnecessary.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The use of CUSTOM_METERMODE value in meter default mode was a bad
design. There are no meter that really has a "custom" mode to work with
and currently that value serves as a useless placeholder that hides the
real default mode for a meter.
Replace CUSTOM_METERMODE in `defaultMode` of all meters with the real
intended default modes. Currently only CPU meters and MemorySwapMeter
used this, and their real defaults are BAR_METERMODE.
In Meter_setMode(), remove the special treatment of `defaultMode ==
CUSTOM_METERMODE`, Meter_setMode() still calls the `updateMode` function
for custom treatment when it's present for a meter class.
As CUSTOM_METERMODE is obsolete from `defaultMode`, the init functions
of CPU meters and MemorySwapMeter need to be adjusted to avoid
incomplete initialization (Meter.draw function bring NULL).
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
|
| |
|
|
|
|
|
|
| |
Many thanks to @Explorer09 Kang-Che Sung (宋岡哲).
Also add a #error stanza to XUtils.h in case somebody forgets the beautiful mess GNU forces on us.
|
|
|
|
|
|
|
|
|
|
|
| |
First stage in sanitizing the process list structure so that htop
can support other types of lists too (cgroups, filesystems, ...),
in the not-too-distant future.
This introduces struct Machine for system-wide information while
keeping process-list information in ProcessList (now much less).
Next step is to propogate this separation into each platform, to
match these core changes.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
Use the same width for each sub meter to align with CPU meter.
Currently if the total width is even, so it does not split exactly into
2 equal parts plus 1 (for the middle space character column), the extra
column is added to the second meter width.
Closes: #783
|
| |
|
| |
|
|
Closes: #699
|