Fix build on macOS.

This commit is contained in:
John Preston 2021-02-26 21:17:54 +04:00
parent 72704b2426
commit b38d6667c4
1 changed files with 3 additions and 2 deletions

View File

@ -14,6 +14,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "styles/style_window.h"
#include "styles/style_media_view.h"
#include "platform/platform_main_window.h"
#include "window/window_controller.h"
#include <Cocoa/Cocoa.h>
#include <CoreFoundation/CFURL.h>
@ -73,7 +74,7 @@ void TitleWidget::mouseDoubleClickEvent(QMouseEvent *e) {
}
object_ptr<Window::TitleWidget> CreateTitleWidget(QWidget *parent) {
if (auto window = Core::App().activeWindow()) {
if (auto window = qobject_cast<Platform::MainWindow*>(parent)) {
if (auto height = window->getCustomTitleHeight()) {
return object_ptr<TitleWidget>(window, height);
}
@ -86,7 +87,7 @@ object_ptr<Window::TitleWidget> CreateTitleWidget(QWidget *parent) {
// how it will look in real launched macOS app.
int PreviewTitleHeight() {
if (auto window = Core::App().activeWindow()) {
if (auto height = window->getCustomTitleHeight()) {
if (auto height = window->widget()->getCustomTitleHeight()) {
return height;
}
}