mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 08:18:18 +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];
|
[super windowDidLoad];
|
||||||
|
|
||||||
self.window.delegate = self.documentWindowDelegate;
|
self.window.delegate = self.documentWindowDelegate;
|
||||||
//self.window.styleMask |= NSWindowStyleMaskFullSizeContentView;
|
|
||||||
if (@available(macOS 11.0, *)) {
|
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]];
|
[self.window registerForDraggedTypes:@[NSURLPboardType]];
|
||||||
|
|
||||||
|
|||||||
@@ -94,6 +94,9 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyAllowRemoteFetchOfPluginRepository;
|
|||||||
/* Network */
|
/* Network */
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyFaviconDownloadMethod;
|
APPKIT_EXTERN NSString *const kMPSettingsKeyFaviconDownloadMethod;
|
||||||
|
|
||||||
|
/* UI */
|
||||||
|
APPKIT_EXTERN NSString *const kMPSettingsKeyUseUnifiedToolbar;
|
||||||
|
|
||||||
typedef NS_ENUM(NSUInteger, MPFileChangeStrategy) {
|
typedef NS_ENUM(NSUInteger, MPFileChangeStrategy) {
|
||||||
MPFileChangeStrategyAsk,
|
MPFileChangeStrategyAsk,
|
||||||
MPFileChangeStrategyKeepMine,
|
MPFileChangeStrategyKeepMine,
|
||||||
|
|||||||
@@ -90,6 +90,8 @@ NSString *const kMPSettingsKeyAllowRemoteFetchOfPluginRepository = @"Al
|
|||||||
|
|
||||||
NSString *const kMPSettingsKeyFaviconDownloadMethod = @"FaviconDownloadMethod";
|
NSString *const kMPSettingsKeyFaviconDownloadMethod = @"FaviconDownloadMethod";
|
||||||
|
|
||||||
|
NSString *const kMPSettingsKeyUseUnifiedToolbar =@"UseUnifiedToolbar";
|
||||||
|
|
||||||
/* Deprecated */
|
/* Deprecated */
|
||||||
NSString *const kMPDeprecatedSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases";
|
NSString *const kMPDeprecatedSettingsKeyRememberKeyFilesForDatabases = @"kMPSettingsKeyRememberKeyFilesForDatabases";
|
||||||
NSString *const kMPDeprecatedSettingsKeyLastDatabasePath = @"MPLastDatabasePath";
|
NSString *const kMPDeprecatedSettingsKeyLastDatabasePath = @"MPLastDatabasePath";
|
||||||
@@ -170,7 +172,8 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au
|
|||||||
kMPSettingsKeyEnableAutosave: @YES,
|
kMPSettingsKeyEnableAutosave: @YES,
|
||||||
kMPSettingsKeyHideAfterCopyToClipboard: @NO,
|
kMPSettingsKeyHideAfterCopyToClipboard: @NO,
|
||||||
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
||||||
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO
|
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO,
|
||||||
|
kMPSettingsKeyUseUnifiedToolbar: @NO // Do not use unified toolbar under Big Sur and above
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
return standardDefaults;
|
return standardDefaults;
|
||||||
|
|||||||
Reference in New Issue
Block a user