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

notifications - toggle expansion on double click

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