Skip to content

Commit

Permalink
Allow more freedom of window resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhduytran0 committed May 29, 2024
1 parent fb65ba5 commit bc31c3a
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions TweakSB.x
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ static uint16_t forcePadIdiom = 0;
}
%end

/*
%hook SBFloatingDockView
- (CGFloat)contentHeightForBounds:(CGRect)frame {
if (frame.size.width > frame.size.height) {
CGFloat width = frame.size.height;
frame.size.height = frame.size.width;
frame.size.width = width;
}
return %orig;
}
%end
*/

// Enable Medusa multitasking (three-dots) button on top
%hook SBFullScreenSwitcherLiveContentOverlayCoordinator
-(void)layoutStateTransitionCoordinator:(id)arg1 transitionDidBeginWithTransitionContext:(id)arg2 {
Expand All @@ -86,6 +99,29 @@ static uint16_t forcePadIdiom = 0;
}
%end

// Min width and height are 150, smaller may crash the app
%hook SBSwitcherChamoisLayoutAttributes
- (void)setGridWidths:(NSArray<NSNumber *> *)values {
NSUInteger maxValue = values.lastObject.unsignedIntValue;
NSMutableArray *array = [NSMutableArray array];
for (int i = 150; i < maxValue; i += 50) {
[array addObject:@(i)];
}
[array addObject:@(maxValue)];
%orig(array);
}

- (void)setGridHeights:(NSArray<NSNumber *> *)values {
NSUInteger maxValue = values.lastObject.unsignedIntValue;
NSMutableArray *array = [NSMutableArray array];
for (int i = 150; i < maxValue; i += 50) {
[array addObject:@(i)];
}
[array addObject:@(maxValue)];
%orig(array);
}
%end

// Override app limit, I don't think this is healthy for battery, so I won't make it unlimited...
%hook SBSwitcherChamoisSettings
- (NSUInteger)maximumNumberOfAppsOnStage {
Expand Down

0 comments on commit bc31c3a

Please sign in to comment.