mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-12-03 15:48:48 +03:00
Remove manual menu bar mangling on macos
This is causing probably more issues nowadays than it fixes. Qt should be adding those menus for us now, so let's remove it and see, what breaks!
This commit is contained in:
parent
cc4ace3c12
commit
048af42780
4 changed files with 2 additions and 47 deletions
|
@ -648,9 +648,9 @@ qt_add_resources(QRC resources/res.qrc)
|
|||
|
||||
if(APPLE)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Foundation -framework Cocoa -framework UserNotifications")
|
||||
set(SRC_FILES ${SRC_FILES} src/notifications/NotificationManagerProxy.h src/notifications/MacNotificationDelegate.h src/notifications/MacNotificationDelegate.mm src/notifications/ManagerMac.mm src/notifications/ManagerMac.cpp src/emoji/MacHelper.mm src/emoji/MacHelper.h)
|
||||
set(SRC_FILES ${SRC_FILES} src/notifications/NotificationManagerProxy.h src/notifications/MacNotificationDelegate.h src/notifications/MacNotificationDelegate.mm src/notifications/ManagerMac.mm src/notifications/ManagerMac.cpp)
|
||||
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
|
||||
set_source_files_properties( src/notifications/NotificationManagerProxy.h src/notifications/MacNotificationDelegate.h src/notifications/MacNotificationDelegate.mm src/notifications/ManagerMac.mm src/emoji/MacHelper.mm src/emoji/MacHelper.h PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||
set_source_files_properties( src/notifications/NotificationManagerProxy.h src/notifications/MacNotificationDelegate.h src/notifications/MacNotificationDelegate.mm src/notifications/ManagerMac.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
|
||||
endif()
|
||||
elseif(WIN32)
|
||||
file(DOWNLOAD
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
// SPDX-FileCopyrightText: Nheko Contributors
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMenuBar>
|
||||
|
||||
class MacHelper
|
||||
{
|
||||
public:
|
||||
static void showEmojiWindow();
|
||||
static void initializeMenus();
|
||||
};
|
|
@ -1,26 +0,0 @@
|
|||
#include "MacHelper.h"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <QCoreApplication>
|
||||
|
||||
void
|
||||
MacHelper::showEmojiWindow()
|
||||
{
|
||||
NSApplication *theNSApplication = [NSApplication sharedApplication];
|
||||
[theNSApplication orderFrontCharacterPalette:nil];
|
||||
}
|
||||
|
||||
void
|
||||
MacHelper::initializeMenus()
|
||||
{
|
||||
NSApplication *theNSApplication = [NSApplication sharedApplication];
|
||||
|
||||
NSArray<NSMenuItem *> *menus = [theNSApplication mainMenu].itemArray;
|
||||
NSUInteger size = menus.count;
|
||||
for (NSUInteger i = 0; i < size; i++) {
|
||||
NSMenuItem *item = [menus objectAtIndex:i];
|
||||
[item setTitle:@"Edit"];
|
||||
}
|
||||
}
|
|
@ -37,7 +37,6 @@
|
|||
#include "config/nheko.h"
|
||||
|
||||
#if defined(Q_OS_MACOS)
|
||||
#include "emoji/MacHelper.h"
|
||||
#include "notifications/Manager.h"
|
||||
#endif
|
||||
|
||||
|
@ -466,10 +465,6 @@ main(int argc, char *argv[])
|
|||
QStringLiteral("matrix"), ChatPage::instance(), "handleMatrixUri");
|
||||
|
||||
#if defined(Q_OS_MACOS)
|
||||
// Temporary solution for the emoji picker until
|
||||
// nheko has a proper menu bar with more functionality.
|
||||
MacHelper::initializeMenus();
|
||||
|
||||
// Need to set up notification delegate so users can respond to messages from within the
|
||||
// notification itself.
|
||||
NotificationsManager::attachToMacNotifCenter();
|
||||
|
|
Loading…
Reference in a new issue