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

notifications - toggle expansion on double click

上级 c371e0ba
...@@ -148,11 +148,7 @@ export function registerNotificationCommands(center: INotificationsCenterControl ...@@ -148,11 +148,7 @@ export function registerNotificationCommands(center: INotificationsCenterControl
handler: accessor => { handler: accessor => {
const notification = center.selected; const notification = center.selected;
if (notification) { if (notification) {
if (notification.expanded) { notification.toggle();
notification.collapse();
} else {
notification.expand();
}
} }
} }
}); });
......
...@@ -135,6 +135,11 @@ export class NotificationsCenter extends Themable { ...@@ -135,6 +135,11 @@ export class NotificationsCenter extends Themable {
); );
this.toUnbind.push(this.list); this.toUnbind.push(this.list);
this.toUnbind.push(this.list.onMouseDblClick(event => {
const item = event.element;
item.toggle();
}));
// Context key // Context key
NotificationsCenterFocusedContext.bindTo(this.list.contextKeyService); NotificationsCenterFocusedContext.bindTo(this.list.contextKeyService);
......
...@@ -152,6 +152,7 @@ export interface INotificationViewItem { ...@@ -152,6 +152,7 @@ export interface INotificationViewItem {
expand(): void; expand(): void;
collapse(): void; collapse(): void;
toggle(): void;
dispose(): void; dispose(): void;
...@@ -276,6 +277,14 @@ export class NotificationViewItem implements INotificationViewItem { ...@@ -276,6 +277,14 @@ export class NotificationViewItem implements INotificationViewItem {
this._onDidChange.fire(); this._onDidChange.fire();
} }
public toggle(): void {
if (this._expanded) {
this.collapse();
} else {
this.expand();
}
}
public dispose(): void { public dispose(): void {
this._onDidDispose.fire(); this._onDidDispose.fire();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册