Revision: 13420
http://sourceforge.net/p/skim-app/code/13420
Author: hofman
Date: 2023-04-19 22:52:09 +0000 (Wed, 19 Apr 2023)
Log Message:
-----------
Fix touch bar for text field sheet controller
Modified Paths:
--------------
trunk/SKTextFieldSheetController.m
Modified: trunk/SKTextFieldSheetController.m
===================================================================
--- trunk/SKTextFieldSheetController.m 2023-04-19 09:42:42 UTC (rev 13419)
+++ trunk/SKTextFieldSheetController.m 2023-04-19 22:52:09 UTC (rev 13420)
@@ -38,7 +38,6 @@
#import "SKTextFieldSheetController.h"
-#define SKTouchBarItemIdentifierButtons
@"net.sourceforge.skim-app.touchbar-item.buttons"
#define SKTouchBarItemIdentifierOK
@"net.sourceforge.skim-app.touchbar-item.OK"
#define SKTouchBarItemIdentifierCancel
@"net.sourceforge.skim-app.touchbar-item.cancel"
@@ -70,7 +69,7 @@
- (NSTouchBar *)makeTouchBar {
NSTouchBar *touchBar = [[[NSClassFromString(@"NSTouchBar") alloc] init]
autorelease];
[touchBar setDelegate:self];
- [touchBar
setDefaultItemIdentifiers:@[@"NSTouchBarItemIdentifierFlexibleSpace",
SKTouchBarItemIdentifierButtons, @"NSTouchBarItemIdentifierFixedSpaceLarge"]];
+ [touchBar
setDefaultItemIdentifiers:@[@"NSTouchBarItemIdentifierFlexibleSpace",
SKTouchBarItemIdentifierOK, SKTouchBarItemIdentifierCancel,
@"NSTouchBarItemIdentifierFixedSpaceLarge"]];
return touchBar;
}
@@ -78,11 +77,13 @@
NSCustomTouchBarItem *item = nil;
if ([identifier isEqualToString:SKTouchBarItemIdentifierOK]) {
NSButton *button = [NSButton buttonWithTitle:[okButton title]
target:[okButton target] action:[okButton action]];
+ [button setTag:NSModalResponseOK];
[button setKeyEquivalent:@"\r"];
item = [[[NSClassFromString(@"NSCustomTouchBarItem") alloc]
initWithIdentifier:identifier] autorelease];
[(NSCustomTouchBarItem *)item setView:button];
} else if ([identifier isEqualToString:SKTouchBarItemIdentifierCancel]) {
NSButton *button = [NSButton buttonWithTitle:[cancelButton title]
target:[cancelButton target] action:[cancelButton action]];
+ [button setTag:NSModalResponseCancel];
item = [[[NSClassFromString(@"NSCustomTouchBarItem") alloc]
initWithIdentifier:identifier] autorelease];
[(NSCustomTouchBarItem *)item setView:button];
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit