提交 a9dc3120 编写于 作者: B Benjamin Pasero

notifications - disable scrollbar in toasts

上级 eb5e41cf
...@@ -75,7 +75,10 @@ export class NotificationsCenter extends Themable { ...@@ -75,7 +75,10 @@ export class NotificationsCenter extends Themable {
this.notificationsCenterContainer = document.createElement('div'); this.notificationsCenterContainer = document.createElement('div');
addClass(this.notificationsCenterContainer, 'notifications-center'); addClass(this.notificationsCenterContainer, 'notifications-center');
this.notificationsList = this.instantiationService.createInstance(NotificationsList, this.notificationsCenterContainer, { ariaLabel: localize('notificationsList', "Notifications List") }); this.notificationsList = this.instantiationService.createInstance(NotificationsList, this.notificationsCenterContainer, {
ariaLabel: localize('notificationsList', "Notifications List"),
useShadows: false
});
this.container.appendChild(this.notificationsCenterContainer); this.container.appendChild(this.notificationsCenterContainer);
} }
......
...@@ -18,10 +18,6 @@ import { NotificationsListDelegate, NotificationRenderer } from 'vs/workbench/br ...@@ -18,10 +18,6 @@ import { NotificationsListDelegate, NotificationRenderer } from 'vs/workbench/br
import { NotificationActionRunner } from 'vs/workbench/browser/parts/notifications/notificationsActions'; import { NotificationActionRunner } from 'vs/workbench/browser/parts/notifications/notificationsActions';
import { NotificationFocusedContext } from 'vs/workbench/browser/parts/notifications/notificationsCommands'; import { NotificationFocusedContext } from 'vs/workbench/browser/parts/notifications/notificationsCommands';
export interface INotificationsListOptions {
ariaLabel: string;
}
export class NotificationsList extends Themable { export class NotificationsList extends Themable {
private listContainer: HTMLElement; private listContainer: HTMLElement;
private list: WorkbenchList<INotificationViewItem>; private list: WorkbenchList<INotificationViewItem>;
...@@ -30,7 +26,7 @@ export class NotificationsList extends Themable { ...@@ -30,7 +26,7 @@ export class NotificationsList extends Themable {
constructor( constructor(
private container: HTMLElement, private container: HTMLElement,
private options: INotificationsListOptions, private options: IListOptions<INotificationViewItem>,
@IInstantiationService private instantiationService: IInstantiationService, @IInstantiationService private instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService @IThemeService themeService: IThemeService
) { ) {
...@@ -77,9 +73,7 @@ export class NotificationsList extends Themable { ...@@ -77,9 +73,7 @@ export class NotificationsList extends Themable {
this.listContainer, this.listContainer,
new NotificationsListDelegate(this.listContainer), new NotificationsListDelegate(this.listContainer),
[renderer], [renderer],
{ this.options
ariaLabel: this.options.ariaLabel
} as IListOptions<INotificationViewItem>
); );
this.toUnbind.push(this.list); this.toUnbind.push(this.list);
......
...@@ -22,6 +22,7 @@ import { NotificationsToastsVisibleContext } from 'vs/workbench/browser/parts/no ...@@ -22,6 +22,7 @@ import { NotificationsToastsVisibleContext } from 'vs/workbench/browser/parts/no
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { localize } from 'vs/nls'; import { localize } from 'vs/nls';
import { Severity } from 'vs/platform/notification/common/notification'; import { Severity } from 'vs/platform/notification/common/notification';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
interface INotificationToast { interface INotificationToast {
list: NotificationsList; list: NotificationsList;
...@@ -106,7 +107,10 @@ export class NotificationsToasts extends Themable { ...@@ -106,7 +107,10 @@ export class NotificationsToasts extends Themable {
itemDisposeables.push(toDisposable(() => this.notificationsToastsContainer.removeChild(notificationToastContainer))); itemDisposeables.push(toDisposable(() => this.notificationsToastsContainer.removeChild(notificationToastContainer)));
// Create toast with item and show // Create toast with item and show
const notificationList = this.instantiationService.createInstance(NotificationsList, notificationToastContainer, { ariaLabel: localize('notificationsToast', "Notification Toast") }); const notificationList = this.instantiationService.createInstance(NotificationsList, notificationToastContainer, {
ariaLabel: localize('notificationsToast', "Notification Toast"),
verticalScrollMode: ScrollbarVisibility.Hidden
});
itemDisposeables.push(notificationList); itemDisposeables.push(notificationList);
this.mapNotificationToToast.set(item, { list: notificationList, container: notificationToastContainer, disposeables: itemDisposeables }); this.mapNotificationToToast.set(item, { list: notificationList, container: notificationToastContainer, disposeables: itemDisposeables });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册