Skip to content

Commit ca99252

Browse files
Merge branch release/v9.1.0 into develop
2 parents c57ecd0 + fda838c commit ca99252

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+11768
-9223
lines changed

common/loginpage/providers/seafile/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"check": {
55
"url": "/api2/server-info/"
66
},
7-
"editorPage": "regex:\/lib\/(?:[\w-]{32,})\/file\/.*\.(docx|pptx|xlsx|doc|ppt|xls|odt|fodt|odp|fodp|fods)$",
7+
"editorPage": "regex:\/lib\/(?:[\w-]{32,})\/file\/.*\.(docx|pptx|xlsx|doc|ppt|xls|odt|fodt|odp|fodp|fods)",
8+
"editorFrameSize": "finite",
89
"cryptoSupport": "true",
910
"icons": {
1011
"themeLight":{

common/loginpage/src/panelexternal.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@
133133
if ( panel_id.includes('\{B17BDC61\-') ) {
134134
_encrype_workaround(_panel);
135135
} else
136-
if ( panel_id.includes('F2402876-659F-47FB-A646-67B49F2B5AAA') ) {
136+
if ( panel_id.includes('F2402876-659F-47FB-A646-67B49F2B5AAA') ||
137+
panel_id.includes('9DC93CDB-B576-4F0C-B55E-FCC9C48DD777') )
138+
{
137139
const $svgicon = _panel.$menuitem.find('svg.icon');
138140
if ( $svgicon.length ) {
139141
$svgicon.data('iconname', 'aichat');

common/loginpage/src/panelrecent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
};
329329

330330
var _on_recovers = function(params) {
331-
if ( true )
331+
if ( false )
332332
window.sdk.command("recovery:update", JSON.stringify(params));
333333
else {
334334
collectionRecovers.empty();

macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#import "ASCTabView.h"
4343
#import "NSCefView.h"
4444

45-
@interface ASCCommonViewController : NSViewController
45+
@interface ASCCommonViewController : NSViewController <NSTabViewDelegate>
4646
- (BOOL)shouldTerminateApplication;
4747
- (BOOL)shouldCloseMainWindow;
4848

@@ -53,4 +53,3 @@
5353
- (void)openEULA;
5454
- (void)openPreferences;
5555
@end
56-

macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm

Lines changed: 313 additions & 267 deletions
Large diffs are not rendered by default.

macos/ONLYOFFICE/Code/Controllers/Common/ASCThemesController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static NSString * const tabSlideActiveBackgroundColor = @"tab-slide-background
5151
static NSString * const tabPdfActiveBackgroundColor = @"tab-pdf-background-active-color";
5252
static NSString * const tabDrawActiveBackgroundColor = @"tab-draw-background-active-color";
5353
static NSString * const tabActiveTextColor = @"tab-editor-text-active-color";
54+
static NSString * const windowBackgroundColor = @"window-background-color";
5455

5556
@interface ASCThemesController : NSObject
5657

macos/ONLYOFFICE/Code/Controllers/Common/ASCThemesController.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,15 @@ + (NSColor*)color:(NSString*)name forTheme:(NSString*)theme {
146146
return [NSColor colorNamed:@"tab-portal-activeColor"];
147147
else return kColorRGBA(255, 255, 255, 1.0);
148148
}
149+
} else if ( [name isEqualToString:windowBackgroundColor] ) {
150+
if ( [theme isEqualToString:uiThemeDark] ) return UIColorFromRGB(0x282828);
151+
else if ( [theme isEqualToString:uiThemeContrastDark] ) return UIColorFromRGB(0x181818);
152+
else if ( [theme isEqualToString:uiThemeGray] ) return UIColorFromRGB(0xd9d9d9);
153+
else if ( [theme isEqualToString:uiThemeNight] ) return UIColorFromRGB(0x383838);
154+
else if ( [theme isEqualToString:uiThemeWhite] ) return UIColorFromRGB(0xeaeaea);
155+
else {
156+
return UIColorFromRGB(0xe4e4e4);
157+
}
149158
} else {
150159
if ( [theme isEqualToString:uiThemeDark] ) return UIColorFromRGB(0x2a2a2a);
151160
else if ( [theme isEqualToString:uiThemeContrastDark] ) return UIColorFromRGB(0x1e1e1e);

macos/ONLYOFFICE/Code/Controllers/PresentationReporter/ASCPresentationReporter.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ - (void)destroy {
138138
return;
139139
}
140140

141-
[_controller close];
141+
[_controller.window performClose:nil];
142142
_isDisplay = false;
143143
}
144144

macos/ONLYOFFICE/Code/Extensions/NSView+Extensions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,7 @@
5959
- (instancetype)duplicate;
6060
- (void)shake;
6161
- (NSImage *)imageRepresentation;
62+
- (NSImage *)windowScreenshot;
63+
- (nullable NSView *)subviewOfClassName:(NSString * _Nonnull)className;
6264

6365
@end

macos/ONLYOFFICE/Code/Extensions/NSView+Extensions.m

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,54 @@ - (NSImage *)imageRepresentation {
265265
return image;
266266
}
267267

268+
- (nullable NSImage *)windowScreenshot {
269+
if (self.window) {
270+
NSRect viewFrameInWindow = [self convertRect:self.bounds toView:nil];
271+
NSRect windowFrame = [self.window convertRectToScreen:viewFrameInWindow];
272+
CGRect mainDisplayBounds = CGDisplayBounds(CGMainDisplayID());
273+
274+
CGFloat cgX = windowFrame.origin.x;
275+
CGFloat cgY = mainDisplayBounds.size.height - windowFrame.origin.y - windowFrame.size.height;
276+
277+
CGImageRef cgImage = CGWindowListCreateImage
278+
(
279+
CGRectMake(cgX, cgY, windowFrame.size.width, windowFrame.size.height),
280+
kCGWindowListOptionIncludingWindow,
281+
(CGWindowID)[self.window windowNumber],
282+
kCGWindowImageBoundsIgnoreFraming | kCGWindowImageShouldBeOpaque
283+
);
284+
285+
NSImage *snapshot = nil;
286+
if (cgImage) {
287+
snapshot = [[NSImage alloc] initWithCGImage:cgImage size:viewFrameInWindow.size];
288+
CGImageRelease(cgImage);
289+
}
290+
291+
return snapshot;
292+
}
293+
294+
return nil;
295+
}
296+
297+
- (nullable NSView *)subviewOfClassName:(NSString * _Nonnull)className {
298+
Class cls = NSClassFromString(className);
299+
300+
if (!cls) {
301+
return nil;
302+
}
303+
304+
for (NSView *subview in self.subviews) {
305+
if ([subview isKindOfClass:cls]) {
306+
return subview;
307+
}
308+
309+
NSView *found = [subview subviewOfClassName:className];
310+
311+
if (found) {
312+
return found;
313+
}
314+
}
315+
return nil;
316+
}
317+
268318
@end

0 commit comments

Comments
 (0)