Skip to content

Commit

Permalink
plugin: add support for title
Browse files Browse the repository at this point in the history
The commit adds support for the `title` property in `InputBoxOptions`
which allows users to specify a title for their quick-input menus.

The change also aligns the styling of the quick-input to use the proper
input background used across the application, and for the `title`.

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Mar 24, 2022
1 parent 4ade592 commit 08bb7cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/src/common/quick-pick-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ export interface PickOptions<T extends QuickPickItem> {
}

export interface InputOptions {
title?: string;
value?: string;
valueSelection?: [number, number];
prompt?: string;
Expand Down
8 changes: 8 additions & 0 deletions packages/monaco/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,11 @@
.monaco-editor .peekview-widget .monaco-list-row.focused.selected .codicon {
color: var(--theia-list-activeSelectionForeground) !important;
}

.quick-input-titlebar {
background-color: var(--theia-input-background);
}

.quick-input-widget input {
background-color: var(--theia-input-background) !important;
}
1 change: 1 addition & 0 deletions packages/plugin-ext/src/main/browser/quick-open-main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable {
const inputOptions: InputOptions = Object.create(null);

if (options) {
inputOptions.title = options.title;
inputOptions.password = options.password;
inputOptions.placeHolder = options.placeHolder;
inputOptions.valueSelection = options.valueSelection;
Expand Down
5 changes: 5 additions & 0 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2253,6 +2253,11 @@ export module '@theia/plugin' {
*/
export interface InputBoxOptions {

/**
* An optional string that represents the title of the input box.
*/
title?: string;

/**
* The value to prefill in the input box.
*/
Expand Down

0 comments on commit 08bb7cc

Please sign in to comment.