mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-09-18 21:50:56 +00:00
#1247 (Mac Catalyst edition)
- Added a View ▸ Show submenu for the intelligence mode. - Fixed the intelligence HUD not being horizontally centered on iPad and Mac. - Added Edit ▸ Find in Sites and Find in Feed commands to select the search fields in those views. - Disabled keyboard scrolling of the story pages, since that interfered with changing stories in the feed detail.
This commit is contained in:
parent
6f62873c5f
commit
985ab53c71
5 changed files with 110 additions and 19 deletions
|
@ -39,6 +39,7 @@
|
|||
- (void)collectionView:(UICollectionView *)collectionView selectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated scrollPosition:(UICollectionViewScrollPosition)scrollPosition;
|
||||
- (void)collectionView:(UICollectionView *)collectionView deselectItemAtIndexPath:(NSIndexPath *)indexPath animated:(BOOL)animated;
|
||||
|
||||
- (IBAction)newSite:(id)sender;
|
||||
- (IBAction)reloadFeeds:(id)sender;
|
||||
- (IBAction)showMuteSites:(id)sender;
|
||||
- (IBAction)showOrganizeSites:(id)sender;
|
||||
|
@ -49,6 +50,9 @@
|
|||
- (IBAction)showSupportForum:(id)sender;
|
||||
- (IBAction)showLogout:(id)sender;
|
||||
|
||||
- (IBAction)findInFeeds:(id)sender;
|
||||
- (IBAction)findInFeedDetail:(id)sender;
|
||||
|
||||
- (IBAction)chooseColumns:(id)sender;
|
||||
- (IBAction)chooseLayout:(id)sender;
|
||||
- (IBAction)chooseTitle:(id)sender;
|
||||
|
|
|
@ -236,7 +236,7 @@
|
|||
}
|
||||
|
||||
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
|
||||
if (action == @selector(chooseLayout:)) {
|
||||
if (action == @selector(chooseLayout:) || action == @selector(findInFeedDetail:)) {
|
||||
return self.isFeedShown;
|
||||
} else if (action == @selector(chooseTitle:) || action == @selector(choosePreview:)) {
|
||||
return self.isFeedShown && !self.isGrid;
|
||||
|
@ -273,6 +273,10 @@
|
|||
} else if (command.action == @selector(chooseLayout:)) {
|
||||
NSString *value = self.appDelegate.storiesCollection.activeStoryTitlesPosition;
|
||||
command.state = [command.propertyList isEqualToString:value];
|
||||
} else if (command.action == @selector(chooseIntelligence:)) {
|
||||
NSInteger intelligence = [[NSUserDefaults standardUserDefaults] integerForKey:@"selectedIntelligence"];
|
||||
NSString *value = [NSString stringWithFormat:@"%@", @(intelligence + 1)];
|
||||
command.state = [command.propertyList isEqualToString:value];
|
||||
} else if (command.action == @selector(toggleSidebar:)) {
|
||||
UISplitViewController *splitViewController = self.appDelegate.splitViewController;
|
||||
if (splitViewController.preferredDisplayMode != UISplitViewControllerDisplayModeTwoBesideSecondary) {
|
||||
|
@ -338,6 +342,10 @@
|
|||
#pragma mark -
|
||||
#pragma mark File menu
|
||||
|
||||
- (IBAction)newSite:(id)sender {
|
||||
[appDelegate.feedsViewController tapAddSite:nil];
|
||||
}
|
||||
|
||||
- (IBAction)reloadFeeds:(id)sender {
|
||||
[appDelegate reloadFeedsView:NO];
|
||||
}
|
||||
|
@ -375,6 +383,19 @@
|
|||
[self.appDelegate confirmLogout];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Edit menu
|
||||
|
||||
- (IBAction)findInFeeds:(id)sender {
|
||||
[self.appDelegate showColumn:UISplitViewControllerColumnPrimary debugInfo:@"findInFeeds"];
|
||||
[self.appDelegate.feedsViewController.searchBar becomeFirstResponder];
|
||||
}
|
||||
|
||||
- (IBAction)findInFeedDetail:(id)sender {
|
||||
[self.appDelegate showColumn:UISplitViewControllerColumnSupplementary debugInfo:@"findInFeedDetail"];
|
||||
[self.appDelegate.feedDetailViewController.searchBar becomeFirstResponder];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark View menu
|
||||
|
||||
|
@ -401,6 +422,14 @@
|
|||
[self.appDelegate.detailViewController updateLayoutWithReload:YES fetchFeeds:YES];
|
||||
}
|
||||
|
||||
- (IBAction)chooseIntelligence:(id)sender {
|
||||
UICommand *command = sender;
|
||||
NSInteger index = [command.propertyList integerValue];
|
||||
|
||||
[self.appDelegate.feedsViewController.intelligenceControl setSelectedSegmentIndex:index];
|
||||
[self.appDelegate.feedsViewController selectIntelligence];
|
||||
}
|
||||
|
||||
- (IBAction)chooseTitle:(id)sender {
|
||||
UICommand *command = sender;
|
||||
NSString *string = command.propertyList;
|
||||
|
|
|
@ -2431,6 +2431,10 @@ heightForHeaderInSection:(NSInteger)section {
|
|||
hud.mode = MBProgressHUDModeText;
|
||||
hud.removeFromSuperViewOnHide = YES;
|
||||
|
||||
if (!self.appDelegate.isPhone) {
|
||||
hud.xOffset = 50;
|
||||
}
|
||||
|
||||
NSIndexPath *topRow;
|
||||
if ([[self.feedTitlesTable indexPathsForVisibleRows] count]) {
|
||||
topRow = [[self.feedTitlesTable indexPathsForVisibleRows] objectAtIndex:0];
|
||||
|
|
|
@ -107,6 +107,10 @@
|
|||
[self.scrollView setAlwaysBounceHorizontal:self.isHorizontal];
|
||||
[self.scrollView setAlwaysBounceVertical:!self.isHorizontal];
|
||||
|
||||
if (@available(macCatalyst 17.0, *)) {
|
||||
self.scrollView.allowsKeyboardScrolling = NO;
|
||||
}
|
||||
|
||||
if (!self.isPhone) {
|
||||
self.scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
||||
}
|
||||
|
|
|
@ -248,22 +248,15 @@
|
|||
<children>
|
||||
<menu isSystemItem="YES" title="File" identifier="com.apple.menu.file" id="cyC-FU-wa2">
|
||||
<children>
|
||||
<menu isSystemItem="YES" title="Open" identifier="com.apple.menu.open" id="kg7-Yc-6nd">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<systemMenuChildDeletions>
|
||||
<menuDeletion anchor="com.apple.menu.open-recent"/>
|
||||
</systemMenuChildDeletions>
|
||||
</menu>
|
||||
<menu isSystemItem="YES" title="Document" identifier="com.apple.menu.document" id="vwX-rl-iVO">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<systemMenuChildDeletions>
|
||||
<itemDeletion anchorAction="rename:"/>
|
||||
<itemDeletion anchorAction="export:"/>
|
||||
</systemMenuChildDeletions>
|
||||
</menu>
|
||||
<menu anchor="com.apple.menu.document" id="ksZ-gH-4gO">
|
||||
<menu anchor="com.apple.menu.close" id="ksZ-gH-4gO">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<children>
|
||||
<command title="New Site" input="n" id="Y3F-bj-KeX">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
<action selector="newSite:" destination="J28-e1-gcC" id="eEX-pv-sl0"/>
|
||||
</connections>
|
||||
</command>
|
||||
<command title="Reload Sites" input="r" id="9ee-Z4-HxV">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
|
@ -272,7 +265,7 @@
|
|||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
<menu anchor="com.apple.menu.document" id="6cc-W3-a06">
|
||||
<menu anchor="com.apple.menu.close" id="6cc-W3-a06">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<children>
|
||||
<command title="Mute Sites" input="M" id="M7P-gv-spA">
|
||||
|
@ -295,7 +288,7 @@
|
|||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
<menu anchor="com.apple.menu.document" id="obB-Ib-5UM">
|
||||
<menu anchor="com.apple.menu.close" id="obB-Ib-5UM">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<children>
|
||||
<command title="Notifications" input="N" id="2ax-3D-3zm">
|
||||
|
@ -312,7 +305,7 @@
|
|||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
<menu anchor="com.apple.menu.document" id="WdP-hc-0fU">
|
||||
<menu anchor="com.apple.menu.close" id="WdP-hc-0fU">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<children>
|
||||
<command title="NewsBlur Premium" id="HGH-9Q-Dzh">
|
||||
|
@ -322,7 +315,7 @@
|
|||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
<menu anchor="com.apple.menu.document" id="cRW-qu-7aj">
|
||||
<menu anchor="com.apple.menu.close" id="cRW-qu-7aj">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<children>
|
||||
<command title="Logout NewsBlur" input="L" id="kvb-M9-tEl">
|
||||
|
@ -341,6 +334,35 @@
|
|||
</systemMenuChildDeletions>
|
||||
</menu>
|
||||
</children>
|
||||
<systemMenuChildDeletions>
|
||||
<menuDeletion anchor="com.apple.menu.new-scene"/>
|
||||
<menuDeletion anchor="com.apple.menu.open"/>
|
||||
<menuDeletion anchor="com.apple.menu.document"/>
|
||||
</systemMenuChildDeletions>
|
||||
</menu>
|
||||
<menu isSystemItem="YES" title="Edit" identifier="com.apple.menu.edit" id="a13-uu-myc">
|
||||
<children>
|
||||
<menu anchor="com.apple.menu.standard-edit" id="rH8-0t-SpF">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
<children>
|
||||
<command title="Find in Sites" input="f" id="Oy9-Js-Eoz">
|
||||
<keyModifierFlags key="modifierFlags" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="findInFeeds:" destination="J28-e1-gcC" id="3J9-2o-DYH"/>
|
||||
</connections>
|
||||
</command>
|
||||
<command title="Find in Feed" input="f" id="2M3-xa-Uu2">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
<action selector="findInFeedDetail:" destination="J28-e1-gcC" id="KMi-J9-3OA"/>
|
||||
</connections>
|
||||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
</children>
|
||||
<systemMenuChildDeletions>
|
||||
<menuDeletion anchor="com.apple.menu.find"/>
|
||||
</systemMenuChildDeletions>
|
||||
</menu>
|
||||
<menu isSystemItem="YES" title="View" identifier="com.apple.menu.view" id="pdl-gx-X6C">
|
||||
<children>
|
||||
|
@ -396,6 +418,34 @@
|
|||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
<menu title="Show" id="yxK-59-1Mg">
|
||||
<children>
|
||||
<command title="All Stories" propertyListString="0" menuElementState="on" input="1" id="ccO-Ne-aJ2">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
<action selector="chooseIntelligence:" destination="J28-e1-gcC" id="BEW-3n-izO"/>
|
||||
</connections>
|
||||
</command>
|
||||
<command title="Unread Stories" propertyListString="1" input="2" id="Flw-XS-uGO">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
<action selector="chooseIntelligence:" destination="J28-e1-gcC" id="Sjf-mN-l3c"/>
|
||||
</connections>
|
||||
</command>
|
||||
<command title="Focus Stories" propertyListString="2" input="3" id="Pml-hQ-IST">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
<action selector="chooseIntelligence:" destination="J28-e1-gcC" id="O2v-f5-adA"/>
|
||||
</connections>
|
||||
</command>
|
||||
<command title="Saved Stories" propertyListString="3" input="4" id="YTZ-1i-9Qj">
|
||||
<keyModifierFlags key="modifierFlags" command="YES"/>
|
||||
<connections>
|
||||
<action selector="chooseIntelligence:" destination="J28-e1-gcC" id="6Bm-Us-ckr"/>
|
||||
</connections>
|
||||
</command>
|
||||
</children>
|
||||
</menu>
|
||||
<menu title="Inline Menu" id="rEb-O5-WxE">
|
||||
<menuOptions key="menuOptions" displayInline="YES"/>
|
||||
</menu>
|
||||
|
|
Loading…
Add table
Reference in a new issue