Title: [295537] trunk/Source/WebKit/UIProcess
- Revision
- 295537
- Author
- commit-qu...@webkit.org
- Date
- 2022-06-14 14:36:55 -0700 (Tue, 14 Jun 2022)
Log Message
Update context menu icon for Remove Background
https://bugs.webkit.org/show_bug.cgi?id=241467
Patch by Mike Wyrzykowski <mwyrzykow...@apple.com> on 2022-06-14
Reviewed by Dean Jackson and Wenson Hsieh.
Update the symbol names for Copy Subject and Remove Background.
* Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction imageForElementActionType:]):
Copy Subject will use circle.dashed.rectangle.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView removeBackgroundMenu]):
Remove Background should use circle.rectangle.filled.pattern.diagonalline.
(-[WKContentView menuWithInlineAction:image:identifier:handler:]):
Add image parameter for vertical context menu.
(-[WKContentView appHighlightMenu]):
We could use the "quicknote" symbol here but I don't think it's correct.
I left it empty because I don't think app highlights menu can appear in the
larger vertical context menu.
Canonical link: https://commits.webkit.org/251542@main
Modified Paths
Diff
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm (295536 => 295537)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm 2022-06-14 21:17:40 UTC (rev 295536)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm 2022-06-14 21:36:55 UTC (rev 295537)
@@ -268,7 +268,7 @@
return nil;
#endif
case _WKElementActionTypeCopyCroppedImage:
- return [UIImage systemImageNamed:@"person.fill.viewfinder"];
+ return [UIImage _systemImageNamed:@"circle.dashed.rectangle"];
}
}
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (295536 => 295537)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2022-06-14 21:17:40 UTC (rev 295536)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2022-06-14 21:36:55 UTC (rev 295537)
@@ -4694,7 +4694,7 @@
if (_removeBackgroundData->element != _page->editorState().postLayoutData().selectedEditableImage)
return nil;
- return [self menuWithInlineAction:WebCore::contextMenuItemTitleRemoveBackground() identifier:@"WKActionRemoveBackground" handler:[](WKContentView *view) {
+ return [self menuWithInlineAction:WebCore::contextMenuItemTitleRemoveBackground() image:[UIImage _systemImageNamed:@"circle.rectangle.filled.pattern.diagonalline"] identifier:@"WKActionRemoveBackground" handler:[](WKContentView *view) {
auto data = "" { });
if (!data)
return;
@@ -9875,9 +9875,9 @@
#endif
}
-- (UIMenu *)menuWithInlineAction:(NSString *)title identifier:(NSString *)identifier handler:(Function<void(WKContentView *)>&&)handler
+- (UIMenu *)menuWithInlineAction:(NSString *)title image:(UIImage *)image identifier:(NSString *)identifier handler:(Function<void(WKContentView *)>&&)handler
{
- auto action = "" actionWithTitle:title image:nil identifier:identifier handler:makeBlockPtr([handler = WTFMove(handler), weakSelf = WeakObjCPtr<WKContentView>(self)](UIAction *) mutable {
+ auto action = "" actionWithTitle:title image:image identifier:identifier handler:makeBlockPtr([handler = WTFMove(handler), weakSelf = WeakObjCPtr<WKContentView>(self)](UIAction *) mutable {
if (auto strongSelf = weakSelf.get())
handler(strongSelf.get());
}).get()];
@@ -9893,7 +9893,7 @@
bool isVisible = _page->appHighlightsVisibility();
auto title = isVisible ? WebCore::contextMenuItemTagAddHighlightToCurrentQuickNote() : WebCore::contextMenuItemTagAddHighlightToNewQuickNote();
- return [self menuWithInlineAction:title identifier:@"WKActionCreateQuickNote" handler:[isVisible](WKContentView *view) mutable {
+ return [self menuWithInlineAction:title image:nil identifier:@"WKActionCreateQuickNote" handler:[isVisible](WKContentView *view) mutable {
view->_page->createAppHighlightInSelectedRange(isVisible ? WebCore::CreateNewGroupForHighlight::No : WebCore::CreateNewGroupForHighlight::Yes, WebCore::HighlightRequestOriginatedInApp::No);
}];
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes