-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add transparency option to PDF export #25407 #25688
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR, it looks generally good! A few minor remarks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make sure that there are no unnecessary whitespace changes in this file (and other files)
@@ -51,6 +52,18 @@ void ImagesExportConfiguration::setExportPdfDpiResolution(int dpi) | |||
settings()->setSharedValue(EXPORT_PDF_DPI_RESOLUTION_KEY, Val(dpi)); | |||
} | |||
|
|||
//pdf with transparency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is not necessary, since the name of the method is already meaningful enough
@@ -33,6 +33,10 @@ class ImagesExportConfiguration : public IImagesExportConfiguration | |||
int exportPdfDpiResolution() const override; | |||
void setExportPdfDpiResolution(int dpi) override; | |||
|
|||
//pdf with transparent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same here)
@@ -65,9 +65,15 @@ Ret PdfWriter::write(INotationPtr notation, io::IODevice& destinationDevice, con | |||
return false; | |||
} | |||
|
|||
//transparency handling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment doesn't add much information either; we prefer only writing comments when they contain information that cannot (easily) be deduced from the code itself.
const bool TRANSPARENT_BACKGROUND = options.find(OptionKey::TRANSPARENT_BACKGROUND) != options.end() | ||
? options.at(OptionKey::TRANSPARENT_BACKGROUND).toBool() | ||
: configuration()->exportPdfWithTransparentBackground(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PngWriter
uses muse::value
for this; might be good to use that here too, for consistency.
const bool TRANSPARENT_BACKGROUND = options.find(OptionKey::TRANSPARENT_BACKGROUND) != options.end() | ||
? options.at(OptionKey::TRANSPARENT_BACKGROUND).toBool() | ||
: configuration()->exportPdfWithTransparentBackground(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Same here)
Q_PROPERTY(bool pdfTransparentBackground READ pdfTransparentBackground | ||
WRITE setPdfTransparentBackground NOTIFY pdfTransparentBackgroundChanged) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to keep the order of the Q_PROPERTIES consistent, so this one should come after Q_PROPERTY(int pdfResolution …
@@ -55,4 +55,25 @@ ExportSettingsPage { | |||
} | |||
} | |||
} | |||
|
|||
// Add transparency option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is not necessary
|
||
StyledTextLabel { | ||
width: parent.width | ||
text: qsTrc("project/export", "Each page of the selected parts will be exported as a separate %1 file.").arg("PDF") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this label shouldn't be here; the text is not accurate, and for PDF there are already those radio buttons to select how parts should be exported
Resolves: #25407