mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
fix theming issue for manage account status bar icon (#396)
This commit is contained in:
committed by
Karl Burtram
parent
da75681f83
commit
874b242944
@@ -7,25 +7,35 @@
|
|||||||
|
|
||||||
import 'vs/css!./media/accountListStatusbarItem';
|
import 'vs/css!./media/accountListStatusbarItem';
|
||||||
import { Action, IAction } from 'vs/base/common/actions';
|
import { Action, IAction } from 'vs/base/common/actions';
|
||||||
import { combinedDisposable, IDisposable } from 'vs/base/common/lifecycle';
|
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { $, append } from 'vs/base/browser/dom';
|
import { $, append } from 'vs/base/browser/dom';
|
||||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||||
import { TPromise } from 'vs/base/common/winjs.base';
|
import { TPromise } from 'vs/base/common/winjs.base';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { localize } from 'vs/nls';
|
import { localize } from 'vs/nls';
|
||||||
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
import { IStatusbarItem } from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||||
|
import { Themable, STATUS_BAR_FOREGROUND } from 'vs/workbench/common/theme';
|
||||||
|
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||||
|
|
||||||
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
import { IAccountManagementService } from 'sql/services/accountManagement/interfaces';
|
||||||
|
|
||||||
export class AccountListStatusbarItem implements IStatusbarItem {
|
export class AccountListStatusbarItem extends Themable implements IStatusbarItem {
|
||||||
private _toDispose: IDisposable[];
|
|
||||||
private _manageLinkedAccountAction: IAction;
|
private _manageLinkedAccountAction: IAction;
|
||||||
|
private _icon: HTMLElement;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@IInstantiationService private _instantiationService: IInstantiationService,
|
@IInstantiationService private _instantiationService: IInstantiationService,
|
||||||
@IAccountManagementService private _accountManagementService: IAccountManagementService
|
@IAccountManagementService private _accountManagementService: IAccountManagementService,
|
||||||
|
@IThemeService themeService: IThemeService
|
||||||
) {
|
) {
|
||||||
this._toDispose = [];
|
super(themeService);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected updateStyles(): void {
|
||||||
|
super.updateStyles();
|
||||||
|
if (this._icon) {
|
||||||
|
this._icon.style.backgroundColor = this.getColor(STATUS_BAR_FOREGROUND);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public render(container: HTMLElement): IDisposable {
|
public render(container: HTMLElement): IDisposable {
|
||||||
@@ -34,9 +44,11 @@ export class AccountListStatusbarItem implements IStatusbarItem {
|
|||||||
const accountElement = append(rootElement, $('a.linked-account-status-selection'));
|
const accountElement = append(rootElement, $('a.linked-account-status-selection'));
|
||||||
accountElement.title = ManageLinkedAccountAction.LABEL;
|
accountElement.title = ManageLinkedAccountAction.LABEL;
|
||||||
accountElement.onclick = () => this._onClick();
|
accountElement.onclick = () => this._onClick();
|
||||||
append(accountElement, $('.linked-account-icon'));
|
this._icon = append(accountElement, $('.linked-account-icon'));
|
||||||
|
|
||||||
return combinedDisposable(this._toDispose);
|
this.updateStyles();
|
||||||
|
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private _onClick() {
|
private _onClick() {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
.statusbar-item .linked-account-staus a.linked-account-status-selection .linked-account-icon {
|
.statusbar-item .linked-account-staus a.linked-account-status-selection .linked-account-icon {
|
||||||
-webkit-mask: url('accounts_statusbar_inverse.svg') no-repeat 50% 50%;
|
-webkit-mask: url('accounts_statusbar_inverse.svg') no-repeat 50% 50%;
|
||||||
-webkit-mask-size: 12px;
|
-webkit-mask-size: 12px;
|
||||||
background-color: rgb(255, 255, 255);
|
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 22px;
|
height: 22px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user