Feat: Adjustable width proc box#1476
Conversation
2d17303 to
a73bda3
Compare
a73bda3 to
c1c57af
Compare
73ac83c to
fe61a15
Compare
|
Not sure how complicated but if we go that far we could also think about variable widths and controlling them with the left and right arrow keys. But in my head this already opens up the wish to refactor the drawing code into a library to allow that for more boxes... |
Yeah I was already thinking about this possibility but proposed this option because it was very minimal code change.
Yeah that would be really great, but is probably outside my level of experience so if this interferes with that we can just not merge this I guess |
If you would prefer though I can experiment with modifiying this PR to allow for something like that |
The problem with these kind of ad-hoc changes (and also with the amount of new configuration options we introduced in the couple of releases) is it gets really unmaintainable really fast as it doesn't scale well. If you're interested in this, go for it 🚀. I'd prefer it over this, but not saying I'm against this. |
Hmm yeah I can see that. I apologize if the PRs I have been making are troublesome. I don't want to be a burden. I just like this project a lot. I can have trouble looking at the bigger picture sometimes.
Cool I'll experiment and see what I come up with. |
No, don't think like that, you're contributions are very valuable and drive the project forward. I didn't mean to say that a single person doing this is the problem, I have found myself in that spot as well where it's easier to just hack together some band aid solution. But at a scale we need to keep track of everything and need to rewrite the portions where a refactor makes sense. |
This comment was marked as outdated.
This comment was marked as outdated.
314315e to
54bd906
Compare
This comment was marked as resolved.
This comment was marked as resolved.
54bd906 to
b1a36a7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
a98aa2e to
7d51d97
Compare
7d51d97 to
48fa699
Compare
|
Okay I have something going that uses a percentage value and it seems to be working well. |
0a2c4cd to
996b3db
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
992e0dd to
b66a2d7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
58210ed to
0a4ea8b
Compare
0a4ea8b to
a8a0030
Compare
bd07319 to
1988e71
Compare
|
I believe this to be ready for final review now. I have fixed it up a couple issues and it is working great. Oh one more edit: I made |
|
I guess one question I have if this pr is added is. Should the percent value also be settable in the presets? If that was to be done the preset string would have to be thought about though. Since it might be weird for just one of the boxes to have 4 elements to the preset string. And it would need to be modified in a way that old preset strings continue to work. I have a draft that uses a 4th element for proc in preset string and doesn't break existing presets. If the proc preset doesn't have a 4th element it uses the default width value. valid formats:
|
This PR adds keybinds for Shift+Left, Shift+Right, Ctrl+Shift+Left, Ctrl+Shift+Right, and Ctrl+Shift+Down. Shift+Left makes the proc box wider by 1% if it is on the right and narrower by 1% if it is on the left. Shift+Right makes the proc box narrower by 1% if it on the right and wider by 1% if is on the left Alt+Shift+Left makes the proc box wider by 10% if it is on the right and narrower by 10% if it is on the left.l Alt+Shift+Right makes the proc box narrower by 10% if it on the right and wider by 10% if is on the left Ctrl+Shift+Left sets the proc box width to its maximum if on the right and minimum if on the left. Ctrl+Shift+Right sets the proc box width to its minimum if on the right and maximum if on the left. Ctrl+Shift+Down sets the proc box width to the original default from before this PR (55%)
Closes: #1475
This PR allows the user to adjust the width of the proc box with either keybinds, a menu setting, or in the config file.
Additionally the proc width percentage can be added to the presets with proc taking an additional option in the presets string. Old presets strings continue to work. The absence of a width percentage for a proc preset string results in it using the default value.
Details
Width Percentage:
New configuration option where the proc box width percentage is defined.
Value can be modified in the menu and is clamped between
0and100.In
Draw::calcSizes()the blocks that handle net and mem boxes were modified.Proc::width_pwas made external so that it can be used as the default width setting.Keybinds:
Shift+Left: makes the proc box wider by 1% if it is on the right and narrower by 1% if it is on the left.Shift+Right: makes the proc box narrower by 1% if it on the right and wider by 1% if is on the left.Alt+Shift+Left: makes the proc box wider by 10% if it is on the right and narrower by 10% if it is on the left.Alt+Shift+Right: makes the proc box narrower by 10% if it on the right and wider by 10% if is on the left.Ctrl+Shift+Left: sets the proc box width to its maximum if on the right and minimum if on the left.Ctrl+Shift+Right: sets the proc box width to its minimum if on the right and maximum if on the left.Ctrl+Shift+Down: sets the proc box width to the original default from before this PR (55%)Modifications:
Draw::calcSizes()to prevent process list cpu graphs from briefly vanishing while adjusting size.atomic<bool> resizedinside theProcnamespace. When this value orGlobal::resizedis true. Then the graphs inside the process list are not cleared.Presets:
presetsValidwas modified to properly validate the presets string when proc has a 3rd option set.presetsmenu option description was updated to reflect the new optionapply_presetwas modified to apply the proc width percentagecurrent_presetvalue back to-1proc:P:Gorproc:P:G:Wproc:0:default,proc:0:default:[0-100], andproc:0:default:defaultBenefits
This PR with the included ability to apply it in presets has benefits.
Example Videos
Screen.Recording.2026-01-17.at.5.05.58.AM.mov
Screen.Recording.2026-01-19.at.12.05.16.PM.mov