Merge branch 'develop'

This commit is contained in:
Maxim Kadushkin
2017-07-03 15:09:57 +03:00
5 changed files with 47 additions and 18 deletions

View File

@ -1694,9 +1694,10 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Developer ID Application";
CODE_SIGN_IDENTITY = "Mac Developer";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer: Alexander Yuzhin (48KSML6N7L)";
COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = 6YRY82J794;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/../../core/build/cef/mac",

View File

@ -96,16 +96,18 @@
}
- (void)application:(NSApplication *)sender openFiles:(NSArray<NSString *> *)filenames {
for (NSString * filePath in filenames) {
[[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameCreateTab
object:nil
userInfo:@{
@"action" : @(ASCTabActionOpenLocalFile),
@"path" : filePath,
@"active" : @(YES),
@"external": @(YES)
}];
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
for (NSString * filePath in filenames) {
[[NSNotificationCenter defaultCenter] postNotificationName:CEFEventNameCreateTab
object:nil
userInfo:@{
@"action" : @(ASCTabActionOpenLocalFile),
@"path" : filePath,
@"active" : @(YES),
@"external": @(YES)
}];
}
});
}
- (void)applicationWillTerminate:(NSNotification *)aNotification {

View File

@ -113,7 +113,7 @@ static float kASCWindowMinTitleWidth = 320;
[self.titleLabel setStringValue:productName];
kASCWindowDefaultTrafficButtonsLeftMargin = NSWidth(self.closeButton.frame) - 2; // OSX 10.11 magic
kASCWindowDefaultTrafficButtonsLeftMargin = NSWidth(self.closeButton.frame) - 2.0; // OSX 10.11 magic
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(windowDidResize:)
@ -183,8 +183,8 @@ static float kASCWindowMinTitleWidth = 320;
void (^layoutStandartButtons)(NSArray *, BOOL) = ^ (NSArray *buttons, BOOL hidden) {
[buttons enumerateObjectsUsingBlock:^(NSButton *button, NSUInteger idx, BOOL *stop) {
NSRect frame = button.frame;
frame.origin.x = kASCWindowDefaultTrafficButtonsLeftMargin + idx * (NSWidth(frame) + 6);
frame.origin.y = (NSHeight(button.superview.frame) - NSHeight(button.frame)) / 2;
frame.origin.x = kASCWindowDefaultTrafficButtonsLeftMargin + idx * (NSWidth(frame) + 6.0);
frame.origin.y = (int)((NSHeight(button.superview.frame) - NSHeight(button.frame)) / 2.0);
[button setFrame:frame];
[button setHidden:hidden];

View File

@ -8,7 +8,9 @@
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array/>
<array>
<string>docx</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file-docx</string>
<key>CFBundleTypeName</key>
@ -21,6 +23,10 @@
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>rtf</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file-rtf</string>
<key>CFBundleTypeName</key>
@ -33,6 +39,10 @@
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file-txt</string>
<key>CFBundleTypeName</key>
@ -45,6 +55,10 @@
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pdf</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file-pdf</string>
<key>CFBundleTypeName</key>
@ -57,6 +71,10 @@
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>xlsx</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file-xlsx</string>
<key>CFBundleTypeName</key>
@ -69,6 +87,10 @@
</array>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>pptx</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>file-pptx</string>
<key>CFBundleTypeName</key>
@ -238,11 +260,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.3</string>
<string>4.3.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>153</string>
<string>161</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>

View File

@ -261,6 +261,9 @@ QString Utils::encodeJson(const QString& s)
unsigned Utils::getScreenDpiRatio(int scrnum)
{
#ifdef __linux
double _k = _k = QApplication::primaryScreen()->logicalDotsPerInch() / 96.f;
#else
UINT _dpi_x = 0,
_dpi_y = 0;
double _k;
@ -270,6 +273,7 @@ unsigned Utils::getScreenDpiRatio(int scrnum)
} else {
_k = QApplication::primaryScreen()->logicalDotsPerInch() / 96.f;
}
#endif
return !(_k < 1.5) ? 2 : 1;
}
@ -295,7 +299,7 @@ unsigned Utils::getScreenDpiRatioByHWND(int hwnd)
QByteArray Utils::getAppStylesheets(int scale)
{
auto read_styles = [](QString& dir) {
auto read_styles = [](const QString& dir) {
QByteArray _css;
QFile file;
QFileInfoList files = QDir(dir).entryInfoList(QStringList("*.qss"), QDir::Files);