adjust touchbar layout when both reset and f1 menu are disabled

This commit is contained in:
Struma 2022-07-05 05:48:34 -04:00
parent 0ec885e640
commit 97e4314a87

View file

@ -52,12 +52,17 @@ MKXPZTouchBar *_sharedTouchBar;
bool showReset = [showResetButton boolValue];
bool showSettings = [showSettingsButton boolValue];
NSMutableArray *items = [NSMutableArray arrayWithArray:@[@"function", NSTouchBarItemIdentifierFlexibleSpace, @"icon", @"fps"]];
NSMutableArray *items = [NSMutableArray arrayWithArray:@[@"function", NSTouchBarItemIdentifierFlexibleSpace]];
if (showReset || showSettings) {
[items addObject:@"icon"];
[items addObject:@"fps"];
[items addObject:NSTouchBarItemIdentifierFlexibleSpace];
if (showReset) [items addObject:@"reset"];
if (showSettings) [items addObject:@"rebind"];
} else {
[items addObject:@"fps"];
[items addObject:@"icon"];
}
self.defaultItemIdentifiers = items;