mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
MacPDF: Add Debug menu items to hook up Clip Images/Paths settings
This commit is contained in:
parent
1845a406ea
commit
b5aef8e404
Notes:
sideshowbarker
2024-07-17 06:39:26 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/b5aef8e404 Pull-request: https://github.com/SerenityOS/serenity/pull/22820
5 changed files with 50 additions and 0 deletions
|
@ -27,5 +27,7 @@
|
|||
- (IBAction)goToPreviousPage:(id)sender;
|
||||
|
||||
- (IBAction)toggleShowClippingPaths:(id)sender;
|
||||
- (IBAction)toggleClipImages:(id)sender;
|
||||
- (IBAction)toggleClipPaths:(id)sender;
|
||||
|
||||
@end
|
||||
|
|
|
@ -169,6 +169,14 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
|
|||
[item setState:_preferences.show_clipping_paths ? NSControlStateValueOn : NSControlStateValueOff];
|
||||
return _doc ? YES : NO;
|
||||
}
|
||||
if ([item action] == @selector(toggleClipImages:)) {
|
||||
[item setState:_preferences.clip_images ? NSControlStateValueOn : NSControlStateValueOff];
|
||||
return _doc ? YES : NO;
|
||||
}
|
||||
if ([item action] == @selector(toggleClipPaths:)) {
|
||||
[item setState:_preferences.clip_paths ? NSControlStateValueOn : NSControlStateValueOff];
|
||||
return _doc ? YES : NO;
|
||||
}
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
@ -180,6 +188,22 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
|
|||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleClipImages:(id)sender
|
||||
{
|
||||
if (_doc) {
|
||||
_preferences.clip_images = !_preferences.clip_images;
|
||||
[self invalidateCachedBitmap];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)toggleClipPaths:(id)sender
|
||||
{
|
||||
if (_doc) {
|
||||
_preferences.clip_paths = !_preferences.clip_paths;
|
||||
[self invalidateCachedBitmap];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)keyDown:(NSEvent*)event
|
||||
{
|
||||
// Calls moveLeft: or moveRight: below.
|
||||
|
|
|
@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
- (IBAction)goToNextPage:(id)sender;
|
||||
- (IBAction)goToPreviousPage:(id)sender;
|
||||
- (IBAction)toggleShowClippingPaths:(id)sender;
|
||||
- (IBAction)toggleClipImages:(id)sender;
|
||||
- (IBAction)toggleClipPaths:(id)sender;
|
||||
- (IBAction)showGoToPageDialog:(id)sender;
|
||||
|
||||
- (void)pdfDidInitialize;
|
||||
|
|
|
@ -144,6 +144,16 @@
|
|||
[_pdfView toggleShowClippingPaths:sender];
|
||||
}
|
||||
|
||||
- (IBAction)toggleClipImages:(id)sender
|
||||
{
|
||||
[_pdfView toggleClipImages:sender];
|
||||
}
|
||||
|
||||
- (IBAction)toggleClipPaths:(id)sender
|
||||
{
|
||||
[_pdfView toggleClipPaths:sender];
|
||||
}
|
||||
|
||||
- (IBAction)showGoToPageDialog:(id)sender
|
||||
{
|
||||
auto alert = [[NSAlert alloc] init];
|
||||
|
|
|
@ -670,6 +670,18 @@
|
|||
<action selector="toggleShowClippingPaths:" target="-1" id="ZXz-gM-52n"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Clip Images" id="os0-En-UkL">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleClipImages:" target="-1" id="bHz-O3-V8K"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Clip Paths" id="KB8-Ld-jv8">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="toggleClipPaths:" target="-1" id="pZu-tJ-RFh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
|
|
Loading…
Add table
Reference in a new issue