From 30bd18e1886d12adb8fb36c02a93ad20b7b092ac Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 4 May 2018 00:03:53 +0200 Subject: Fix a little UI issue with a clipped back/forward button --- Source/SPDatabaseDocument.h | 4 ++-- Source/SPDatabaseDocument.m | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/SPDatabaseDocument.h b/Source/SPDatabaseDocument.h index ebc6092b..20fb34d1 100644 --- a/Source/SPDatabaseDocument.h +++ b/Source/SPDatabaseDocument.h @@ -149,9 +149,9 @@ IBOutlet id renameDatabaseMessageField; IBOutlet id renameDatabaseButton; - IBOutlet id chooseDatabaseButton; + IBOutlet NSPopUpButton *chooseDatabaseButton; #ifndef SP_CODA - IBOutlet id historyControl; + IBOutlet NSSegmentedControl *historyControl; IBOutlet NSTabView *tableTabView; IBOutlet NSTableView *tableInfoTable; diff --git a/Source/SPDatabaseDocument.m b/Source/SPDatabaseDocument.m index 3a079883..ad7a2614 100644 --- a/Source/SPDatabaseDocument.m +++ b/Source/SPDatabaseDocument.m @@ -4070,6 +4070,10 @@ static int64_t SPDatabaseDocumentInstanceCounter = 0; } else if ([itemIdentifier isEqualToString:SPMainToolbarHistoryNavigation]) { [toolbarItem setLabel:NSLocalizedString(@"Table History", @"toolbar item for navigation history")]; [toolbarItem setPaletteLabel:[toolbarItem label]]; + // At some point after 10.9 the sizing of NSSegmentedControl changed, resulting in clipping in newer OS X versions. + // We can't just adjust the XIB, because then it would be wrong for older versions (possibly resulting in drawing artifacts), + // so we have the OS determine the proper size at runtime. + [historyControl sizeToFit]; [toolbarItem setView:historyControl]; } else if ([itemIdentifier isEqualToString:SPMainToolbarShowConsole]) { -- cgit v1.2.3