mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Fix deprecated declarations warnings on macOS
This commit is contained in:
parent
96ef82272b
commit
1940edd6ee
2 changed files with 6 additions and 3 deletions
|
@ -226,7 +226,7 @@ MainWindow::MainWindow(not_null<Window::Controller*> controller)
|
|||
void MainWindow::closeWithoutDestroy() {
|
||||
NSWindow *nsWindow = [reinterpret_cast<NSView*>(winId()) window];
|
||||
|
||||
auto isFullScreen = (([nsWindow styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);
|
||||
auto isFullScreen = (([nsWindow styleMask] & NSWindowStyleMaskFullScreen) == NSWindowStyleMaskFullScreen);
|
||||
if (isFullScreen) {
|
||||
_hideAfterFullScreenTimer.callOnce(kHideAfterFullscreenTimeoutMs);
|
||||
[nsWindow toggleFullScreen:nsWindow];
|
||||
|
@ -266,7 +266,7 @@ bool MainWindow::preventsQuit(Core::QuitReason reason) {
|
|||
// chromium.org/developers/design-documents/confirm-to-quit-experiment
|
||||
return (reason == Core::QuitReason::QtQuitEvent)
|
||||
&& Core::App().settings().macWarnBeforeQuit()
|
||||
&& ([[NSApp currentEvent] type] == NSKeyDown)
|
||||
&& ([[NSApp currentEvent] type] == NSEventTypeKeyDown)
|
||||
&& !Platform::ConfirmQuit::RunModal(
|
||||
tr::lng_mac_hold_to_quit(
|
||||
tr::now,
|
||||
|
|
|
@ -266,7 +266,10 @@ void SetApplicationIcon(const QIcon &icon) {
|
|||
void objc_debugShowAlert(const QString &str) {
|
||||
@autoreleasepool {
|
||||
|
||||
[[NSAlert alertWithMessageText:@"Debug Message" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"%@", Q2NSString(str)] runModal];
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
alert.messageText = @"Debug Message";
|
||||
alert.informativeText = Q2NSString(str);
|
||||
[alert runModal];
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue