Files
vscode/src/vs/workbench/common/viewlet.ts
T
Maxime Quandalle 65bdaf3aec Sash double clicks (#4702)
* Support double click on sashes

We had to implement a slight change in the sash drag "hack", by removing the
full cover transparent overlay (that was preventing clicks events from being
fired) and replacing it by a CSS `cursor` rule on the document.body.

The ideal solution for a clean dragging events implementation would be to use
the `Element.setCapture` API that is unfortunately not available in Chrome.

* Center the split editor frontier by double-clicking on it

* Reset the bottom panel size by double-clicking on it

* Implement sash reset on diff editors

* Fix a bug with DOM measurement

The calculus was plain wrong as showed in https://github.com/winjs/winjs/issues/1621
This was probably unotified since this utility function wasn't used in the code base.

* Implement sidebar sash optimal resizing

Fixes #4660

* Abstract `getLargestChildWidth` into a DOM method

This commit also moves the `getOptimalWidth` method from the `Composite` to the
`Viewlet` component. This partially addresses
https://github.com/Microsoft/vscode/pull/4702#issuecomment-207813241

* Calculate the sidebar optimal width correctly in case no folder is open
2016-04-15 11:30:52 +02:00

14 lines
579 B
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import {IComposite} from 'vs/workbench/common/composite';
export interface IViewlet extends IComposite {
/**
* Returns the minimal width needed to avoid any content horizontal truncation
*/
getOptimalWidth(): number;
}