mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
touchbar: code cleanup
This commit is contained in:
@@ -377,8 +377,8 @@ void updateButton(
|
||||
const char *raster4ByteRGBA, int w, int h,
|
||||
execute jaction
|
||||
) {
|
||||
NSCustomTouchBarItem *container = buttObj; // TODO: check types
|
||||
NSButtonJAction *button = (container).view; // TODO: check types
|
||||
NSCustomTouchBarItem *container = buttObj;
|
||||
NSButtonJAction *button = (container).view;
|
||||
|
||||
NSAutoreleasePool *edtPool = [NSAutoreleasePool new];
|
||||
NSImage *img = createImgFrom4ByteRGBA((const unsigned char *) raster4ByteRGBA, w, h);
|
||||
@@ -401,8 +401,8 @@ void updateButton(
|
||||
|
||||
// NOTE: now is called from AppKit-thread (creation when TB becomes visible), but can be called from EDT (when update UI)
|
||||
void setArrowImage(id buttObj, const char *raster4ByteRGBA, int w, int h) {
|
||||
NSCustomTouchBarItem *container = buttObj; // TODO: check types
|
||||
NSButtonJAction *button = (container).view; // TODO: check types
|
||||
NSCustomTouchBarItem *container = buttObj;
|
||||
NSButtonJAction *button = (container).view;
|
||||
NSAutoreleasePool *edtPool = [NSAutoreleasePool new];
|
||||
|
||||
NSImage *img = nil;
|
||||
|
||||
@@ -27,7 +27,7 @@ id createPopover(const char * uid, int itemWidth, const char * text, const char
|
||||
|
||||
// NOTE: called from EDT (when update UI)
|
||||
void updatePopover(id popoverObj, int itemWidth, const char * text, const char * raster4ByteRGBA, int w, int h, id tbObjExpand, id tbObjTapAndHold) {
|
||||
NSPopoverTouchBarItem * popoverItem = popoverObj; // TODO: check types
|
||||
NSPopoverTouchBarItem * popoverItem = popoverObj;
|
||||
nstrace(@"async update popover [%@] (thread: %@)", popoverItem.identifier, [NSThread currentThread]);
|
||||
NSAutoreleasePool * edtPool = [[NSAutoreleasePool alloc] init];
|
||||
NSImage * img = createImgFrom4ByteRGBA((const unsigned char *)raster4ByteRGBA, w, h);
|
||||
|
||||
@@ -59,7 +59,7 @@ void selectItemsToShow(id touchBar, const char** ppIds, int count) {
|
||||
[all addObject:nsId];
|
||||
}
|
||||
|
||||
TouchBar * tb = (TouchBar *)touchBar; // TODO: check types
|
||||
TouchBar * tb = (TouchBar *)touchBar;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[tb.touchBar setDefaultItemIdentifiers:all];
|
||||
});
|
||||
@@ -76,7 +76,7 @@ id createTouchBar(const char * name, createItem jcreator, const char * escId) {
|
||||
|
||||
void setPrincipal(id tbobj, const char * uid) {
|
||||
NSAutoreleasePool * edtPool = [[NSAutoreleasePool alloc] init];
|
||||
TouchBar * tb = (TouchBar *)tbobj; // TODO: check types
|
||||
TouchBar * tb = (TouchBar *)tbobj;
|
||||
[tb.touchBar setPrincipalItemIdentifier:createStringFromUTF8(uid)];
|
||||
[edtPool release];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user