Skip to content

Commit

Permalink
remove bottom corners of filter type widget
Browse files Browse the repository at this point in the history
fixes #66897
  • Loading branch information
joaomoreno committed Jan 23, 2019
1 parent 9ad7e6a commit 3117f30
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 31 deletions.
13 changes: 1 addition & 12 deletions src/vs/base/browser/ui/list/list.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,29 +80,18 @@
line-height: 18px;
height: 20px;
z-index: 1;
top: 4px;
}

.monaco-list-type-filter.dragging {
transition: top 0.2s, left 0.2s;
}

.monaco-list-type-filter.ne {
top: 4px;
right: 4px;
}

.monaco-list-type-filter.nw {
top: 4px;
left: 4px;
}

.monaco-list-type-filter.se {
bottom: 4px;
right: 4px;
}

.monaco-list-type-filter.sw {
bottom: 4px;
left: 4px;
}

Expand Down
22 changes: 3 additions & 19 deletions src/vs/base/browser/ui/tree/abstractTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,13 +467,10 @@ class TypeFilterController<T, TFilterData> implements IDisposable {

private onDragStart(): void {
const container = this.view.getHTMLElement();
const { top, left } = getDomNodePagePosition(container);
const { left } = getDomNodePagePosition(container);
const containerWidth = container.clientWidth;
const containerHeight = container.clientHeight;
const midContainerWidth = containerWidth / 2;
const midContainerHeight = containerHeight / 2;
const width = this.domNode.clientWidth;
const height = this.domNode.clientHeight;
const disposables: IDisposable[] = [];
let positionClassName = this.positionClassName;

Expand All @@ -487,29 +484,16 @@ class TypeFilterController<T, TFilterData> implements IDisposable {
this.domNode.style.top = `4px`;
this.domNode.style.left = `${containerWidth - width - 6}px`;
break;
case 'sw':
this.domNode.style.top = `${containerHeight - height - 6}px`;
this.domNode.style.left = `4px`;
break;
case 'se':
this.domNode.style.top = `${containerHeight - height - 6}px`;
this.domNode.style.left = `${containerWidth - width - 6}px`;
break;
}
};

const onDragOver = (event: DragEvent) => {
const x = event.screenX - left;
const y = event.screenY - top;

if (x < midContainerWidth && y < midContainerHeight) {
if (x < midContainerWidth) {
positionClassName = 'nw';
} else if (x >= midContainerWidth && y < midContainerHeight) {
positionClassName = 'ne';
} else if (x < midContainerWidth && y >= midContainerHeight) {
positionClassName = 'sw';
} else {
positionClassName = 'se';
positionClassName = 'ne';
}

updatePosition();
Expand Down

0 comments on commit 3117f30

Please sign in to comment.