From 994aff232c2ac2d16cc3c8a5fca1dfa3383af064 Mon Sep 17 00:00:00 2001 From: Riccardo Date: Wed, 18 Aug 2021 19:16:05 +0200 Subject: [PATCH 1/4] Revert "Centered information panel." --- PCInfoController.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PCInfoController.m b/PCInfoController.m index 0294bcb..fee1c2f 100644 --- a/PCInfoController.m +++ b/PCInfoController.m @@ -61,7 +61,7 @@ // PCLogError(self, @"error loading Menu NIB file!"); return; } - [infoWindow center]; + [infoWindow makeKeyAndOrderFront:self]; [versionField setStringValue:[NSString stringWithFormat:@"Version %@", [infoDict objectForKey:@"ApplicationRelease"]]]; From d49d4d6e5f1407289e69ff9ad2141f92152fa4d6 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Wed, 18 Aug 2021 23:11:45 +0200 Subject: [PATCH 2/4] cleanup inforpanel init and proper centering --- ChangeLog | 5 +++++ PCInfoController.m | 29 +++++++---------------------- 2 files changed, 12 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08746cb..4677521 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2021-08-18 Riccardo Mottola + + * PCInfoContronoller.m + Center info panel correctly the first time on load. + 2021-08-10 Gregory John Casamento * Framework/PCEditorManager.m: Add method -gotoFile:atLine: diff --git a/PCInfoController.m b/PCInfoController.m index fee1c2f..15c15e3 100644 --- a/PCInfoController.m +++ b/PCInfoController.m @@ -37,6 +37,13 @@ infoDict = [NSDictionary dictionaryWithContentsOfFile:file]; RETAIN(infoDict); + + if ([NSBundle loadNibNamed:@"Info" owner:self] == NO) + { + return nil; + } + [versionField setStringValue:[NSString stringWithFormat:@"Version %@", [infoDict objectForKey:@"ApplicationRelease"]]]; + [infoWindow center]; } return self; @@ -56,29 +63,7 @@ - (void)showInfoWindow:(id)sender { - if ([NSBundle loadNibNamed:@"Info" owner:self] == NO) - { -// PCLogError(self, @"error loading Menu NIB file!"); - return; - } - [infoWindow makeKeyAndOrderFront:self]; - [versionField setStringValue:[NSString stringWithFormat:@"Version %@", [infoDict objectForKey:@"ApplicationRelease"]]]; - -/*#if defined(GNUSTEP) - if (!infoWindow) - { - infoWindow = [[GSInfoPanel alloc] initWithDictionary:infoDict]; - } - - [infoWindow setTitle:@"Info"]; - [infoWindow center]; - [infoWindow makeKeyAndOrderFront:self]; -#else - NSRunAlertPanel(@"Info", - @"OPENSTEP has no support for GSInfoPanel", - @"OK",nil,nil,nil); -#endif*/ } @end From b3fa5f19495ee7e87fa6f280771089d7970a7083 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 19 Aug 2021 14:50:58 +0200 Subject: [PATCH 3/4] turn off ligatures in the code editor --- ChangeLog | 6 ++++++ Modules/Editors/ProjectCenter/PCEditor.m | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4677521..5f24604 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2021-08-18 Riccardo Mottola + + * Modules/Editors/ProjectCenter/PCEditor.m + Turn off ligatures, both when setting up the editor as well as when + loading a file. + 2021-08-18 Riccardo Mottola * PCInfoContronoller.m diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index add31b3..750612d 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -170,6 +170,7 @@ tSelCol, NSForegroundColorAttributeName, nil]; [ev setSelectedTextAttributes:selAttributes]; + [ev turnOffLigatures:self]; // Activate undo [ev setAllowsUndo: YES]; @@ -321,6 +322,8 @@ [attributes setObject:font forKey:NSFontAttributeName]; [attributes setObject:textBackground forKey:NSBackgroundColorAttributeName]; [attributes setObject:[prefs colorForKey:EditorForegroundColor defaultValue:textColor] forKey:NSForegroundColorAttributeName]; + [attributes setObject:[NSNumber numberWithInt: 0] // disable ligatures + forKey:NSLigatureAttributeName]; text = [NSString stringWithContentsOfFile:_path]; attributedString = [attributedString initWithString:text attributes:attributes]; From b701d1a40b1fecb3cdc2078683439f738f90d9ea Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 19 Aug 2021 14:57:24 +0200 Subject: [PATCH 4/4] also keep ligatures off when reverting --- Modules/Editors/ProjectCenter/PCEditor.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/Editors/ProjectCenter/PCEditor.m b/Modules/Editors/ProjectCenter/PCEditor.m index 750612d..3732c78 100644 --- a/Modules/Editors/ProjectCenter/PCEditor.m +++ b/Modules/Editors/ProjectCenter/PCEditor.m @@ -766,7 +766,11 @@ // This is temporary ft = [NSFont userFixedPitchFontOfSize:0.0]; - at = [NSDictionary dictionaryWithObject:ft forKey:NSFontAttributeName]; + at = [NSDictionary dictionaryWithObjectsAndKeys: + ft, NSFontAttributeName, + [NSNumber numberWithInt: 0], NSLigatureAttributeName, + nil]; + as = [[NSAttributedString alloc] initWithString:text attributes:at]; [self setIsEdited:NO];