-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #12534: Show useful commands in watermark
- Loading branch information
Showing
7 changed files
with
150 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
.monaco-workbench > .part.editor > .watermark { | ||
position: absolute; | ||
width: 100%; | ||
bottom: 10%; | ||
} | ||
|
||
.monaco-workbench > .part.editor > .watermark dl { | ||
width: 100%; | ||
} | ||
|
||
.monaco-workbench > .part.editor > .watermark dt { | ||
clear: left; | ||
float: left; | ||
width: 49%; | ||
margin: 0 1% 0 0; | ||
text-align: right; | ||
} | ||
|
||
.monaco-workbench > .part.editor > .watermark dd { | ||
float: left; | ||
width: 49%; | ||
margin: 0 0 0 1%; | ||
text-align: left; | ||
} | ||
|
||
.monaco-workbench > .part.editor > .watermark dt { | ||
color: #2B91AF; | ||
} | ||
.monaco-workbench > .part.editor > .watermark dl { | ||
color: #2B91AF; | ||
} | ||
|
||
.vs-dark .monaco-workbench > .part.editor > .watermark dt { | ||
color: #5A5A5A; | ||
} | ||
.vs-dark .monaco-workbench > .part.editor > .watermark dl { | ||
color: #5A5A5A; | ||
} | ||
|
||
.hc-black .monaco-workbench > .part.editor > .watermark dt { | ||
color: #FFF; | ||
} | ||
.hc-black .monaco-workbench > .part.editor > .watermark dl { | ||
color: #FFF; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
'use strict'; | ||
|
||
import 'vs/css!./watermark'; | ||
import {Builder, $} from 'vs/base/browser/builder'; | ||
import {IDisposable} from 'vs/base/common/lifecycle'; | ||
import {IKeybindingService} from 'vs/platform/keybinding/common/keybinding'; | ||
import * as nls from 'vs/nls'; | ||
|
||
const entries = [ | ||
{ | ||
text: nls.localize('watermark.showCommands', "Command Pallette"), | ||
ids: ['workbench.action.showCommands'] | ||
}, | ||
{ | ||
text: nls.localize('watermark.quickOpen', "Open File in Folder"), | ||
ids: ['workbench.action.quickOpen'] | ||
}, | ||
{ | ||
text: nls.localize('watermark.moveLines', "Move Lines Up/Down"), | ||
ids: ['editor.action.moveLinesUpAction', 'editor.action.moveLinesDownAction'] | ||
}, | ||
{ | ||
text: nls.localize('watermark.addCursor', "Add Cursors Above/Below"), | ||
ids: ['cursorColumnSelectUp', 'cursorColumnSelectDown'] | ||
}, | ||
{ | ||
text: nls.localize('watermark.toggleTerminal', "Toggle Terminal"), | ||
ids: ['workbench.action.terminal.toggleTerminal'] | ||
}, | ||
]; | ||
|
||
const UNBOUND = nls.localize('watermark.unboundCommand', "unbound"); | ||
|
||
export function create(container: Builder, keybindingService: IKeybindingService): IDisposable { | ||
const div = $(container) | ||
.div({ | ||
'class': 'watermark', | ||
}); | ||
function update() { | ||
$(div).clearChildren() | ||
.element('dl', { | ||
}, dl => entries.map(entry => { | ||
dl.element('dt', {}, dt => dt.text(entry.text)); | ||
dl.element('dd', {}, dd => dd.text( | ||
entry.ids | ||
.map(id => keybindingService.lookupKeybindings(id) | ||
.map(k => keybindingService.getLabelFor(k)) | ||
.join(', ') || UNBOUND) | ||
.join(' / ') | ||
)); | ||
})); | ||
} | ||
update(); | ||
return keybindingService.onDidUpdateKeybindings(update); | ||
} |