mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-22 10:19:32 +00:00
Added UI setting to control toolbar style
This commit is contained in:
@@ -100,9 +100,17 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
[super windowDidLoad];
|
||||
|
||||
self.window.delegate = self.documentWindowDelegate;
|
||||
//self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
|
||||
if (@available(macOS 11.0, *)) {
|
||||
self.window.toolbarStyle = NSWindowToolbarStyleExpanded;
|
||||
/* let the user decide how to dipsplay the toolbar */
|
||||
BOOL useUnifiedToolbar = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyUseUnifiedToolbar];
|
||||
if(useUnifiedToolbar) {
|
||||
self.window.toolbarStyle = NSWindowToolbarStyleAutomatic;
|
||||
// Do not use full size since the sidebar takes too much room!
|
||||
// self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
|
||||
}
|
||||
else {
|
||||
self.window.toolbarStyle = NSWindowToolbarStyleExpanded;
|
||||
}
|
||||
}
|
||||
[self.window registerForDraggedTypes:@[NSURLPboardType]];
|
||||
|
||||
|
||||
@@ -94,6 +94,9 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyAllowRemoteFetchOfPluginRepository;
|
||||
/* Network */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyFaviconDownloadMethod;
|
||||
|
||||
/* UI */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyUseUnifiedToolbar;
|
||||
|
||||
typedef NS_ENUM(NSUInteger, MPFileChangeStrategy) {
|
||||
MPFileChangeStrategyAsk,
|
||||
MPFileChangeStrategyKeepMine,
|
||||
|
||||
@@ -90,6 +90,8 @@ NSString *const kMPSettingsKeyAllowRemoteFetchOfPluginRepository = @"Al
|
||||
|
||||
NSString *const kMPSettingsKeyFaviconDownloadMethod = @"FaviconDownloadMethod";
|
||||
|
||||
NSString *const kMPSettingsKeyUseUnifiedToolbar =@"UseUnifiedToolbar";
|
||||
|
||||
/* Deprecated */
|
||||
NSString *const kMPDeprecatedSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases";
|
||||
NSString *const kMPDeprecatedSettingsKeyLastDatabasePath = @"MPLastDatabasePath";
|
||||
@@ -170,7 +172,8 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au
|
||||
kMPSettingsKeyEnableAutosave: @YES,
|
||||
kMPSettingsKeyHideAfterCopyToClipboard: @NO,
|
||||
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
||||
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO
|
||||
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO,
|
||||
kMPSettingsKeyUseUnifiedToolbar: @NO // Do not use unified toolbar under Big Sur and above
|
||||
};
|
||||
});
|
||||
return standardDefaults;
|
||||
|
||||
Reference in New Issue
Block a user