mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 01:25:38 -05:00
Refresh master with initial release/0.24 snapshot (#332)
* Initial port of release/0.24 source code * Fix additional headers * Fix a typo in launch.json
This commit is contained in:
36
src/sql/base/browser/ui/button/button.ts
Normal file
36
src/sql/base/browser/ui/button/button.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
'use strict';
|
||||
import { Button as vsButton, IButtonOptions, IButtonStyles as vsIButtonStyles } from 'vs/base/browser/ui/button/button';
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
||||
export interface IButtonStyles extends vsIButtonStyles {
|
||||
buttonFocusOutline?: Color;
|
||||
}
|
||||
|
||||
export class Button extends vsButton {
|
||||
private buttonFocusOutline: Color;
|
||||
|
||||
constructor(container: any, options?: IButtonOptions) {
|
||||
super(container, options);
|
||||
this.buttonFocusOutline = null;
|
||||
|
||||
this.$el.on(DOM.EventType.FOCUS, (e) => {
|
||||
this.$el.style('outline-color', this.buttonFocusOutline ? this.buttonFocusOutline.toString() : null);
|
||||
this.$el.style('outline-width', '1px');
|
||||
});
|
||||
}
|
||||
|
||||
public style(styles: IButtonStyles): void {
|
||||
super.style(styles);
|
||||
this.buttonFocusOutline = styles.buttonFocusOutline;
|
||||
}
|
||||
|
||||
public set title(value: string) {
|
||||
this.$el.title(value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user