Change background color for active / inactive panes
Moderators: Hacker, petermad, Stefan2, white
Change background color for active / inactive panes
Hi,
I'm considering switching to Total Commander from xplorer2, due to the latter's update pricing and poor HiDPI support, and I love the free edition so far, except for one thing. Despite scouring the options - particularly the "Color" section - I can't find any way to color the active and inactive panels independently. I figured out how to change the panel background globally, but that just changes every pane to the same background.
I use Windows Magnifier 95% of the time (very poor vision) so it's nice to be able to tell which pane I'm in, even without being able to see the box around the selected file. xplorer2 allows me to do this, and I didn't realize how much I relied on the feature until I no longer had it.
Anyone willing to help the noob sort this out? I'm also open to other ways to make the active panel obvious, if the color thing just isn't possible.
I'm considering switching to Total Commander from xplorer2, due to the latter's update pricing and poor HiDPI support, and I love the free edition so far, except for one thing. Despite scouring the options - particularly the "Color" section - I can't find any way to color the active and inactive panels independently. I figured out how to change the panel background globally, but that just changes every pane to the same background.
I use Windows Magnifier 95% of the time (very poor vision) so it's nice to be able to tell which pane I'm in, even without being able to see the box around the selected file. xplorer2 allows me to do this, and I didn't realize how much I relied on the feature until I no longer had it.
Anyone willing to help the noob sort this out? I'm also open to other ways to make the active panel obvious, if the color thing just isn't possible.
Re: Change background color for active / inactive panes
Hi,FitzWM wrote:... I can't find any way to color the active and inactive panels independently. ...
that's possible.
Start with:
Configuration - Options - View Mode - Add...
Continue with:
viewtopic.php?p=337070#337070
So you would have to make
- 2 View Modes (Color1 for left panel, Color2 for right panel)
- 3 Buttons recommended
Hey, thanks for the tip! That definitely got me looking in the right direction, but it appears that Total Commander doesn't support multiple commands in one hotkey, e.g., Change to inactive color -> Change focus to other panel -> Change to active color. Fortunately, a couple custom commands and an AutoHotKey script solved it completely. For reference:
I used these custom commands:
And this AutoHotKey script:
The script simply calls the three hotkeys for "Change current panel to inactive color", "Move focus to other panel", and "Change current panel to active color", in order. As it's a script, the change happens instantaneously, just like in xplorer2. So, a little work, but perfectly usable.
Thanks again for the help![/code]
I used these custom commands:
Code: Select all
em_viewPaneI # cm_SrcViewModeList PaneI (inactive panel color) bound to Alt+J
cm_FocusTrg # cm_FocusTrg (switch to other panel) bound to Alt+K
em_viewPaneA # cm_SrcViewModeList PaneA (active panel color) bound to Alt+L
Code: Select all
; totalcmd.ahk
; This script sets up a contextual pane background for Total Commander.
#MaxHotkeysPerInterval 1000
#NoEnv
#SingleInstance, Force
SendMode Input
SetTitleMatchMode, 3 ; Forces complete matches for window titles.
SetWorkingDir %A_ScriptDir% ; Sets consistent working directory.
#IfWinActive ahk_exe TOTALCMD64.EXE
; Macro. Press Tab to activate inactive panel color, swap panels, and activate
; active panel color.
Tab::SwapTCPane()
SwapTCPane()
{
Send, !j
Send, !k
Send, !l
Return
}
Thanks again for the help![/code]
Internal commands can be combined up from Total Commander 9.0 as follows:FitzWM wrote:... it appears that Total Commander doesn't support multiple commands in one hotkey, e.g.,
Change to inactive color -> Change focus to other panel -> Change to active color.
Code: Select all
em_viewPaneI,cm_FocusTrg,em_viewPaneA
Ctrl + F -> search: combine (see example): Internal commands
Keep background color for active/inactive panel
For me, it does not quite open up, as you have managed with the AHK script, always to deposit the active panel
and the inactive panel with different colors, after you have pressed the Tab key.
Whereby I assume that the active window should always have the same color.
EDIT:
I think I have found a solution to this point: viewtopic.php?p=337453#337453
and the inactive panel with different colors, after you have pressed the Tab key.
Whereby I assume that the active window should always have the same color.
EDIT:
I think I have found a solution to this point: viewtopic.php?p=337453#337453
Hey, I managed to get it working as intended with something similar to the thread you posted, and the color change works flawlessly using Tab. I'm very happy, but there is one more thing I'd like to do, if it's possible. Can I tell TC to run a command upon the first click in the inactive panel? What I want is for the color change to go through both when I tab to the other panel and when I click into it. If this is beyond the TC command engine, that's fine; it's just icing on the cake. Still, I thought I'd ask your opinion.
Not to my knowledge.FitzWM wrote:Can I tell TC to run a command upon the first click in the inactive panel?
Not with the Tab key, but you can use a shortcut for an em_command or a button for this.FitzWM wrote:What I want is for the color change to go through both when I tab to the other panel and when I click into it.
That means, that whenever the active or inactive panel is called, the button must be clicked or the shortcut used.
In my opinion, there are only 3 restrictions on this topic that need to be considered:
1. With a mouse-click in the other panel can not be achieved that background colors will be changed (how should that work?)
2. The same applies to the Tab key
3. A consistency of the background color can be achieved, but only with the exception of the color for the column headings
See here: viewtopic.php?p=337453#337453 (detailed description!)
Well, I've already gotten it to work with Tab by creating this custom command:
where PaneI is the inactive pane view mode and PaneA is the active pane v iew mode. I then bound the command it to Tab, replacing the default behavior of, "Switch to other pane," with, "Change pane to inactive color, switch to other pane, change pane to active color." This works perfectly, and the color changes are so fast that they appear instantaneous to my eyes.
As to the mouse click, I'm not sure how it might be implemented. I suppose the program could detect the first click in a pane and allow commands to be bound to that event. I know that xplorer2 has an option to "eat the first click" in a pane, for example. But that could require rewriting the whole pane system, for all I know.
Code: Select all
cm_SrcViewModeList PaneI,cm_FocusTrg,cm_SrcViewModeList PaneA
As to the mouse click, I'm not sure how it might be implemented. I suppose the program could detect the first click in a pane and allow commands to be bound to that event. I know that xplorer2 has an option to "eat the first click" in a pane, for example. But that could require rewriting the whole pane system, for all I know.
I think we talk at cross purposes. Did you mean a button?FitzWM wrote:Well, I've already gotten it to work with Tab by creating this custom command:Code: Select all
cm_SrcViewModeList PaneI,cm_FocusTrg,cm_SrcViewModeList PaneA
For the above command, e.g. "cm_FocusTrg 4006 Focus on target file list" you need a button or an em_command with shortcut.
You cannot use the Tab key (left of the letter "Q" on the keyboard). Or do I understand anything wrong?
Anyway - if you have adapted the above example to your purposes, then everything is OK.