summaryrefslogtreecommitdiffstats
path: root/Panel.c
AgeCommit message (Collapse)Author
2023-12-26Fix code styleBenny Baumann
2023-12-26Add includes for config.h as per the discussion in PR #1337Daniel Lange
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.
2022-10-24Reformat code baseBenny Baumann
This includes: - Wrap function implementations - Pointer alignment for function signatures - Pointer alignment for variable declarations - Whitespace after keywords - Whitespace after comma - Whitespace around initializers - Whitespace around operators - Code indentation - Line break for single line statements - Misleading alignment
2022-10-22Toggle the header meters with pound keyChristian Göttsche
Show/hide the header meters with the pound ('#') key. Useful in cases where the header is too large and occupies essential parts of the screen, especially in settings (see #1108). It is only stored as a runtime state, not a persistent setting; to remove the header permanently one can delete all active meters.
2021-12-08Panel: initialize cursorOn memberChristian Göttsche
Panel.c:496:14: runtime error: load of value 190, which is not a valid value for type 'bool'
2021-12-07Introduce screen tabsHisham Muhammad
This is a forward port (by nathans) of Hisham's original code.
2021-10-01Resolve -Wimplicit-int-conversion warningsChristian Göttsche
Panel.c:414:49: error: implicit conversion loses integer precision: 'int' to 'short' [-Werror,-Wimplicit-int-conversion] this->scrollH = MAXIMUM(this->selectedLen - this->w, 0); ~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~ ./Macros.h:11:54: note: expanded from macro 'MAXIMUM' #define MAXIMUM(a, b) ((a) > (b) ? (a) : (b)) ^ IncSet.c:159:38: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] mode->buffer[mode->index] = ch; ~ ^~ Panel.c:456:24: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] buffer[len] = ch; ~ ^~ Panel.c:473:22: error: implicit conversion loses integer precision: 'int' to 'char' [-Werror,-Wimplicit-int-conversion] buffer[0] = ch; ~ ^~
2021-09-22Update license headers to explicitly say GPLv2+Daniel Lange
2021-07-15Whitespace around operatorsBenny Baumann
2021-03-17RichString: do not unnecessarily clean whole bufferChristian Göttsche
The local stack buffer does not need to be cleaned to zeros when - just initialized, cause the length is set to 0 and the first character is set to '\0', so all printing functions will safely stop - no further used, i.e. the variable goes out of scope
2021-01-31Improve handling when selected last process entryChristian Göttsche
If the last process entry is selected and the process dies, stay at the end of the list and do not jump to the start. Also if the last entry is selected keep, after rebuilding the process list due to a new scan, the last entry selected.
2021-01-11Mark several non-modified pointer variables constChristian Göttsche
2021-01-04Panel_new: reorder argumentsChristian Göttsche
Reorder owner and type so they match the order of Panel_init
2021-01-04Add option to hide the Function BarChristian Göttsche
Support three settings: - Always show Function Bar - Always hide the Function Bar, except in Infoscreens (Env/Locks...) and when editing the search and filter mode - Hide the Function Bar on ESC until the next user input Closes: #439
2021-01-04Panel: rework hight logicChristian Göttsche
The hight of a Panel dpends on whether the Panel has a header or not. Also the header migth not be set on Panel creation, like in the MainPanel. This currently causes the cursor to get hidden behind the FunctionBar on down-scrolling.
2020-12-23Restore highlighted header of current sorted process columnChristian Göttsche
2020-12-22Merge branch 'misc' of https://github.com/cgzones/htop into cgzones-miscChristian Göttsche
2020-12-21Panel_init: initialize selectedLen memberChristian Göttsche
2020-12-20Rework drawing of FunctionBarChristian Göttsche
Draw the FunctionBar within Panel_draw instead of manually throughout the code. Add an optional PanelClass function drawFunctionBar, to allow specific panels to override the default FunctionBar_draw call. Rework the code on color change, to really change all colors (selection markers and panel headers). Closes: #402
2020-12-08Split RichString_(append|appendn|write) into wide and asciiChristian Göttsche
RichString_writeFrom takes a top spot during performance analysis due to the calls to mbstowcs() and iswprint(). Most of the time we know in advance that we are only going to print regular ASCII characters.
2020-12-03Allow to pass '/' for item searchBenny Baumann
2020-12-03Handle 'q' as quit if first characterBenny Baumann
2020-12-03Some visual code cleanupBenny Baumann
2020-12-03Use common handling for scrollingBenny Baumann
2020-12-03Reduce code duplicationBenny Baumann
2020-11-28Hide process selection on ESCChristian Göttsche
Do not highlight the current process line after pressing ESC in the main screen. Restore after pressing any key.
2020-11-16Merge branch 'hili-new-old' of adsr/htop into highlight-new-old-processesDaniel Lange
2020-11-02Embracing branchesBenny Baumann
2020-11-02Spacing around operatorsBenny Baumann
2020-11-02Whitespace and indentation issuesBenny Baumann
2020-11-02Spacing after keywords (for)Benny Baumann
2020-11-02Assert Vector_get returns an objectChristian Göttsche
It is generally assumed Vector_get returns a non-NULL object. Use a generic assert in Vector_get instead of in callers.
2020-10-30Highlight new and old processes (#74)Adam Saponara
2020-10-27Avoid some unnecessary casts and mark some not changing variables constChristian Göttsche
2020-10-18Make all required includes explicitBenny Baumann
Information as seen by IWYU 0.12 + clang 9 on Linux
2020-10-16Rename StringUtils.[ch] to XUtils.[ch]Benny Baumann
2020-10-07Mark Object instances constChristian Göttsche
2020-10-07Mark Object classes and Object class fields constChristian Göttsche
2020-10-05Update License consistently to GPLv2 as per COPYING fileDaniel Lange
2020-09-17Call character checking function with unsigned charChristian Göttsche
See https://wiki.sei.cmu.edu/confluence/display/c/STR37-C.+Arguments+to+character-handling+functions+must+be+representable+as+an+unsigned+char
2020-09-12Clean up some code duplication in the header filesHugo Musso Gualandi
PR htop-dev/htop#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
2020-09-09Consolidate repeated macro definitions into one headerNathan Scott
The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
2020-09-08Further, minor cleanups to headers post-MakeHeadersNathan Scott
Remove leftover empty ifdef/endif pairs, whitespace. The generated htop.h file was also unused - removed.
2020-09-03Axe automated header generation.Zev Weiss
Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
2020-08-26Merge branch 'ci-hwloc-job' of https://github.com/bertwesarg/htop into ↵Nathan Scott
bertwesarg-ci-hwloc-job
2019-10-31Clean up existing whitespaceDaniel Flanagan
2018-02-05Handle unexpected values for character passed to isalnumHisham Muhammad
It seems that certain negative integer values can crash isalnum(). Let's protect against those. Fixes #711.
2016-08-07Fix scrolling behavior change caused by 759caf0fExplorer09
Commit "Make PgDown behavior more usual." 759caf0f8fa593430adea676fc64612b5197dca8 silently changes the PageDown scrolling behavior that, instead of scrolling one window down until the end of the window touches the end of the list, the window simply repositions itself in a way that the selected item always become the last item in the new window. The commit reverts the behavior, and also fixes sanity conditionals so that the scrollV variable will _never_ become negative or out-of- bound. Fixes issue #532. Also keep the problem #480 addressed. Signed-off-by: Kang-Che Sung <explorer09 @ gmail.com>
2016-06-19Moving left and right needs a full redraw.Hisham
2016-06-15Added Ctrl+A and Ctrl+E to go to beginning and end of line.Hisham
(Also, '^' and '$') Closes #508.