Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 'paste' icon for pasting from Clipboard #4184

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions images/paste-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions images/paste-light.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions src/util/inputValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
*-----------------------------------------------------------------------------------------------*/
import { env, InputBox, QuickInputButton, QuickInputButtons, ThemeIcon, window } from 'vscode';
import { env, InputBox, QuickInputButton, QuickInputButtons, ThemeIcon, Uri, window } from 'vscode';
import * as path from 'path';

export class quickBtn implements QuickInputButton {
constructor(public iconPath: ThemeIcon, public tooltip: string) { }
constructor(public iconPath: Uri | { light: Uri; dark: Uri } | ThemeIcon, public tooltip: string) { }
}

/*
Expand All @@ -31,7 +32,11 @@ export function inputValue(prompt: string, initialValue: string, password: boole
if (placeHolder) input.placeholder = placeHolder;
const enterBtn = new quickBtn(new ThemeIcon('check'), 'Enter');
const cancelBtn = new quickBtn(new ThemeIcon('close'), 'Cancel');
const pasteBtn = new quickBtn(new ThemeIcon('output'), 'Paste from Clipboard');
const pasteBtn = new quickBtn({
light: Uri.file(path.resolve(__dirname, '../../../images/paste-light.svg')),
dark: Uri.file(path.resolve(__dirname, '../../../images/paste-dark.svg'))
},
'Paste from Clipboard');
const hideBtn = new quickBtn(new ThemeIcon('eye'), 'Hide value');
const showBtn = new quickBtn(new ThemeIcon('eye-closed'), 'Show value');
let isHidden = password;
Expand Down
Loading