Page 1 of 2
cm_100percent -- allow relative changes
Posted: 2022-06-21, 10:19 UTC
by funkymonk
When working with different resolutions/dpi or viewModes/columns, It would be really nice to have a keyboard shortcut that quickly increases or decreases the width of the file panels. The auto-run commands in the view mode settings are not sufficient in many cases (no view mode in use, values not resolution/dpi-specific, etc.).
Therefore, i suggest to support relative values for the parameter of cm_100percent (or to implement a new command, like cm_percent).
Staying consistent with
"26.09.16 Added: cm_100percent now accepts a parameter: If >0, it sets the panel width (in percent) of the active panel. If <0, it sets the panel width (in percent) of the left window. Example: cm_100percent 70 (32/64)",
i could imagine
"cm_100percent +10+" would make the current panel 10% wider
"cm_100percent 10-" would make the current panel 10% smaller
"cm_100percent -10+" would make the left panel 10% wider
"cm_100percent -30" would set the left panel to 30% (as before)
etc.
Relative changes should stop at 0% and 100% (no wrap around).
The parameters might look strange with the +/- in the end, but (at least) no new command needs to be created.
This way, keyboard shortcuts can be added to quickly increase/decrease the panel widths in user-defined steps.
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 14:04 UTC
by white
funkymonk wrote: ↑2022-06-21, 10:19 UTC
Therefore, i suggest to support relative values for the parameter of cm_100percent (or to implement a new command, like cm_percent).
Staying consistent with
"26.09.16 Added: cm_100percent now accepts a parameter: If >0, it sets the panel width (in percent) of the active panel. If <0, it sets the panel width (in percent) of the left window. Example: cm_100percent 70 (32/64)",
...
The current implementation isn't very consistent with other commands. And it doesn't seem possible to set the right panel to 100%.
How about a new command called cm_PanelSize (or cm_PanelWidth) with command modifiers Left/Right?
I would also like it when the percent sign (%) is allowed too.
cm_PanelSize 10% (set width of active panel to 10%)
cm_PanelSize +10% (make active panel 10% wider)
cm_PanelSize -10% (make active panel 10% smaller)
cm_LeftPanelSize 30% (set width of left panel to 10%)
etc.
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 14:11 UTC
by Fla$her
2
funkymonk
See sp_set* examples in
TCFS2.Core.ini.
TCFS2 is convenient because you can make switch commands (with sets of columns and QuickView in particular).
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 14:14 UTC
by petermad
2
funkymonk
Support+
white wrote:And it doesn't seem possible to set the right panel to 100%
Just make the right panel
active before you run the command - or use cm_100percent -0
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 14:26 UTC
by funkymonk
@ghisler Would you consider this suggestion? If so, there might be useful ideas. Otherwise, we can drop this thread.
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 14:29 UTC
by white
petermad wrote: ↑2022-06-21, 14:14 UTC
.. or use cm_100percent -0
Doesn't work.
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 17:01 UTC
by petermad
white wrote: ↑2022-06-21, 14:29 UTC
petermad wrote: ↑2022-06-21, 14:14 UTC
.. or use cm_100percent -0
Doesn't work.
Testet again - you are right
Re: cm_100percent -- allow relative changes
Posted: 2022-06-21, 17:15 UTC
by white
petermad wrote: ↑2022-06-21, 17:01 UTC
white wrote: ↑2022-06-21, 14:29 UTC
petermad wrote: ↑2022-06-21, 14:14 UTC
.. or use cm_100percent -0
Doesn't work.
Testet again - you are right
-0 or 0 is the same as no parameter. It is strange that -100 and 100 work and -0 and 0 don't.
Re: cm_100percent -- allow relative changes
Posted: 2022-06-22, 02:08 UTC
by jinsight
2funkymonk
Support++
Re: cm_100percent -- allow relative changes
Posted: 2022-06-22, 08:20 UTC
by ghisler(Author)
cm_100percent 0 does not work, the active window isn't meant to be 0 pixels wide (although it's still possible to focus it with e.g. cm_focusleft).
Just focus the other panel first, then use cm_100percent.
Re: cm_100percent -- allow relative changes
Posted: 2022-06-22, 08:48 UTC
by petermad
YTou can use this em_command to set the opposite panel to 100%:
Code: Select all
[em_100PercentTarget]
cmd=cm_50Percent,cm_FocusTrg,cm_100Percent
It can even be used once the panel is maximized to toggle between maximized left or right side (which cm_100Percent cannot).
Re: cm_100percent -- allow relative changes
Posted: 2022-06-22, 09:54 UTC
by funkymonk
Back to the topic
: How about relative changes to the panel width?
Re: cm_100percent -- allow relative changes
Posted: 2022-06-22, 13:07 UTC
by Fla$her
funkymonk wrote: ↑2022-06-21, 10:19 UTC
"cm_100percent +10+" would make the current panel 10% wider
"cm_100percent 10-" would make the current panel 10% smaller
"cm_100percent -10+" would make the left panel 10% wider
"cm_100percent -30" would set the left panel to 30% (as before)
TCFS2 /ef if(msg(1074,1000)==1,varset(1,-10),varset(1,10)) msg(1075,65562,sepPos+varget(1)) |
TCFS2 /ef if(msg(1074,1000)==1,varset(1,10),varset(1,-10)) msg(1075,65562,sepPos+varget(1)) |
TCFS2 /ef msg(1075,65562,sepPos-10) |
TCFS2 /ef msg(1075,65562,30) |
Logically, in the first two cases, such a record should be enough:
TCFS2 /ef msg(1075,65562,sepPos+/-(msg(1074,1000)*10?10:-10)) |
, but TCFS2 for some reason does not cope..
Re: cm_100percent -- allow relative changes
Posted: 2022-06-22, 13:42 UTC
by petermad
funkymonk wrote: ↑2022-06-22, 09:54 UTC
Back to the topic
: How about relative changes to the panel width?
Support (+)
Re: cm_100percent -- allow relative changes
Posted: 2022-07-04, 13:38 UTC
by MVV
Fla$her,
I think you should try to write more readable things, using more macro names, otherwise it is hard to understand what should happen if one executes your commands.
Code: Select all
TCFS2.exe /ei "set_separator(sepPos + ( 10) * (L_isActive ? 1 : -1))" ; Increase active panel
TCFS2.exe /ei "set_separator(sepPos + (-10) * (L_isActive ? 1 : -1))" ; Decrease active panel
TCFS2.exe /ei "set_separator(sepPos + ( 10))" ; Increase left panel
TCFS2.exe /ei "set_separator(30)" ; Set left panel width