Skip to content

Commit

Permalink
#1247 (Mac Catalyst edition)
Browse files Browse the repository at this point in the history
- More Settings tweaks.
- Fixed squished theme control swatches.
- Resized toolbar buttons to Mac-appropriate sizes.
- Fixed position of story detail settings popover.
  • Loading branch information
Dejal committed Dec 12, 2023
1 parent ac98426 commit 377e2b1
Show file tree
Hide file tree
Showing 20 changed files with 241 additions and 204 deletions.
4 changes: 2 additions & 2 deletions clients/ios/Classes/FeedDetailObjCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ - (void)viewDidLoad {
self.feedsBarButton = [[UIBarButtonItem alloc] initWithTitle:@"Sites" style:UIBarButtonItemStylePlain target:self action:@selector(doShowFeeds:)];
self.feedsBarButton.accessibilityLabel = @"Show Sites";

UIImage *settingsImage = [Utilities imageNamed:@"settings" sized:30];
UIImage *settingsImage = [Utilities imageNamed:@"settings" sized:self.isMac ? 24 : 30];
settingsBarButton = [UIBarButtonItem barItemWithImage:settingsImage target:self action:@selector(doOpenSettingsMenu:)];
settingsBarButton.accessibilityLabel = @"Settings";

UIImage *markreadImage = [Utilities imageNamed:@"mark-read" sized:30];
UIImage *markreadImage = [Utilities imageNamed:@"mark-read" sized:self.isMac ? 24 : 30];
feedMarkReadButton = [UIBarButtonItem barItemWithImage:markreadImage target:self action:@selector(doOpenMarkReadMenu:)];
feedMarkReadButton.accessibilityLabel = @"Mark all as read";

Expand Down
8 changes: 6 additions & 2 deletions clients/ios/Classes/FeedsObjCViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -1059,7 +1059,11 @@ - (void)showUserProfile {
appDelegate.activeUserProfileId = [NSString stringWithFormat:@"%@", [appDelegate.dictSocialProfile objectForKey:@"user_id"]];
appDelegate.activeUserProfileName = [NSString stringWithFormat:@"%@", [appDelegate.dictSocialProfile objectForKey:@"username"]];
// appDelegate.activeUserProfileName = @"You";
[appDelegate showUserProfileModal:self.navigationItem.titleView];
#if TARGET_OS_MACCATALYST
[appDelegate showUserProfileModal:self.userBarButton];
#else
[appDelegate showUserProfileModal:self.navigationItem.titleView];
#endif
}

- (IBAction)tapAddSite:(id)sender {
Expand Down Expand Up @@ -1340,7 +1344,7 @@ - (void)updateTheme {
NBBarButtonItem *barButton = self.addBarButton.customView;
[barButton setImage:[[ThemeManager themeManager] themedImage:[UIImage imageNamed:@"nav_icn_add.png"]] forState:UIControlStateNormal];

self.settingsBarButton.image = [Utilities imageNamed:@"settings" sized:30];
self.settingsBarButton.image = [Utilities imageNamed:@"settings" sized:self.isMac ? 24 : 30];

[self layoutHeaderCounts:0];
[self refreshHeaderCounts];
Expand Down
9 changes: 8 additions & 1 deletion clients/ios/Classes/FontSettingsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,14 @@ - (UIImage *)themeImageWithName:(NSString *)name selected:(BOOL)selected {
name = [name stringByAppendingString:@"-sel"];
}

return [[UIImage imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage *image = [[UIImage imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomMac) {
image = [Utilities imageWithImage:image convertToSize:CGSizeMake(20.0, 20.0)];
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}

return image;
}

@end
9 changes: 8 additions & 1 deletion clients/ios/Classes/MenuViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ - (UIImage *)themeImageWithName:(NSString *)name selected:(BOOL)selected {
name = [name stringByAppendingString:@"-sel"];
}

return [[UIImage imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
UIImage *image = [[UIImage imageNamed:name] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomMac) {
image = [Utilities imageWithImage:image convertToSize:CGSizeMake(20.0, 20.0)];
image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
}

return image;
}

- (UITableViewCell *)makeThemeSegmentedTableCell {
Expand Down
2 changes: 2 additions & 0 deletions clients/ios/Classes/NewsBlurAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ SFSafariViewControllerDelegate> {
- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize barButtonItem:(UIBarButtonItem *)barButtonItem;
- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect;
- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect permittedArrowDirections:(UIPopoverArrowDirection)permittedArrowDirections;
//- (void)showPopoverWithViewController:(UIViewController *)viewController contentSize:(CGSize)contentSize sourceNavigationController:(UINavigationController *)sourceNavigationController barButtonItem:(UIBarButtonItem *)barButtonItem sourceView:(UIView *)sourceView sourceRect:(CGRect)sourceRect permittedArrowDirections:(UIPopoverArrowDirection)permittedArrowDirections;

- (void)hidePopoverAnimated:(BOOL)animated completion:(void (^)(void))completion;
- (BOOL)hidePopoverAnimated:(BOOL)animated;
- (void)hidePopover;
Expand Down
Loading

0 comments on commit 377e2b1

Please sign in to comment.