mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-30 10:38:28 +01:00
notifications - compute height properly when progress is enabled (#186612)
This commit is contained in:
@@ -21,7 +21,7 @@ import { AriaRole } from 'vs/base/browser/ui/aria/aria';
|
||||
import { NotificationActionRunner } from 'vs/workbench/browser/parts/notifications/notificationsCommands';
|
||||
|
||||
export interface INotificationsListOptions extends IListOptions<INotificationViewItem> {
|
||||
widgetAriaLabel?: string;
|
||||
readonly widgetAriaLabel?: string;
|
||||
}
|
||||
|
||||
export class NotificationsList extends Disposable {
|
||||
|
||||
@@ -27,10 +27,10 @@ import { assertIsDefined } from 'vs/base/common/types';
|
||||
import { NotificationsToastsVisibleContext } from 'vs/workbench/common/contextkeys';
|
||||
|
||||
interface INotificationToast {
|
||||
item: INotificationViewItem;
|
||||
list: NotificationsList;
|
||||
container: HTMLElement;
|
||||
toast: HTMLElement;
|
||||
readonly item: INotificationViewItem;
|
||||
readonly list: NotificationsList;
|
||||
readonly container: HTMLElement;
|
||||
readonly toast: HTMLElement;
|
||||
}
|
||||
|
||||
enum ToastVisibility {
|
||||
|
||||
@@ -83,7 +83,10 @@ export class NotificationsListDelegate implements IListVirtualDelegate<INotifica
|
||||
private computePreferredHeight(notification: INotificationViewItem): number {
|
||||
|
||||
// Prepare offset helper depending on toolbar actions count
|
||||
let actions = 1; // close
|
||||
let actions = 0;
|
||||
if (!notification.hasProgress) {
|
||||
actions++; // close
|
||||
}
|
||||
if (notification.canCollapse) {
|
||||
actions++; // expand/collapse
|
||||
}
|
||||
@@ -132,8 +135,9 @@ export interface INotificationTemplateData {
|
||||
}
|
||||
|
||||
interface IMessageActionHandler {
|
||||
readonly toDispose: DisposableStore;
|
||||
|
||||
callback: (href: string) => void;
|
||||
toDispose: DisposableStore;
|
||||
}
|
||||
|
||||
class NotificationMessageRenderer {
|
||||
|
||||
Reference in New Issue
Block a user