mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 17:52:34 -05:00
Merge from vscode 6268feb42ba4f2e2fa15484e88c9af60d254998c (#6530)
This commit is contained in:
@@ -65,7 +65,7 @@ export class CheckboxActionViewItem extends BaseActionViewItem {
|
||||
}
|
||||
}
|
||||
|
||||
dipsose(): void {
|
||||
dispose(): void {
|
||||
this.disposables.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,19 @@
|
||||
background: url('case-sensitive-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .monaco-custom-checkbox.monaco-preserve-case {
|
||||
background: url('preserve-case-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-custom-checkbox.monaco-preserve-case {
|
||||
background: url('preserve-case-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.hc-black .monaco-custom-checkbox.monaco-preserve-case,
|
||||
.hc-black .monaco-custom-checkbox.monaco-preserve-case:hover {
|
||||
background: url('preserve-case-hc.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs .monaco-custom-checkbox.monaco-whole-word {
|
||||
background: url('whole-word-light.svg') center center no-repeat;
|
||||
}
|
||||
@@ -40,4 +53,4 @@
|
||||
.hc-black .monaco-custom-checkbox.monaco-regex,
|
||||
.hc-black .monaco-custom-checkbox.monaco-regex:hover {
|
||||
background: url('regex-hc.svg') center center no-repeat;
|
||||
}
|
||||
}
|
||||
|
||||
4
src/vs/base/browser/ui/findinput/preserve-case-dark.svg
Normal file
4
src/vs/base/browser/ui/findinput/preserve-case-dark.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.53437 12.4673H7.4361L6.53859 10.0936H2.94854L2.10418 12.4673H1L4.24757 4H5.27499L8.53437 12.4673ZM6.21383 9.20202L4.88528 5.59426C4.84198 5.47617 4.79868 5.28722 4.75538 5.02741H4.73176C4.69239 5.26754 4.64713 5.45649 4.59595 5.59426L3.27921 9.20202H6.21383Z" fill="#C5C5C5"/>
|
||||
<path d="M9.78617 12.4673V4H12.1953C12.9275 4 13.5081 4.17911 13.9372 4.53733C14.3662 4.89554 14.5808 5.36201 14.5808 5.93674C14.5808 6.41698 14.4509 6.83425 14.1911 7.18853C13.9313 7.54281 13.573 7.79474 13.1164 7.94433V7.96795C13.6872 8.03487 14.1438 8.25137 14.4863 8.61746C14.8288 8.97961 15 9.45199 15 10.0346C15 10.7589 14.7402 11.3454 14.2206 11.7942C13.701 12.2429 13.0456 12.4673 12.2543 12.4673H9.78617ZM10.7782 4.89751V7.63138H11.7938C12.337 7.63138 12.7641 7.50148 13.0751 7.24167C13.3861 6.97793 13.5415 6.6079 13.5415 6.13159C13.5415 5.30887 13.0003 4.89751 11.9178 4.89751H10.7782ZM10.7782 8.52299V11.5698H12.1244C12.707 11.5698 13.1577 11.432 13.4766 11.1565C13.7994 10.8809 13.9608 10.503 13.9608 10.0228C13.9608 9.02292 13.2798 8.52299 11.9178 8.52299H10.7782Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
4
src/vs/base/browser/ui/findinput/preserve-case-hc.svg
Normal file
4
src/vs/base/browser/ui/findinput/preserve-case-hc.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.53437 12.4673H7.4361L6.53859 10.0936H2.94854L2.10418 12.4673H1L4.24757 4H5.27499L8.53437 12.4673ZM6.21383 9.20202L4.88528 5.59426C4.84198 5.47617 4.79868 5.28722 4.75538 5.02741H4.73176C4.69239 5.26754 4.64713 5.45649 4.59595 5.59426L3.27921 9.20202H6.21383Z" fill="white"/>
|
||||
<path d="M9.78617 12.4673V4H12.1953C12.9275 4 13.5081 4.17911 13.9372 4.53733C14.3662 4.89554 14.5808 5.36201 14.5808 5.93674C14.5808 6.41698 14.4509 6.83425 14.1911 7.18853C13.9313 7.54281 13.573 7.79474 13.1164 7.94433V7.96795C13.6872 8.03487 14.1438 8.25137 14.4863 8.61746C14.8288 8.97961 15 9.45199 15 10.0346C15 10.7589 14.7402 11.3454 14.2206 11.7942C13.701 12.2429 13.0456 12.4673 12.2543 12.4673H9.78617ZM10.7782 4.89751V7.63138H11.7938C12.337 7.63138 12.7641 7.50148 13.0751 7.24167C13.3861 6.97793 13.5415 6.6079 13.5415 6.13159C13.5415 5.30887 13.0003 4.89751 11.9178 4.89751H10.7782ZM10.7782 8.52299V11.5698H12.1244C12.707 11.5698 13.1577 11.432 13.4766 11.1565C13.7994 10.8809 13.9608 10.503 13.9608 10.0228C13.9608 9.02292 13.2798 8.52299 11.9178 8.52299H10.7782Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
4
src/vs/base/browser/ui/findinput/preserve-case-light.svg
Normal file
4
src/vs/base/browser/ui/findinput/preserve-case-light.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M8.53437 12.4673H7.4361L6.53859 10.0936H2.94854L2.10418 12.4673H1L4.24757 4H5.27499L8.53437 12.4673ZM6.21383 9.20202L4.88528 5.59426C4.84198 5.47617 4.79868 5.28722 4.75538 5.02741H4.73176C4.69239 5.26754 4.64713 5.45649 4.59595 5.59426L3.27921 9.20202H6.21383Z" fill="#424242"/>
|
||||
<path d="M9.78617 12.4673V4H12.1953C12.9275 4 13.5081 4.17911 13.9372 4.53733C14.3662 4.89554 14.5808 5.36201 14.5808 5.93674C14.5808 6.41698 14.4509 6.83425 14.1911 7.18853C13.9313 7.54281 13.573 7.79474 13.1164 7.94433V7.96795C13.6872 8.03487 14.1438 8.25137 14.4863 8.61746C14.8288 8.97961 15 9.45199 15 10.0346C15 10.7589 14.7402 11.3454 14.2206 11.7942C13.701 12.2429 13.0456 12.4673 12.2543 12.4673H9.78617ZM10.7782 4.89751V7.63138H11.7938C12.337 7.63138 12.7641 7.50148 13.0751 7.24167C13.3861 6.97793 13.5415 6.6079 13.5415 6.13159C13.5415 5.30887 13.0003 4.89751 11.9178 4.89751H10.7782ZM10.7782 8.52299V11.5698H12.1244C12.707 11.5698 13.1577 11.432 13.4766 11.1565C13.7994 10.8809 13.9608 10.503 13.9608 10.0228C13.9608 9.02292 13.2798 8.52299 11.9178 8.52299H10.7782Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -7,7 +7,7 @@ import 'vs/css!./gridview';
|
||||
import { Orientation } from 'vs/base/browser/ui/sash/sash';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { tail2 as tail, equals } from 'vs/base/common/arrays';
|
||||
import { orthogonal, IView as IGridViewView, GridView, Sizing as GridViewSizing, Box, IGridViewStyles, IViewSize } from './gridview';
|
||||
import { orthogonal, IView as IGridViewView, GridView, Sizing as GridViewSizing, Box, IGridViewStyles, IViewSize, ILayoutController, LayoutController } from './gridview';
|
||||
import { Event } from 'vs/base/common/event';
|
||||
import { InvisibleSizing } from 'vs/base/browser/ui/splitview/splitview';
|
||||
|
||||
@@ -197,6 +197,7 @@ export interface IGridOptions {
|
||||
readonly styles?: IGridStyles;
|
||||
readonly proportionalLayout?: boolean;
|
||||
readonly firstViewVisibleCachedSize?: number;
|
||||
readonly layoutController?: ILayoutController;
|
||||
}
|
||||
|
||||
export class Grid<T extends IView = IView> extends Disposable {
|
||||
@@ -217,6 +218,8 @@ export class Grid<T extends IView = IView> extends Disposable {
|
||||
|
||||
get element(): HTMLElement { return this.gridview.element; }
|
||||
|
||||
private didLayout = false;
|
||||
|
||||
constructor(view: T, options: IGridOptions = {}) {
|
||||
super();
|
||||
this.gridview = new GridView(options);
|
||||
@@ -237,6 +240,7 @@ export class Grid<T extends IView = IView> extends Disposable {
|
||||
|
||||
layout(width: number, height: number): void {
|
||||
this.gridview.layout(width, height);
|
||||
this.didLayout = true;
|
||||
}
|
||||
|
||||
hasView(view: T): boolean {
|
||||
@@ -344,6 +348,10 @@ export class Grid<T extends IView = IView> extends Disposable {
|
||||
}
|
||||
|
||||
getNeighborViews(view: T, direction: Direction, wrap: boolean = false): T[] {
|
||||
if (!this.didLayout) {
|
||||
throw new Error('Can\'t call getNeighborViews before first layout');
|
||||
}
|
||||
|
||||
const location = this.getViewLocation(view);
|
||||
const root = this.getViews();
|
||||
const node = getGridNode(root, location);
|
||||
@@ -527,6 +535,9 @@ export class SerializableGrid<T extends ISerializableView> extends Grid<T> {
|
||||
throw new Error('Invalid serialized state, first leaf not found');
|
||||
}
|
||||
|
||||
const layoutController = new LayoutController(false);
|
||||
options = { ...options, layoutController };
|
||||
|
||||
if (typeof firstLeaf.cachedVisibleSize === 'number') {
|
||||
options = { ...options, firstViewVisibleCachedSize: firstLeaf.cachedVisibleSize };
|
||||
}
|
||||
@@ -536,6 +547,7 @@ export class SerializableGrid<T extends ISerializableView> extends Grid<T> {
|
||||
result.restoreViews(firstLeaf.view, orientation, root);
|
||||
result.initialLayoutContext = { width, height, root };
|
||||
|
||||
layoutController.isLayoutEnabled = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -67,9 +67,18 @@ const defaultStyles: IGridViewStyles = {
|
||||
separatorBorder: Color.transparent
|
||||
};
|
||||
|
||||
export interface ILayoutController {
|
||||
readonly isLayoutEnabled: boolean;
|
||||
}
|
||||
|
||||
export class LayoutController implements ILayoutController {
|
||||
constructor(public isLayoutEnabled: boolean) { }
|
||||
}
|
||||
|
||||
export interface IGridViewOptions {
|
||||
styles?: IGridViewStyles;
|
||||
proportionalLayout?: boolean; // default true
|
||||
readonly styles?: IGridViewStyles;
|
||||
readonly proportionalLayout?: boolean; // default true
|
||||
readonly layoutController?: ILayoutController;
|
||||
}
|
||||
|
||||
class BranchNode implements ISplitView, IDisposable {
|
||||
@@ -466,7 +475,8 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
constructor(
|
||||
readonly view: IView,
|
||||
readonly orientation: Orientation,
|
||||
orthogonalSize: number = 0
|
||||
readonly layoutController: ILayoutController,
|
||||
orthogonalSize: number
|
||||
) {
|
||||
this._orthogonalSize = orthogonalSize;
|
||||
|
||||
@@ -536,7 +546,10 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
|
||||
layout(size: number): void {
|
||||
this._size = size;
|
||||
return this.view.layout(this.width, this.height, orthogonal(this.orientation));
|
||||
|
||||
if (this.layoutController.isLayoutEnabled) {
|
||||
this.view.layout(this.width, this.height, orthogonal(this.orientation));
|
||||
}
|
||||
}
|
||||
|
||||
setVisible(visible: boolean): void {
|
||||
@@ -553,7 +566,10 @@ class LeafNode implements ISplitView, IDisposable {
|
||||
|
||||
orthogonalLayout(size: number): void {
|
||||
this._orthogonalSize = size;
|
||||
return this.view.layout(this.width, this.height, orthogonal(this.orientation));
|
||||
|
||||
if (this.layoutController.isLayoutEnabled) {
|
||||
this.view.layout(this.width, this.height, orthogonal(this.orientation));
|
||||
}
|
||||
}
|
||||
|
||||
dispose(): void { }
|
||||
@@ -584,7 +600,7 @@ function flipNode<T extends Node>(node: T, size: number, orthogonalSize: number)
|
||||
|
||||
return result as T;
|
||||
} else {
|
||||
return new LeafNode((node as LeafNode).view, orthogonal(node.orientation), orthogonalSize) as T;
|
||||
return new LeafNode((node as LeafNode).view, orthogonal(node.orientation), (node as LeafNode).layoutController, orthogonalSize) as T;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -644,11 +660,14 @@ export class GridView implements IDisposable {
|
||||
private _onDidChange = new Relay<IViewSize | undefined>();
|
||||
readonly onDidChange = this._onDidChange.event;
|
||||
|
||||
private layoutController: LayoutController;
|
||||
|
||||
constructor(options: IGridViewOptions = {}) {
|
||||
this.element = $('.monaco-grid-view');
|
||||
this.styles = options.styles || defaultStyles;
|
||||
this.proportionalLayout = typeof options.proportionalLayout !== 'undefined' ? !!options.proportionalLayout : true;
|
||||
this.root = new BranchNode(Orientation.VERTICAL, this.styles, this.proportionalLayout);
|
||||
this.layoutController = options.layoutController || new LayoutController(true);
|
||||
}
|
||||
|
||||
style(styles: IGridViewStyles): void {
|
||||
@@ -670,7 +689,7 @@ export class GridView implements IDisposable {
|
||||
const [pathToParent, parent] = this.getNode(rest);
|
||||
|
||||
if (parent instanceof BranchNode) {
|
||||
const node = new LeafNode(view, orthogonal(parent.orientation), parent.orthogonalSize);
|
||||
const node = new LeafNode(view, orthogonal(parent.orientation), this.layoutController, parent.orthogonalSize);
|
||||
parent.addChild(node, size, index);
|
||||
|
||||
} else {
|
||||
@@ -690,14 +709,14 @@ export class GridView implements IDisposable {
|
||||
grandParent.addChild(newParent, parent.size, parentIndex);
|
||||
newParent.orthogonalLayout(parent.orthogonalSize);
|
||||
|
||||
const newSibling = new LeafNode(parent.view, grandParent.orientation, parent.size);
|
||||
const newSibling = new LeafNode(parent.view, grandParent.orientation, this.layoutController, parent.size);
|
||||
newParent.addChild(newSibling, newSiblingSize, 0);
|
||||
|
||||
if (typeof size !== 'number' && size.type === 'split') {
|
||||
size = Sizing.Split(0);
|
||||
}
|
||||
|
||||
const node = new LeafNode(view, grandParent.orientation, parent.size);
|
||||
const node = new LeafNode(view, grandParent.orientation, this.layoutController, parent.size);
|
||||
newParent.addChild(node, size, index);
|
||||
}
|
||||
}
|
||||
@@ -759,7 +778,7 @@ export class GridView implements IDisposable {
|
||||
grandParent.addChild(child, child.size, parentIndex + i);
|
||||
}
|
||||
} else {
|
||||
const newSibling = new LeafNode(sibling.view, orthogonal(sibling.orientation), sibling.size);
|
||||
const newSibling = new LeafNode(sibling.view, orthogonal(sibling.orientation), this.layoutController, sibling.size);
|
||||
grandParent.addChild(newSibling, sibling.orthogonalSize, parentIndex);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user