Closed FichteFoll closed 3 years ago
This very same idea is already present in iTerm2, and I like it a lot.
I would add that it should also be possible to dim the foreground colors, instead of the background color.
For example, here are two screenshots from iTerm2 in which the left pane is active, and the right pane is active.
Hm yes, maybe combine my two proposals with a specific inactive_background
color and a generic inactive_foreground_template
where you specify a template to dim all the various foreground colors since you'll have more than one.
+1 for this!
I really like this feature in other editors and multi pane applications. I am disappointed sublime does not have this behaviour implemented in some way. I can say that I use the InactivePanes plugin, and it is indeed buggy!
Also, there are a lot of ways to skin this cat, and I don't think that dimming the panel is the only solution. As long as I can easily tell which panel has focus, I personally would be happy....
InactivePanes plugin pops errors everytime I open sublime text. Please make haste on this issue!!! :)
As of build 4095, there are a couple of new features/changes that make this possible. The Default, Default Dark and Adaptive themes use these features to enable inactive sheet dimming when using the rounded or square file tab style.
highlighted
attribute. Previously each group had a tab that was highlighted
. As before, all selected tabs in all groups will have the attribute selected
.sheet_contents
that has a property background_modifier
that accepts minihtml color mod function modifiers to tweak the primary background color of a sheet. This works on views (i.e. text sheets), image sheets and html sheets. The highlighted
attribute is applied to this control to make it possible to target the background_modifier
to anything that isn't highlighted. https://www.sublimetext.com/docs/themes.html#elements-sheets:ver-devsheet_contents
and tab_control
now synchronize their highlighted
and hover
attributes.tab_connector
was added that draws from each sheet to its tab. This helps in situations where sheet multi-select is being used and the tab isn't above the sheet it belongs to. https://www.sublimetext.com/docs/themes.html#elements-tabs:ver-dev This control, and making it look good with the angled tabs was the reason we only implemented sheet dimming with the rounded and square file tab styles. It isn't impossible to add such a thing for angled tabs, but the design doesn't work well with the connectors, and the connectors are a solid improvement in usability.This implementation notably does not allow affecting the foreground colors. The implementation of such would have been much more invasive, and I felt the approach I implemented does a pretty good job of accomplishing the usability improvement of making it really obvious where input focus is.
I did implement it in text line controls also in the default themes. I'm not as convinced about that implementation, so that may be tweaked a little in the future.
Because this is implemented via theme attributes and properties, it does require that each theme decide to support such functionality, but it also opens up the underlying capabilities to be tweaked further. For instance, with the attributes provided and tab_connector, it is fairly trivial to tweak a theme so it makes the tab connector much higher contrast if the tab is overhanging to one side of the sheet.
Status Quo
The InactivePanes package dims inactive views to more visibly separate them from the active one. I've been using this package since its creation on all my ST installs. Here's a quick (old) screenshot illustrating the feature:
The way in which it works is already fundamentally hacky because it relies on modifying a user's color scheme under a different name and using per-view settings to overwrite. Things get more complicated when you factor in the various sources that a color scheme can be specified in settings and having to track changes to the underlying but also overridden
color_scheme
view setting.With the recent addition of the new color scheme format, this becomes even more complex because I additionally need to manually perform resource file merging for the selected scheme before I can create a new scheme (inside the cache folder, which I'm not sure is considered with the new format).
Furthermore, you can't create/use hidden new color schemes currently and it doesn't make sense to have these temporary schemes be selectable in the UI.Proposal
Thus, I propose this feature to be added to core, which will be much easier to maintain because it doesn't require the various hacky workarounds and can be handled in the drawing pipeline directly. The functionality is already there for selections anyway.
In detail, I propose an
inactive_background
global setting to be added, similar toinactive_selection
, which will have a sane default for both dark and white background colors, and adim_inactive_views/groups
setting to toggle this behavior.Alternatively, a CSS4 color template could be specified by the scheme to modify all colors with that template, although I don't think this is necessary and only adjusting the background (and selection) color would be sufficient.
I don't particularly care whether the "active" view gets dimmed when the entire window is inactive. This is more or less an implementation detail of InactivePanes due to relying on
on_deactivated
.