#6679 Support icon inside input box and provide filter icon for filter box

This commit is contained in:
Sandeep Somavarapu
2016-06-06 12:09:39 +02:00
parent 2d33d752cd
commit 3cca023052
7 changed files with 66 additions and 42 deletions

View File

@@ -35,6 +35,17 @@
position: relative;
width: 100%;
height: 100%;
display: flex;
justify-content: flex-start;
}
.vs-dark .monaco-inputbox > .wrapper {
background-color: var(--input-bgcolor);
}
.monaco-inputbox > .wrapper .icon {
width: 16px;
height: 22px;
}
.monaco-inputbox > .wrapper > .input {

View File

@@ -27,6 +27,7 @@ export interface IInputOptions {
validationOptions?: IInputValidationOptions;
flexibleHeight?: boolean;
actions?: IAction[];
iconClass?: string;
}
export interface IInputValidator {
@@ -96,6 +97,9 @@ export class InputBox extends Widget {
let tagName = this.options.flexibleHeight ? 'textarea' : 'input';
let wrapper = dom.append(this.element, $('.wrapper'));
if (this.options.iconClass) {
dom.append(wrapper, $('span.icon.' + this.options.iconClass));
}
this.input = <HTMLInputElement>dom.append(wrapper, $(tagName + '.input'));
this.input.setAttribute('autocorrect', 'off');
this.input.setAttribute('autocapitalize', 'off');