Skip to content

Commit

Permalink
[macos] fix for support pdf
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Sep 28, 2023
1 parent bfe7d81 commit df03817
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ - (BOOL)updateTabInfoFor:(ASCTabView *)tab {
isChange = self.tabs[index].type != ASCTabTouchBarTypePresentation;
self.tabs[index].type = ASCTabTouchBarTypePresentation;
break;
case ASCTabViewTypePdf:
isChange = self.tabs[index].type != ASCTabTouchBarTypePdf;
self.tabs[index].type = ASCTabTouchBarTypePdf;
break;
default:
isChange = self.tabs[index].type != ASCTabTouchBarTypePortal;
self.tabs[index].type = ASCTabTouchBarTypePortal;
Expand Down
3 changes: 2 additions & 1 deletion macos/ONLYOFFICE/Code/TouchBar/Models/ASCTabTouchBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ typedef NS_ENUM(NSInteger, ASCTabTouchBarType)
ASCTabTouchBarTypeSpreadsheet = 2,
ASCTabTouchBarTypePresentation = 3,
ASCTabTouchBarTypePortal = 4,
ASCTabTouchBarTypePage = 5
ASCTabTouchBarTypePage = 5,
ASCTabTouchBarTypePdf = 6
};

NS_ASSUME_NONNULL_BEGIN
Expand Down
4 changes: 4 additions & 0 deletions macos/ONLYOFFICE/Code/TouchBar/Views/ASCTabTouchBarItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ - (void)updateInfo {
self.layer.backgroundColor = [[NSColor brendPresentationEditor] CGColor];
[_imageView setImage:[NSImage imageNamed:@"touchbar-tab-presentation"]];
break;
case ASCTabTouchBarTypePdf:
self.layer.backgroundColor = [[NSColor brandPdfEditor] CGColor];
[_imageView setImage:[NSImage imageNamed:@"touchbar-tab-document"]];
break;
default:
self.layer.backgroundColor = [[NSColor whiteColor] CGColor];
[_imageView setImage:[NSImage imageNamed:NSImageNameTouchBarOpenInBrowserTemplate]];
Expand Down

0 comments on commit df03817

Please sign in to comment.