cm_100percent -- allow relative changes

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

cm_100percent -- allow relative changes

Post 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.
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_100percent -- allow relative changes

Post 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.
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_100percent -- allow relative changes

Post by *Fla$her »

2funkymonk
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).
Last edited by Fla$her on 2022-06-21, 14:15 UTC, edited 1 time in total.
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_100percent -- allow relative changes

Post by *petermad »

2funkymonk
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
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: cm_100percent -- allow relative changes

Post by *funkymonk »

@ghisler Would you consider this suggestion? If so, there might be useful ideas. Otherwise, we can drop this thread.
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_100percent -- allow relative changes

Post by *white »

petermad wrote: 2022-06-21, 14:14 UTC .. or use cm_100percent -0
Doesn't work.
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_100percent -- allow relative changes

Post 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 :oops:
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
white
Power Member
Power Member
Posts: 4593
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: cm_100percent -- allow relative changes

Post 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 :oops:
-0 or 0 is the same as no parameter. It is strange that -100 and 100 work and -0 and 0 don't.
User avatar
jinsight
Senior Member
Senior Member
Posts: 299
Joined: 2003-02-25, 19:47 UTC
Location: Wooster, Ohio, USA

Re: cm_100percent -- allow relative changes

Post by *jinsight »

2funkymonk
Support++
License #1945
Windows 10 Pro x64
Version 22H2 (OS Build 19045.3930)
TC 11.00 x64 and x86, Everything 1.5.0.1366a x64, QAP 11.6.3.1 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: cm_100percent -- allow relative changes

Post 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.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_100percent -- allow relative changes

Post 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).
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
funkymonk
Senior Member
Senior Member
Posts: 410
Joined: 2013-12-04, 09:56 UTC

Re: cm_100percent -- allow relative changes

Post by *funkymonk »

Back to the topic :wink: : How about relative changes to the panel width?
Fla$her
Power Member
Power Member
Posts: 2244
Joined: 2020-01-18, 04:03 UTC

Re: cm_100percent -- allow relative changes

Post 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..
Overquoting is evil! 👎
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: cm_100percent -- allow relative changes

Post by *petermad »

funkymonk wrote: 2022-06-22, 09:54 UTC Back to the topic :wink: : How about relative changes to the panel width?
Support (+)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: cm_100percent -- allow relative changes

Post 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
Post Reply