mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:47:35 +00:00
MacPDF: Add Debug menu items to hook up Clip Images/Paths settings
This commit is contained in:
parent
1845a406ea
commit
b5aef8e404
5 changed files with 50 additions and 0 deletions
|
@ -27,5 +27,7 @@
|
||||||
- (IBAction)goToPreviousPage:(id)sender;
|
- (IBAction)goToPreviousPage:(id)sender;
|
||||||
|
|
||||||
- (IBAction)toggleShowClippingPaths:(id)sender;
|
- (IBAction)toggleShowClippingPaths:(id)sender;
|
||||||
|
- (IBAction)toggleClipImages:(id)sender;
|
||||||
|
- (IBAction)toggleClipPaths:(id)sender;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -169,6 +169,14 @@ static NSBitmapImageRep* ns_from_gfx(NonnullRefPtr<Gfx::Bitmap> bitmap_p)
|
||||||
[item setState:_preferences.show_clipping_paths ? NSControlStateValueOn : NSControlStateValueOff];
|
[item setState:_preferences.show_clipping_paths ? NSControlStateValueOn : NSControlStateValueOff];
|
||||||
return _doc ? YES : NO;
|
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;
|
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
|
- (void)keyDown:(NSEvent*)event
|
||||||
{
|
{
|
||||||
// Calls moveLeft: or moveRight: below.
|
// Calls moveLeft: or moveRight: below.
|
||||||
|
|
|
@ -22,6 +22,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
- (IBAction)goToNextPage:(id)sender;
|
- (IBAction)goToNextPage:(id)sender;
|
||||||
- (IBAction)goToPreviousPage:(id)sender;
|
- (IBAction)goToPreviousPage:(id)sender;
|
||||||
- (IBAction)toggleShowClippingPaths:(id)sender;
|
- (IBAction)toggleShowClippingPaths:(id)sender;
|
||||||
|
- (IBAction)toggleClipImages:(id)sender;
|
||||||
|
- (IBAction)toggleClipPaths:(id)sender;
|
||||||
- (IBAction)showGoToPageDialog:(id)sender;
|
- (IBAction)showGoToPageDialog:(id)sender;
|
||||||
|
|
||||||
- (void)pdfDidInitialize;
|
- (void)pdfDidInitialize;
|
||||||
|
|
|
@ -144,6 +144,16 @@
|
||||||
[_pdfView toggleShowClippingPaths:sender];
|
[_pdfView toggleShowClippingPaths:sender];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (IBAction)toggleClipImages:(id)sender
|
||||||
|
{
|
||||||
|
[_pdfView toggleClipImages:sender];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (IBAction)toggleClipPaths:(id)sender
|
||||||
|
{
|
||||||
|
[_pdfView toggleClipPaths:sender];
|
||||||
|
}
|
||||||
|
|
||||||
- (IBAction)showGoToPageDialog:(id)sender
|
- (IBAction)showGoToPageDialog:(id)sender
|
||||||
{
|
{
|
||||||
auto alert = [[NSAlert alloc] init];
|
auto alert = [[NSAlert alloc] init];
|
||||||
|
|
|
@ -670,6 +670,18 @@
|
||||||
<action selector="toggleShowClippingPaths:" target="-1" id="ZXz-gM-52n"/>
|
<action selector="toggleShowClippingPaths:" target="-1" id="ZXz-gM-52n"/>
|
||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</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>
|
</items>
|
||||||
</menu>
|
</menu>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue