Skip to content

Commit

Permalink
Use 'paste' icon for pasting from Clipboard
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
  • Loading branch information
vrubezhny committed Jun 12, 2024
1 parent 091e20a commit d3ae324
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 3 deletions.
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

0 comments on commit d3ae324

Please sign in to comment.