Style SQL input box correctly when enabled/disabled (#1920)

This commit is contained in:
Matt Irvine
2018-07-13 09:03:22 -07:00
committed by GitHub
parent 12be06d682
commit 1f32de29c1
2 changed files with 13 additions and 8 deletions

View File

@@ -63,13 +63,13 @@ export class InputBox extends vsInputBox {
this.enabledInputBorder = this.inputBorder;
this.disabledInputBackground = styles.disabledInputBackground;
this.disabledInputForeground = styles.disabledInputForeground;
this.updateInputEnabledDisabledColors();
this.applyStyles();
}
public enable(): void {
super.enable();
this.inputBackground = this.enabledInputBackground;
this.inputForeground = this.enabledInputForeground;
this.inputBorder = this.enabledInputBorder;
this.updateInputEnabledDisabledColors();
this.applyStyles();
}
@@ -89,9 +89,7 @@ export class InputBox extends vsInputBox {
public disable(): void {
super.disable();
this.inputBackground = this.disabledInputBackground;
this.inputForeground = this.disabledInputForeground;
this.inputBorder = this.disabledInputBorder;
this.updateInputEnabledDisabledColors();
this.applyStyles();
}
@@ -121,4 +119,11 @@ export class InputBox extends vsInputBox {
super.showMessage(message, force);
}
}
private updateInputEnabledDisabledColors(): void {
let enabled = this.isEnabled();
this.inputBackground = enabled ? this.enabledInputBackground : this.disabledInputBackground;
this.inputForeground = enabled ? this.enabledInputForeground : this.disabledInputForeground;
this.inputBorder = enabled ? this.enabledInputBorder : this.disabledInputBorder;
}
}