diff --git a/Telegram/SourceFiles/chat_helpers/field_autocomplete.h b/Telegram/SourceFiles/chat_helpers/field_autocomplete.h index 69127992c9..94a7578f4c 100644 --- a/Telegram/SourceFiles/chat_helpers/field_autocomplete.h +++ b/Telegram/SourceFiles/chat_helpers/field_autocomplete.h @@ -11,7 +11,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/rp_widget.h" #include "base/timer.h" #include "base/object_ptr.h" -#include "data/stickers/data_stickers.h" namespace Ui { class ScrollArea; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 89879b90bc..1f0148fbb6 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -44,6 +44,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "data/data_scheduled_messages.h" #include "data/data_file_origin.h" #include "data/data_histories.h" +#include "data/stickers/data_stickers.h" #include "history/history.h" #include "history/history_item.h" #include "history/history_message.h" diff --git a/Telegram/SourceFiles/platform/mac/mac_touchbar.h b/Telegram/SourceFiles/platform/mac/mac_touchbar.h index 931face15b..979e054e7e 100644 --- a/Telegram/SourceFiles/platform/mac/mac_touchbar.h +++ b/Telegram/SourceFiles/platform/mac/mac_touchbar.h @@ -1,10 +1,13 @@ /* - This file is part of Telegram Desktop, - the official desktop application for the Telegram messaging service. +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#pragma once + +#ifndef OS_OSX #include "platform/platform_specific.h" #include "media/audio/media_audio.h" @@ -12,13 +15,15 @@ #import namespace Platform { + enum class TouchBarType { None, Main, AudioPlayer, AudioPlayerForce, }; -} // namespace + +} // namespace Platform @interface TouchBar : NSTouchBar @@ -31,3 +36,5 @@ enum class TouchBarType { - (void) showInputFieldItem:(bool)show; @end + +#endif // OS_OSX diff --git a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm index 7ffdc970e3..cf5c06f1d5 100644 --- a/Telegram/SourceFiles/platform/mac/mac_touchbar.mm +++ b/Telegram/SourceFiles/platform/mac/mac_touchbar.mm @@ -1,13 +1,13 @@ /* - This file is part of Telegram Desktop, - the official desktop application for the Telegram messaging service. +This file is part of Telegram Desktop, +the official desktop application for the Telegram messaging service. - For license and copyright information please follow this link: - https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL - */ +For license and copyright information please follow this link: +https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL +*/ +#include "platform/mac/mac_touchbar.h" -#import "mac_touchbar.h" -#import +#ifndef OS_OSX #include "api/api_sending.h" #include "apiwrap.h" @@ -49,6 +49,8 @@ #include "window/window_controller.h" #include "window/window_session_controller.h" +#import + NSImage *qt_mac_create_nsimage(const QPixmap &pm); namespace { @@ -1907,3 +1909,5 @@ void AppendEmojiPacks( } @end // @implementation TouchBar + +#endif // OS_OSX diff --git a/Telegram/SourceFiles/platform/mac/main_window_mac.mm b/Telegram/SourceFiles/platform/mac/main_window_mac.mm index 449fb0fbc5..4f864f0a2c 100644 --- a/Telegram/SourceFiles/platform/mac/main_window_mac.mm +++ b/Telegram/SourceFiles/platform/mac/main_window_mac.mm @@ -144,9 +144,9 @@ public: void didExitFullScreen(); bool clipboardHasText(); - +#ifndef OS_OSX TouchBar *_touchBar = nil; - +#endif // OS_OSX ~Private(); private: @@ -475,6 +475,7 @@ MainWindow::MainWindow(not_null controller) } void MainWindow::initTouchBar() { +#ifndef OS_OSX if (!IsMac10_13OrGreater()) { return; } @@ -502,14 +503,17 @@ void MainWindow::initTouchBar() { destroyCurrentTouchBar(); } }, lifetime()); +#endif // OS_OSX } void MainWindow::destroyCurrentTouchBar() { +#ifndef OS_OSX if (_private->_touchBar) { [_private->_touchBar setTouchBar:Platform::TouchBarType::None]; [_private->_touchBar release]; } _private->_touchBar = nil; +#endif // OS_OSX } void MainWindow::closeWithoutDestroy() { @@ -831,9 +835,13 @@ void MainWindow::updateGlobalMenuHook() { canCopy = list->canCopySelected(); canDelete = list->canDeleteSelected(); } + +#ifndef OS_OSX if (_private->_touchBar) { [_private->_touchBar showInputFieldItem:showTouchBarItem]; } +#endif // OS_OSX + App::wnd()->updateIsActive(); const auto logged = (sessionController() != nullptr); const auto inactive = !logged || controller().locked();