mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-20 02:00:55 +07:00
fix build macos
This commit is contained in:
+19
-18
@@ -287,25 +287,8 @@ if(WIN32 OR (APPLE AND NOT IOS AND NOT MACOS_NE) OR (LINUX AND NOT ANDROID))
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(HEADERS ${HEADERS}
|
||||
${CLIENT_ROOT_DIR}/platforms/windows/windowsutils.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
${CLIENT_ROOT_DIR}/platforms/windows/windowsutils.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
set(HEADERS ${HEADERS}
|
||||
${CLIENT_ROOT_DIR}/platforms/linux/linuxutils.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
${CLIENT_ROOT_DIR}/platforms/linux/linuxutils.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(APPLE AND MACOS_NE)
|
||||
# Include only the tray notification handler in NE builds
|
||||
set(HEADERS ${HEADERS}
|
||||
${CLIENT_ROOT_DIR}/ui/utils/systemTrayNotificationHandler.h
|
||||
${CLIENT_ROOT_DIR}/ui/utils/platformTheme.h
|
||||
@@ -316,3 +299,21 @@ if(APPLE AND MACOS_NE)
|
||||
${CLIENT_ROOT_DIR}/ui/utils/platformTheme.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(HEADERS ${HEADERS}
|
||||
${CLIENT_ROOT_DIR}/platforms/windows/windowsutils.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
${CLIENT_ROOT_DIR}/platforms/windows/windowsutils.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
set(HEADERS ${HEADERS}
|
||||
${CLIENT_ROOT_DIR}/platforms/linux/linuxutils.h
|
||||
)
|
||||
set(SOURCES ${SOURCES}
|
||||
${CLIENT_ROOT_DIR}/platforms/linux/linuxutils.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -38,6 +38,8 @@
|
||||
@interface MacOSStatusIconDelegate : NSObject
|
||||
@property(assign) NSStatusItem* statusItem;
|
||||
@property(assign) NSView* statusIndicator;
|
||||
@property(retain) NSMenu* nativeMenu;
|
||||
@property(retain) NSMutableArray* menuActionTargets;
|
||||
|
||||
- (void)setIcon:(NSData*)imageData;
|
||||
- (void)setIndicator;
|
||||
@@ -204,6 +206,17 @@ void MacOSStatusIcon::setIcon(const QString& iconPath) {
|
||||
[m_statusBarIcon setIcon:imageResource.uncompressedData().toNSData()];
|
||||
}
|
||||
|
||||
void MacOSStatusIcon::setIconFromData(const QByteArray& imageData) {
|
||||
logger.debug() << "Set icon from rendered data";
|
||||
|
||||
if (imageData.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSData* data = [NSData dataWithBytes:imageData.constData() length:imageData.size()];
|
||||
[m_statusBarIcon setIcon:data];
|
||||
}
|
||||
|
||||
void MacOSStatusIcon::setIndicatorColor(const QColor& indicatorColor) {
|
||||
logger.debug() << "Set indicator color";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user