Открыть боковую панель
code
vscode
Коммиты
ba5d25aa
Не подтверждена
Коммит
ba5d25aa
создал
Апр 09, 2025
по автору
Benjamin Pasero
Просмотр файлов
clanup
владелец
a88e5e11
Изменения
3
Скрыть пробелы
Построчно
Рядом
src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
Просмотр файла @
ba5d25aa
...
...
@@ -248,6 +248,8 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
//#endregion
protected
scopedContextKeyService
:
IContextKeyService
;
protected
rootContainer
!
:
HTMLElement
;
protected
windowControlsContainer
:
HTMLElement
|
undefined
;
...
...
@@ -302,7 +304,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
@
IThemeService
themeService
:
IThemeService
,
@
IStorageService
private
readonly
storageService
:
IStorageService
,
@
IWorkbenchLayoutService
layoutService
:
IWorkbenchLayoutService
,
@
IContextKeyService
protected
contextKeyService
:
IContextKeyService
,
@
IContextKeyService
contextKeyService
:
IContextKeyService
,
@
IHostService
private
readonly
hostService
:
IHostService
,
@
IEditorGroupsService
private
readonly
editorGroupService
:
IEditorGroupsService
,
@
IEditorService
editorService
:
IEditorService
,
...
...
@@ -313,12 +315,12 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
this
.
isAuxiliary
=
editorGroupsContainer
!==
'
main
'
;
this
.
c
ontextKeyService
=
contextKeyService
.
createScoped
(
layoutService
.
getContainer
(
targetWindow
));
const
isAuxiliaryTitleBarContext
=
IsAuxiliaryTitleBarContext
.
bindTo
(
this
.
c
ontextKeyService
);
this
.
scopedC
ontextKeyService
=
contextKeyService
.
createScoped
(
layoutService
.
getContainer
(
targetWindow
));
const
isAuxiliaryTitleBarContext
=
IsAuxiliaryTitleBarContext
.
bindTo
(
this
.
scopedC
ontextKeyService
);
isAuxiliaryTitleBarContext
.
set
(
this
.
isAuxiliary
);
this
.
titleBarStyle
=
getTitleBarStyle
(
this
.
configurationService
);
this
.
globalToolbarMenu
=
this
.
_register
(
this
.
menuService
.
createMenu
(
MenuId
.
TitleBar
,
this
.
c
ontextKeyService
));
this
.
globalToolbarMenu
=
this
.
_register
(
this
.
menuService
.
createMenu
(
MenuId
.
TitleBar
,
this
.
scopedC
ontextKeyService
));
this
.
editorService
=
editorService
.
createScoped
(
editorGroupsContainer
,
this
.
_store
);
this
.
editorGroupsContainer
=
editorGroupsContainer
===
'
main
'
?
editorGroupService
.
mainPart
:
editorGroupsContainer
;
...
...
@@ -595,7 +597,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
}
private
getKeybinding
(
action
:
IAction
):
ResolvedKeybinding
|
undefined
{
const
editorPaneAwareContextKeyService
=
this
.
editorGroupsContainer
.
activeGroup
?.
activeEditorPane
?.
scopedContextKeyService
??
this
.
c
ontextKeyService
;
const
editorPaneAwareContextKeyService
=
this
.
editorGroupsContainer
.
activeGroup
?.
activeEditorPane
?.
scopedContextKeyService
??
this
.
scopedC
ontextKeyService
;
return
this
.
keybindingService
.
lookupKeybinding
(
action
.
id
,
editorPaneAwareContextKeyService
);
}
...
...
@@ -699,7 +701,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
this
.
layoutToolbarMenuDisposables
.
clear
();
if
(
this
.
layoutControlEnabled
)
{
this
.
layoutToolbarMenu
=
this
.
menuService
.
createMenu
(
MenuId
.
LayoutControlMenu
,
this
.
c
ontextKeyService
);
this
.
layoutToolbarMenu
=
this
.
menuService
.
createMenu
(
MenuId
.
LayoutControlMenu
,
this
.
scopedC
ontextKeyService
);
this
.
layoutToolbarMenuDisposables
.
add
(
this
.
layoutToolbarMenu
);
this
.
layoutToolbarMenuDisposables
.
add
(
this
.
layoutToolbarMenu
.
onDidChange
(()
=>
updateToolBarActions
()));
...
...
@@ -766,7 +768,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
this
.
contextMenuService
.
showContextMenu
({
getAnchor
:
()
=>
event
,
menuId
,
contextKeyService
:
this
.
c
ontextKeyService
,
contextKeyService
:
this
.
scopedC
ontextKeyService
,
domForShadowRoot
:
isMacintosh
&&
isNative
?
event
.
target
:
undefined
});
}
...
...
src/vs/workbench/electron-sandbox/actions/windowActions.ts
Просмотр файла @
ba5d25aa
...
...
@@ -428,10 +428,7 @@ export class ToggleWindowAlwaysOnTopAction extends Action2 {
constructor
()
{
super
({
id
:
ToggleWindowAlwaysOnTopAction
.
ID
,
title
:
{
...
localize2
(
'
toggleWindowAlwaysOnTop
'
,
"
Toggle Window Always On Top
"
),
mnemonicTitle
:
localize
({
key
:
'
miToggleWindowAlwaysOnTop
'
,
comment
:
[
'
&& denotes a mnemonic
'
]
},
"
Tog&&gle Window Always On Top
"
),
},
title
:
localize
(
'
toggleWindowAlwaysOnTop
'
,
"
Toggle Window Always on Top
"
),
icon
:
Codicon
.
pin
,
toggled
:
{
condition
:
IsWindowAlwaysOnTopContext
,
icon
:
Codicon
.
pinned
},
menu
:
{
...
...
@@ -450,6 +447,6 @@ export class ToggleWindowAlwaysOnTopAction extends Action2 {
return
;
// Currently, we only support toggling always on top for auxiliary windows
}
nativeHostService
.
toggleWindowAlwaysOnTop
({
targetWindowId
:
getActiveWindow
().
vscodeWindowId
});
return
nativeHostService
.
toggleWindowAlwaysOnTop
({
targetWindowId
:
getActiveWindow
().
vscodeWindowId
});
}
}
src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts
Просмотр файла @
ba5d25aa
...
...
@@ -86,7 +86,7 @@ export class NativeTitlebarPart extends BrowserTitlebarPart {
}
private
async
handleWindowsAlwaysOnTop
(
targetWindowId
:
number
):
Promise
<
void
>
{
const
isWindowAlwaysOnTopContext
=
IsWindowAlwaysOnTopContext
.
bindTo
(
this
.
c
ontextKeyService
);
const
isWindowAlwaysOnTopContext
=
IsWindowAlwaysOnTopContext
.
bindTo
(
this
.
scopedC
ontextKeyService
);
this
.
_register
(
this
.
nativeHostService
.
onDidChangeWindowAlwaysOnTop
(({
windowId
,
alwaysOnTop
})
=>
{
if
(
windowId
===
targetWindowId
)
{
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать