diff --git a/bin/mac/libnst64.dylib b/bin/mac/libnst64.dylib index a6f48d5713a3..fd8a1ea6b90f 100644 Binary files a/bin/mac/libnst64.dylib and b/bin/mac/libnst64.dylib differ diff --git a/native/MacTouchBar/CMakeLists.txt b/native/MacTouchBar/CMakeLists.txt index 0062a0440d61..ceabf003eb8a 100644 --- a/native/MacTouchBar/CMakeLists.txt +++ b/native/MacTouchBar/CMakeLists.txt @@ -11,7 +11,7 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12.2) add_compile_options("-fmodules" "-flto=full" "-Wall" "-Wextra" "-Wpedantic" "-Wno-newline-eof") add_library(nst64 SHARED - src/JTypes.h src/Button.m src/Popover.m src/Scrubber.m + src/JTypes.h src/Button.m src/Scrubber.m src/ScrubberItemView.h src/ScrubberItemView.m src/TouchBar.h src/TouchBar.m src/Utils.h src/Utils.m diff --git a/native/MacTouchBar/src/Popover.m b/native/MacTouchBar/src/Popover.m deleted file mode 100644 index a6ee8dca9568..000000000000 --- a/native/MacTouchBar/src/Popover.m +++ /dev/null @@ -1,28 +0,0 @@ -#import -#import "TouchBar.h" -#import "Utils.h" - -static void _setPopoverData(NSPopoverTouchBarItem * popoverItem, int itemWidth, NSString * nstext, NSImage * img, id tbObjExpand, id tbObjTapAndHold) { - popoverItem.collapsedRepresentationImage = img; - popoverItem.collapsedRepresentationLabel = nstext; - if (itemWidth > 0) // Otherwise: create 'flexible' view - [popoverItem.collapsedRepresentation.widthAnchor constraintEqualToConstant:itemWidth].active = YES; - - popoverItem.showsCloseButton = YES; - popoverItem.popoverTouchBar = ((TouchBar*)tbObjExpand).touchBar; - popoverItem.pressAndHoldTouchBar = ((TouchBar*)tbObjTapAndHold).touchBar; -} - -// NOTE: called from AppKit-thread (creation when TB becomes visible), uses default autorelease-pool (create before event processing) -__used -NS_RETURNS_RETAINED -id createPopover(const char * uid, int itemWidth, const char * text, const char * raster4ByteRGBA, int w, int h, id tbObjExpand, id tbObjTapAndHold) { - NSString * nsUid = createStringFromUTF8(uid); - nstrace(@"create popover [%@] (thread: %@)", nsUid, [NSThread currentThread]); - - NSPopoverTouchBarItem * popoverItem = [[NSPopoverTouchBarItem alloc] initWithIdentifier:nsUid]; // create non-autorelease object to be owned by java-wrapper - NSImage * img = createImgFrom4ByteRGBA((const unsigned char *)raster4ByteRGBA, w, h); - NSString * nstext = createStringFromUTF8(text); - _setPopoverData(popoverItem, itemWidth, nstext, img, tbObjExpand, tbObjTapAndHold); - return popoverItem; -} diff --git a/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NST.java b/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NST.java index 154ea5cde9e8..0bd1dbd6da59 100644 --- a/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NST.java +++ b/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NST.java @@ -181,19 +181,6 @@ final class NST { action); // called from AppKit, uses per-event autorelease-pool } - static ID createPopover(String uid, - int itemWidth, - String text, - Icon icon, - ID tbObjExpand, - ID tbObjTapAndHold) { - final BufferedImage img = _getImg4ByteRGBA(icon); - final Pointer raster4ByteRGBA = _getRaster(img); - final int w = _getImgW(img); - final int h = _getImgH(img); - return ourNSTLibrary.createPopover(uid, itemWidth, text, raster4ByteRGBA, w, h, tbObjExpand, tbObjTapAndHold); // called from AppKit, uses per-event autorelease-pool - } - // NOTE: due to optimization scrubber is created without icons // icons must be updated async via updateScrubberItems @SuppressWarnings("unused") diff --git a/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NSTLibrary.java b/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NSTLibrary.java index bd95bdc019ae..dc97341594d1 100644 --- a/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NSTLibrary.java +++ b/platform/platform-impl/src/com/intellij/ui/mac/touchbar/NSTLibrary.java @@ -34,8 +34,6 @@ interface NSTLibrary extends Library { // creator returns non-autorelease obj to be owned by java-wrapper ID createButton(String uid, int buttWidth, int buttonFlags, String text, String hint, int isHintDisabled, Pointer raster4ByteRGBA, int w, int h, Action action); - - ID createPopover(String uid, int itemWidth, String text, Pointer raster4ByteRGBA, int w, int h, ID tbObjExpand, ID tbObjTapAndHold); ID createScrubber(String uid, int itemWidth, ScrubberDelegate delegate, ScrubberCacheUpdater updater, Pointer packedItems, int byteCount); ID createGroupItem(String uid, ID[] items, int count);