From 757e0e6335532bb8058ff11479de9f9ec03356c7 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 4 May 2019 13:22:21 +0300 Subject: [PATCH] Slightly refactored, removed archive button. --- Telegram/SourceFiles/platform/mac/touchbar.mm | 32 ++++--------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/Telegram/SourceFiles/platform/mac/touchbar.mm b/Telegram/SourceFiles/platform/mac/touchbar.mm index cdff336c9a..aedcda5274 100644 --- a/Telegram/SourceFiles/platform/mac/touchbar.mm +++ b/Telegram/SourceFiles/platform/mac/touchbar.mm @@ -9,29 +9,17 @@ #import "touchbar.h" #import -#include "mainwindow.h" -#include "mainwidget.h" -#include "core/sandbox.h" -#include "core/application.h" -#include "core/crash_reports.h" -#include "storage/localstorage.h" -#include "media/audio/media_audio.h" -#include "media/player/media_player_instance.h" -#include "media/view/media_view_playback_progress.h" -#include "media/audio/media_audio.h" -#include "platform/mac/mac_utilities.h" -#include "platform/platform_specific.h" -#include "lang/lang_keys.h" -#include "base/timer.h" -#include "styles/style_window.h" #include "auth_session.h" +#include "core/application.h" +#include "core/sandbox.h" +#include "data/data_folder.h" #include "data/data_session.h" #include "history/history.h" -#include "ui/empty_userpic.h" +#include "mainwidget.h" +#include "mainwindow.h" #include "observer_peer.h" -#include "styles/style_dialogs.h" #include "styles/style_media_player.h" -#include "data/data_folder.h" +#include "ui/empty_userpic.h" namespace { //https://developer.apple.com/design/human-interface-guidelines/macos/touch-bar/touch-bar-icons-and-images/ @@ -223,9 +211,6 @@ auto lifetime = rpl::lifetime(); @interface TouchBar() @end // @interface TouchBar -@interface TouchBar() -@end - @implementation TouchBar - (id) init:(NSView *)view { @@ -306,13 +291,10 @@ NSImage *createImageFromStyleIcon(const style::icon &icon, NSSize size) { - (void) createTouchBar { _touchBarMain = [[NSTouchBar alloc] init]; _touchBarMain.delegate = self; - - _touchBarMain.customizationIdentifier = customIDMain; _touchBarMain.defaultItemIdentifiers = @[pinnedPanel]; _touchBarAudioPlayer = [[NSTouchBar alloc] init]; _touchBarAudioPlayer.delegate = self; - _touchBarAudioPlayer.customizationIdentifier = customID; _touchBarAudioPlayer.defaultItemIdentifiers = @[play, previousItem, nextItem, seekBar, closePlayer]; _touchBarAudioPlayer.customizationAllowedItemIdentifiers = @[play, previousItem, @@ -351,7 +333,7 @@ NSImage *createImageFromStyleIcon(const style::icon &icon, NSSize size) { NSCustomTouchBarItem *item = [[NSCustomTouchBarItem alloc] initWithIdentifier:identifier]; NSMutableArray *pins = [[NSMutableArray alloc] init]; - for (auto i = kArchiveId; i <= Global::PinnedDialogsCountMax(); i++) { + for (auto i = kSavedMessagesId; i <= Global::PinnedDialogsCountMax(); i++) { [pins addObject:[[PinnedDialogButton alloc] init:i].view]; } NSStackView *stackView = [NSStackView stackViewWithViews:[pins copy]];