Vscode: Scroll bar visibility should be configurable

Created on 4 Jan 2019  路  17Comments  路  Source: microsoft/vscode

VSCode Version

vs code version

Steps to Reproduce

  1. Open Visual Studio code and open a large text file

Current Behaviour

In Visual Studio Code, editors' scroll bars auto hide, thereby thwarting targeting the scroll bar handle when moving the mouse.

Expected Behaviour

Visual Studio Code should follow the Windows system setting Settings > Ease of Access > Display > Automatically hide scrollbar in Windows

scrollbar-always-visible-windows10

Does this issue occur when all extensions are disabled?

  • [x] Yes
  • [ ] No
feature-request workbench-os-integration

Most helpful comment

... and, I may add, to extend this feature to _all_ panels, including Explorer and Terminal, as it should be an application wide accessibility setting, not an editor feature.

All 17 comments

We will not respect the windows options because this is not exposed by Electron.
However we could expose a vscode setting for changing the scroll bar behavior. Currently the editor supports changing this internally, however we would need an external setting.

Thus leaving this open as a feature request to see if more users request it.

fyi @alexandrudima @bpasero

Thanks, isidorn. Your efforts are highly appreciated. 馃憤

@SetTrend There is a "hidden" setting you can use, but you need to restart VS Code for the setting to apply

{
  "editor.scrollbar.vertical": "visible",
  "editor.scrollbar.horizontal": "visible"
}

@alexandrudima why isn't this exposed via our settings schema?
That's the reason why I could not find the setting originaly.

Thanks!

It seems, though, as if this setting doesn't affect the Explorer view, does it?

scrollbars always hide

@SetTrend yes, this only affects the editor.

@isidorn because "you need to restart VS Code for the setting to apply", i.e. work is needed in the scrollbar and in the editor to handle the change event.

But there are already settings that require reload of the window and they just prompt for it.

AFAIK none of the (code) editor settings ask for a reload. I know disabling the telemetry crash reporter process requires a restart, but the settings that really need a restart should IMHO be very few.

I am not arguing about anything... I am just describing that to expose these as real user settings some work needs to be done to polish things, to react to the change event, perhaps even come up with better names and make things more consistent. We have a lot of scrollbar settings and we should see which ones we want to expose and how. -- https://github.com/Microsoft/vscode/blob/5aba426b77d58dbeedbc539d1780931b917cb8bb/src/vs/editor/common/config/editorOptions.ts#L2595:L2610

But this requires some work and should be therefore planned.

... and, I may add, to extend this feature to _all_ panels, including Explorer and Terminal, as it should be an application wide accessibility setting, not an editor feature.

{
 "editor.scrollbar.vertical": "hidden",
 "editor.scrollbar.horizontal": "hidden"
}

Currently the scrollbar in the editor is not hidden, it's only the handle that's gone. The horizontal scrollbar behaves as expected i.e. completely gone. This applies regardless of minimap (which I like).

For subscribers of this issue:
If you are interested in publishing the editor.scrollbar .... option as official, you can vote for it in this issue: https://github.com/microsoft/vscode/issues/98632

I experimented by adding code at the end of https://github.com/microsoft/vscode/blob/135e5d9323a30ac64eb9e3356f1828aef0920e91/src/vs/base/browser/ui/scrollbar/scrollableElement.ts#L592

to transform ScrollbarVisibility.Auto to ScrollbarVisibility.Visible

    if (result.vertical === ScrollbarVisibility.Auto) {
        result.vertical = ScrollbarVisibility.Visible;
    }

    if (result.horizontal === ScrollbarVisibility.Auto) {
        result.horizontal = ScrollbarVisibility.Visible;
    }

It worked nicely, but the challenge will be to make this conditional on a new user setting called something like window.alwaysShowScrollbars

Is it feasible to check such a setting here? Or am I too deep in the call stack to get access to settings?

Pardon me for probably requesting a leap too large at this time, but perhaps OS accessibility settings may be taken into account as a third option (ScrollbarVisibility.OS):

3e8e41755ea96ac774d2ed165fc40fe3

In https://github.com/microsoft/vscode/issues/66000#issuecomment-451876527 @isidorn previously said Electron doesn't expose this setting.

Oh, pardon me. I just flew over this issue without re-reading the history. 馃槼

Was this page helpful?
0 / 5 - 0 ratings