Skip to content

Commit

Permalink
[macos] for bug 72018
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkadushkin committed Dec 17, 2024
1 parent d6c1a7a commit 38c4b33
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1117,6 +1117,7 @@ - (void)onCEFOnOpenLocalFile:(NSNotification *)notification {
[filter addObjectsFromArray:[ASCConstants documents]];
[filter addObjectsFromArray:[ASCConstants spreadsheets]];
[filter addObjectsFromArray:[ASCConstants presentations]];
[filter addObjectsFromArray:[ASCConstants draws]];

openPanel.canChooseDirectories = NO;
openPanel.allowsMultipleSelection = NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ static NSString * const tabWordActiveBackgroundColor = @"tab-word-background-
static NSString * const tabCellActiveBackgroundColor = @"tab-cell-background-active-color";
static NSString * const tabSlideActiveBackgroundColor = @"tab-slide-background-active-color";
static NSString * const tabPdfActiveBackgroundColor = @"tab-pdf-background-active-color";
static NSString * const tabDrawActiveBackgroundColor = @"tab-draw-background-active-color";
static NSString * const tabActiveTextColor = @"tab-editor-text-active-color";

@interface ASCThemesController : NSObject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ + (NSColor*)color:(NSString*)name forTheme:(NSString*)theme {
return [NSColor brendPresentationEditor];
} else if ([name isEqualToString:tabPdfActiveBackgroundColor]) {
return [NSColor brandPdfEditor];
} else if ([name isEqualToString:tabDrawActiveBackgroundColor]) {
return [NSColor brandDrawEditor];
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ - (void)onCEFChangedTabEditorType:(NSNotification *)notification {
case AscEditorType::etSpreadsheet : docType = ASCTabViewTypeSpreadsheet; break;
case AscEditorType::etPresentation : docType = ASCTabViewTypePresentation; break;
case AscEditorType::etPdf : docType = ASCTabViewTypePdf; break;
case AscEditorType::etDraw : docType = ASCTabViewTypeDraw; break;
default:
break;
}
Expand Down
5 changes: 5 additions & 0 deletions macos/ONLYOFFICE/Code/Controls/ASCTabs/ASCTabView.m
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ - (void)initialize {
@{@"normal": @"icon_tabs_pe_inactive", @"active": @"icon_tabs_pe_active"},
// ASCTabViewTypePdf
@{@"normal": @"icon_tabs_pdf_inactive", @"active": @"icon_tabs_pdf_active"},
// ASCTabViewTypeDraw
@{@"normal": @"icon_tabs_ve_inactive", @"active": @"icon_tabs_ve_active"},
// ASCTabViewTypePortal
@{@"normal": @"icon_tab_portal_active", @"active": @"icon_tab_portal_active"}
]
Expand Down Expand Up @@ -245,6 +247,9 @@ - (void)setType:(ASCTabViewType)type {
} else if (type == ASCTabViewTypePdf) {
tabViewCell.activeColor =
tabViewCell.clickColor = [ASCThemesController currentThemeColor:tabPdfActiveBackgroundColor];
} else if (type == ASCTabViewTypeDraw) {
tabViewCell.activeColor =
tabViewCell.clickColor = [ASCThemesController currentThemeColor:tabDrawActiveBackgroundColor];
}
}

Expand Down
1 change: 1 addition & 0 deletions macos/ONLYOFFICE/Code/Enums/ASCTabViewType.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ typedef NS_ENUM(NSUInteger, ASCTabViewType) {
ASCTabViewTypeSpreadsheet,
ASCTabViewTypePresentation,
ASCTabViewTypePdf,
ASCTabViewTypeDraw,
ASCTabViewTypePortal
};

Expand Down
1 change: 1 addition & 0 deletions macos/ONLYOFFICE/Code/Extensions/NSColor+Extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
+ (NSColor *) brendSpreadsheetEditor;
+ (NSColor *) brendPresentationEditor;
+ (NSColor *) brandPdfEditor;
+ (NSColor *) brandDrawEditor;
@end

@interface NSColor (Extensions)
Expand Down
7 changes: 7 additions & 0 deletions macos/ONLYOFFICE/Code/Extensions/NSColor+Extensions.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ + (NSColor *) brandPdfEditor {
return UIColorFromRGB(0xaa5252);
}

+ (NSColor *) brandDrawEditor {
if (@available(macOS 10.13, *)) {
return [NSColor colorNamed:@"brand-DrawEditor"];
}
return UIColorFromRGB(0x444796);
}

@end

#pragma mark - Extensions
Expand Down
1 change: 1 addition & 0 deletions macos/ONLYOFFICE/Code/Utils/ASCConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ static NSString * const CEFEventNameCertificatePreview = @"CEF_certificateP
+ (NSArray *)documents;
+ (NSArray *)spreadsheets;
+ (NSArray *)presentations;
+ (NSArray *)draws;
+ (NSArray *)plugins;
+ (NSArray *)csvtxt;
+ (NSArray *)cancryptformats;
Expand Down
4 changes: 4 additions & 0 deletions macos/ONLYOFFICE/Code/Utils/ASCConstants.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ + (NSArray *)presentations {
return @[@"ppt", @"pptx", @"pptm", @"ppsx", @"odp", @"potx", @"otp", @"pps", @"ppsm", @"potm", @"fodp", @"dps", @"dpt", @"sxi",@"key"];
}

+ (NSArray *)draws {
return @[@"vsdx",@"vssx",@"vstx",@"vsdm",@"vssm",@"vstm"];
}

+ (NSArray *)cancryptformats {
return @[@"docm", @"docx", @"docxf", @"dotm", @"dotx", @"oform", @"potm", @"potx", @"ppsm", @"pptm", @"ppsx", @"pptx", @"xlsm", @"xlsx", @"xltm", @"xltx"];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x96",
"green" : "0x47",
"red" : "0x44"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

0 comments on commit 38c4b33

Please sign in to comment.