Skip to content

Commit f803afb

Browse files
committed
ui: tweak account info view icon to fit dark mode
1 parent 0805a25 commit f803afb

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"cnblogs",
1515
"blog"
1616
],
17-
"icon": "dist/assets/favicon.png",
17+
"icon": "dist/assets/favicon.svg",
1818
"engines": {
1919
"vscode": "^1.62.0"
2020
},
@@ -42,7 +42,7 @@
4242
{
4343
"command": "vscode-cnb.logout",
4444
"title": "登出",
45-
"icon": "dist/assets/icon-logout.svg",
45+
"icon": "$(log-out)",
4646
"category": "Cnblogs Account",
4747
"enablement": "vscode-cnb.isAuthorized"
4848
},

src/tree-view-providers/account-view-data-provider.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { globalState } from '../services/global-state';
21
import { accountService } from '../services/account.service';
3-
import { Event, ProviderResult, TreeDataProvider, TreeItem, Uri } from 'vscode';
2+
import { Event, ProviderResult, ThemeIcon, TreeDataProvider, TreeItem } from 'vscode';
43

54
export class AccountViewDataProvider implements TreeDataProvider<TreeItem> {
65
constructor() {}
@@ -13,9 +12,8 @@ export class AccountViewDataProvider implements TreeDataProvider<TreeItem> {
1312
return [];
1413
}
1514
const u = accountService.curUser;
16-
const extensionPath = globalState.extensionContext?.extensionPath;
1715
return [
18-
{ label: u.name, tooltip: '用户名', iconPath: Uri.parse(`${extensionPath}/dist/assets/icon-avatar.svg`) },
16+
{ label: u.name, tooltip: '用户名', iconPath: new ThemeIcon('account') },
1917
{
2018
label: '账户设置',
2119
tooltip: '账户设置',
@@ -24,7 +22,7 @@ export class AccountViewDataProvider implements TreeDataProvider<TreeItem> {
2422
command: 'vscode-cnb.open-my-account-settings',
2523
tooltip: '浏览器中打开我的账户设置',
2624
},
27-
iconPath: Uri.parse(`${extensionPath}/dist/assets/icon-account-settings.svg`),
25+
iconPath: new ThemeIcon('gear'),
2826
},
2927
{
3028
label: '博客后台',
@@ -34,7 +32,7 @@ export class AccountViewDataProvider implements TreeDataProvider<TreeItem> {
3432
command: 'vscode-cnb.open-my-blog-management-background',
3533
tooltip: '浏览器中打开我的博客后台',
3634
},
37-
iconPath: Uri.parse(`${extensionPath}/dist/assets/icon-blog-management.svg`),
35+
iconPath: new ThemeIcon('console'),
3836
},
3937
{
4038
label: '我的博客',
@@ -44,7 +42,7 @@ export class AccountViewDataProvider implements TreeDataProvider<TreeItem> {
4442
command: 'vscode-cnb.open-my-blog',
4543
tooltip: '浏览器中打开我的博客',
4644
},
47-
iconPath: Uri.parse(`${extensionPath}/dist/assets/icon-blog.svg`),
45+
iconPath: new ThemeIcon('window'),
4846
},
4947
{
5048
label: '我的主页',
@@ -54,7 +52,16 @@ export class AccountViewDataProvider implements TreeDataProvider<TreeItem> {
5452
command: 'vscode-cnb.open-my-home-page',
5553
tooltip: '浏览器中打开我的博客',
5654
},
57-
iconPath: Uri.parse(`${extensionPath}/dist/assets/icon-home.svg`),
55+
iconPath: new ThemeIcon('home'),
56+
},
57+
{
58+
label: '退出登录',
59+
tooltip: '',
60+
command: {
61+
title: '退出登录',
62+
command: 'vscode-cnb.logout',
63+
},
64+
iconPath: new ThemeIcon('log-out'),
5865
},
5966
];
6067
}

0 commit comments

Comments
 (0)