Skip to content

Commit 5798020

Browse files
committed
Merge branch 'rebornix/notebook' into roblou/addToolbar
2 parents ecb6fc3 + e6fd2cf commit 5798020

17 files changed

Lines changed: 968 additions & 166 deletions

File tree

src/vs/base/browser/ui/list/listView.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,20 @@ export class ListView<T> implements ISpliceable<T>, IDisposable {
279279
this.scrollableElement.triggerScrollFromMouseWheelEvent(browserEvent);
280280
}
281281

282-
updateElementHeight(index: number, size: number): void {
282+
updateElementHeight(index: number, size: number, anchorIndex: number | null): void {
283283
if (this.items[index].size === size) {
284284
return;
285285
}
286286

287287
const lastRenderRange = this.getRenderRange(this.lastRenderTop, this.lastRenderHeight);
288288

289-
const heightDiff = index < lastRenderRange.start ? size - this.items[index].size : 0;
289+
const heightDiff =
290+
(anchorIndex !== null && anchorIndex > index && anchorIndex <= lastRenderRange.end)
291+
? size - this.items[index].size // Element at anchor index will keep its visual position
292+
: index < lastRenderRange.start
293+
? size - this.items[index].size
294+
: 0;
295+
290296
this.rangeMap.splice(index, 1, [{ size: size }]);
291297
this.items[index].size = size;
292298

src/vs/base/browser/ui/list/listWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ export class List<T> implements ISpliceable<T>, IDisposable {
13141314
}
13151315

13161316
updateElementHeight(index: number, size: number): void {
1317-
this.view.updateElementHeight(index, size);
1317+
this.view.updateElementHeight(index, size, null);
13181318
}
13191319

13201320
rerender(): void {

src/vs/platform/actions/common/actions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,14 +425,14 @@ export function registerAction2(ctor: { new(): Action2 }): IDisposable {
425425
KeybindingsRegistry.registerKeybindingRule({
426426
...item,
427427
id: command.id,
428-
when: ContextKeyExpr.and(command.precondition, item.when)
428+
when: command.precondition ? ContextKeyExpr.and(command.precondition, item.when) : item.when
429429
});
430430
}
431431
} else if (keybinding) {
432432
KeybindingsRegistry.registerKeybindingRule({
433433
...keybinding,
434434
id: command.id,
435-
when: ContextKeyExpr.and(command.precondition, keybinding.when)
435+
when: command.precondition ? ContextKeyExpr.and(command.precondition, keybinding.when) : keybinding.when
436436
});
437437
}
438438

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
/*---------------------------------------------------------------------------------------------
2+
* Copyright (c) Microsoft Corporation. All rights reserved.
3+
* Licensed under the MIT License. See License.txt in the project root for license information.
4+
*--------------------------------------------------------------------------------------------*/
5+
6+
.monaco-workbench .simple-fr-find-part-wrapper {
7+
overflow: hidden;
8+
z-index: 10;
9+
position: absolute;
10+
top: -45px;
11+
right: 18px;
12+
width: 318px;
13+
max-width: calc(100% - 28px - 28px - 8px);
14+
pointer-events: none;
15+
transition: top 200ms linear;
16+
visibility: hidden;
17+
}
18+
19+
.monaco-workbench .simple-fr-find-part {
20+
/* visibility: hidden; Use visibility to maintain flex layout while hidden otherwise interferes with transition */
21+
z-index: 10;
22+
position: relative;
23+
top: 0px;
24+
display: flex;
25+
padding: 4px;
26+
align-items: center;
27+
pointer-events: all;
28+
margin: 0 0 0 17px;
29+
}
30+
31+
.monaco-workbench .simple-fr-replace-part {
32+
/* visibility: hidden; Use visibility to maintain flex layout while hidden otherwise interferes with transition */
33+
z-index: 10;
34+
position: relative;
35+
top: 0px;
36+
display: flex;
37+
padding: 4px;
38+
align-items: center;
39+
pointer-events: all;
40+
margin: 0 0 0 17px;
41+
}
42+
43+
.monaco-workbench .simple-fr-find-part-wrapper .monaco-findInput {
44+
width: 224px;
45+
}
46+
47+
.monaco-workbench .simple-fr-find-part-wrapper .button {
48+
width: 20px;
49+
height: 20px;
50+
flex: initial;
51+
margin-left: 3px;
52+
background-position: 50%;
53+
background-repeat: no-repeat;
54+
cursor: pointer;
55+
display: flex;
56+
align-items: center;
57+
justify-content: center;
58+
}
59+
60+
.monaco-workbench .simple-fr-find-part-wrapper.visible .simple-fr-find-part {
61+
visibility: visible;
62+
}
63+
64+
.monaco-workbench .simple-fr-find-part-wrapper .toggle {
65+
position: absolute;
66+
top: 0;
67+
width: 18px;
68+
height: 100%;
69+
box-sizing: border-box;
70+
display: flex;
71+
align-items: center;
72+
justify-content: center;
73+
margin-left: 0px;
74+
pointer-events: all;
75+
}
76+
77+
.monaco-workbench .simple-fr-find-part-wrapper.visible {
78+
visibility: visible;
79+
}
80+
81+
.monaco-workbench .simple-fr-find-part-wrapper.visible-transition {
82+
top: 0;
83+
}
84+
85+
.monaco-workbench .simple-fr-find-part .monaco-findInput {
86+
flex: 1;
87+
}
88+
89+
.monaco-workbench .simple-fr-find-part .button {
90+
min-width: 20px;
91+
width: 20px;
92+
height: 20px;
93+
display: flex;
94+
flex: initial;
95+
margin-left: 3px;
96+
background-position: center center;
97+
background-repeat: no-repeat;
98+
cursor: pointer;
99+
}
100+
101+
.monaco-workbench .simple-fr-find-part .button.previous {
102+
background-image: url('images/chevron-previous-light.svg');
103+
}
104+
105+
.monaco-workbench .simple-fr-find-part .button.next {
106+
background-image: url('images/chevron-next-light.svg');
107+
}
108+
109+
.monaco-workbench .simple-fr-find-part .button.close-fw {
110+
background-image: url('images/close-light.svg');
111+
}
112+
113+
.hc-black .monaco-workbench .simple-fr-find-part .button.previous,
114+
.vs-dark .monaco-workbench .simple-fr-find-part .button.previous {
115+
background-image: url('images/chevron-previous-dark.svg');
116+
}
117+
118+
.hc-black .monaco-workbench .simple-fr-find-part .button.next,
119+
.vs-dark .monaco-workbench .simple-fr-find-part .button.next {
120+
background-image: url('images/chevron-next-dark.svg');
121+
}
122+
123+
.hc-black .monaco-workbench .simple-fr-find-part .button.close-fw,
124+
.vs-dark .monaco-workbench .simple-fr-find-part .button.close-fw {
125+
background-image: url('images/close-dark.svg');
126+
}
127+
128+
.monaco-workbench .simple-fr-find-part .button.disabled {
129+
opacity: 0.3;
130+
cursor: default;
131+
}

0 commit comments

Comments
 (0)