-
Notifications
You must be signed in to change notification settings - Fork 350
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
make menu entries Show embedded PDF large/small consistent #3931
Conversation
src/texstudio.cpp
Outdated
newManagedAction(menu, "enlargePDF", tr("Show embedded PDF large"), SLOT(enlargeEmbeddedPDFViewer())); | ||
newManagedAction(menu, "shrinkPDF", tr("Show embedded PDF small"), SLOT(shrinkEmbeddedPDFViewer())); | ||
|
||
newManagedAction(menu, "enlargePDF", tr("Show embedded PDF large"), SLOT(enlargeEmbeddedPDFViewer()))->setVisible(false); |
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 two lines out of this, i.e
act=...
act->setVi...
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.
and the approach seems to be a bit indirect.
You want to change menu entries in texstudio.cpp level, the changes are triggered there (even embedding/windowing over Texstudio::runInternalPdfViewer)
src/texstudio.cpp
Outdated
newManagedAction(menu, "shrinkPDF", tr("Show embedded PDF small"), SLOT(shrinkEmbeddedPDFViewer())); | ||
|
||
newManagedAction(menu, "enlargePDF", tr("Show embedded PDF large"), SLOT(enlargeEmbeddedPDFViewer()))->setVisible(false); | ||
newManagedAction(menu, "shrinkPDF", tr("Show embedded PDF small"), SLOT(shrinkEmbeddedPDFViewer()))->setVisible(false); |
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 two lines out of this, i.e
act=...
act->setVi...
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.
Just in case that there was no automatic notification, I want to note that I changed the two lines.
Did you see my other comment ? |
There are two pairs of similar actions, one of them connected to a button of PDFdocument. So it seems best to me to use the ui changes to setup the menu and the button. |
I have looked through the code. Please rewrite the code that the menu change is done in the TexStudio class only. Secondly, the menu should be disabled, not hidden. The menu entries are always a good learning source for shortcuts. |
Thanks for the hints. I made a new commit. |
and updatet first commit (images etc.) of th PR. |
thanks |
This PR adresses following two menu entries:
Both actions are always enabled even when there is no pdf-viewer at all or the viewer is not embedded. When the viewer is emedded exactly one of the entries should be enabled. So we have three cases: