Fix notification icons (#642)

This commit is contained in:
Francesco Stasi 2021-11-30 17:24:29 +01:00 committed by GitHub
parent 59e4c57ecd
commit f0d9894a16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 9 deletions

View File

@ -1,6 +1,6 @@
import * as React from 'react'; import * as React from 'react';
import { injectable, inject } from 'inversify'; import { injectable, inject } from 'inversify';
import { AbstractViewContribution } from '@theia/core/lib/browser'; import { AbstractViewContribution, codicon } from '@theia/core/lib/browser';
import { MonitorWidget } from './monitor-widget'; import { MonitorWidget } from './monitor-widget';
import { MenuModelRegistry, Command, CommandRegistry } from '@theia/core'; import { MenuModelRegistry, Command, CommandRegistry } from '@theia/core';
import { import {
@ -32,7 +32,7 @@ export namespace SerialMonitor {
{ {
id: 'serial-monitor-clear-output', id: 'serial-monitor-clear-output',
label: 'Clear Output', label: 'Clear Output',
iconClass: 'clear-all', iconClass: codicon('clear-all'),
}, },
'vscode/output.contribution/clearOutput.label' 'vscode/output.contribution/clearOutput.label'
); );

View File

@ -354,7 +354,7 @@ export class SerialConnectionManager {
this.messageService.warn( this.messageService.warn(
nls.localize( nls.localize(
'arduino/serial/reconnect', 'arduino/serial/reconnect',
'Reconnecting {0} to {1} in {2] seconds...', 'Reconnecting {0} to {1} in {2} seconds...',
Board.toString(board, { Board.toString(board, {
useFqbn: false, useFqbn: false,
}), }),

View File

@ -2,6 +2,7 @@ import * as React from 'react';
import { NotificationComponent } from './notification-component'; import { NotificationComponent } from './notification-component';
import { NotificationCenterComponent as TheiaNotificationCenterComponent } from '@theia/messages/lib/browser/notification-center-component'; import { NotificationCenterComponent as TheiaNotificationCenterComponent } from '@theia/messages/lib/browser/notification-center-component';
import { nls } from '@theia/core/lib/common'; import { nls } from '@theia/core/lib/common';
import { codicon } from '@theia/core/lib/browser';
const PerfectScrollbar = require('react-perfect-scrollbar'); const PerfectScrollbar = require('react-perfect-scrollbar');
@ -28,7 +29,7 @@ export class NotificationCenterComponent extends TheiaNotificationCenterComponen
<div className="theia-notification-center-header-actions"> <div className="theia-notification-center-header-actions">
<ul className="theia-notification-actions"> <ul className="theia-notification-actions">
<li <li
className="collapse" className={codicon('chevron-down', true)}
title={nls.localize( title={nls.localize(
'vscode/notificationsStatus/hideNotifications', 'vscode/notificationsStatus/hideNotifications',
'Hide Notification Center' 'Hide Notification Center'
@ -36,7 +37,7 @@ export class NotificationCenterComponent extends TheiaNotificationCenterComponen
onClick={this.onHide} onClick={this.onHide}
/> />
<li <li
className="clear-all" className={codicon('clear-all', true)}
title={nls.localize( title={nls.localize(
'vscode/notificationsCommands/clearAllNotifications', 'vscode/notificationsCommands/clearAllNotifications',
'Clear All' 'Clear All'

View File

@ -1,6 +1,7 @@
import * as React from 'react'; import * as React from 'react';
import { NotificationComponent as TheiaNotificationComponent } from '@theia/messages/lib/browser/notification-component'; import { NotificationComponent as TheiaNotificationComponent } from '@theia/messages/lib/browser/notification-component';
import { nls } from '@theia/core/lib/common'; import { nls } from '@theia/core/lib/common';
import { codicon } from '@theia/core/lib/browser';
export class NotificationComponent extends TheiaNotificationComponent { export class NotificationComponent extends TheiaNotificationComponent {
render(): React.ReactNode { render(): React.ReactNode {
@ -15,7 +16,7 @@ export class NotificationComponent extends TheiaNotificationComponent {
> >
<div className="theia-notification-list-item-content-main"> <div className="theia-notification-list-item-content-main">
<div <div
className={`theia-notification-icon theia-notification-icon-${type}`} className={`theia-notification-icon ${codicon(type)} ${type}`}
/> />
<div className="theia-notification-message"> <div className="theia-notification-message">
<span <span
@ -26,7 +27,11 @@ export class NotificationComponent extends TheiaNotificationComponent {
<ul className="theia-notification-actions"> <ul className="theia-notification-actions">
{expandable && ( {expandable && (
<li <li
className={collapsed ? 'expand' : 'collapse'} className={
codicon('chevron-down') + collapsed
? ' expand'
: ' collapse'
}
title={ title={
collapsed collapsed
? nls.localize('theia/messages/expand', 'Expand') ? nls.localize('theia/messages/expand', 'Expand')
@ -38,7 +43,7 @@ export class NotificationComponent extends TheiaNotificationComponent {
)} )}
{!this.isProgress && ( {!this.isProgress && (
<li <li
className="clear" className={codicon('close', true)}
title={nls.localize('vscode/abstractTree/clear', 'Clear')} title={nls.localize('vscode/abstractTree/clear', 'Clear')}
data-message-id={messageId} data-message-id={messageId}
onClick={this.onClear} onClick={this.onClear}

View File

@ -274,7 +274,7 @@
"disconnected": "Disconnected {0} from {1}.", "disconnected": "Disconnected {0} from {1}.",
"unexpectedError": "Unexpected error. Reconnecting {0} on port {1}.", "unexpectedError": "Unexpected error. Reconnecting {0} on port {1}.",
"failedReconnect": "Failed to reconnect {0} to serial port after 10 consecutive attempts. The {1} serial port is busy.", "failedReconnect": "Failed to reconnect {0} to serial port after 10 consecutive attempts. The {1} serial port is busy.",
"reconnect": "Reconnecting {0} to {1} in {2] seconds..." "reconnect": "Reconnecting {0} to {1} in {2} seconds..."
}, },
"component": { "component": {
"uninstall": "Uninstall", "uninstall": "Uninstall",