From 260d0c7a122990a6e0a2eea02348671131ea1cee Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Thu, 19 Sep 2024 00:11:41 +0300 Subject: [PATCH] [macos] fix bug 31939 --- .../Code/Controls/ASCTabs/ASCTabView.m | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m b/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m index 306c452bb..d6a4bc813 100644 --- a/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m +++ b/macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m @@ -55,6 +55,7 @@ @interface ASCTabView() @implementation ASCTabView @synthesize isProcessing = _isProcessing; +NSString * originalTitle; - (id)init { self = [super init]; @@ -278,8 +279,10 @@ - (void)setButtonCloseOrigin:(NSRect)rect { )]; } -- (NSString *)title { - return _changed ? [NSString stringWithFormat:@"%@*", [super title]] : [super title]; +- (void)setTitle:(NSString *)title { + [super setTitle:title]; + + originalTitle = title; } - (NSMutableDictionary *)params { @@ -298,6 +301,15 @@ - (void)onCloseTabButton:(id)sender { - (void)setChanged:(BOOL)changed { _changed = changed; + + unichar l = [[super title] characterAtIndex:0]; + if ( changed ) { + if ( l != '*' ) + [super setTitle:[NSString stringWithFormat:@"*%@", originalTitle]]; + } else { + if ( l == '*' ) + [super setTitle:originalTitle]; + } } - (void)drawRect:(NSRect)dirtyRect {