Idefix Menu "Preview Display Mode"#2793
Idefix Menu "Preview Display Mode"#2793sunderme merged 5 commits intotexstudio-org:masterfrom octaeder:previewModeMenu
Conversation
|
@sunderme Can you help with the broken CI? What should line 1473 configManager.previewMode = act->data().valueConfigManager::PreviewMode(); look like? |
src/texstudio.cpp
Outdated
|
|
||
|
|
||
|
|
||
| QActionGroup *previewModeGroup = nullptr; |
There was a problem hiding this comment.
there is no need to use a global variable here.
global variables are considered bad in cpp.
src/texstudio.cpp
Outdated
| act->setData(ConfigManager::PM_TOOLTIP_AS_FALLBACK); | ||
| act->setCheckable(true); | ||
| previewModeGroup->addAction(act); | ||
| act = newManagedAction(submenu, "preview2", tr("Always show preview in preview panel"), SLOT(setPreviewMode())); |
There was a problem hiding this comment.
menu names should be, at least a little, self-explanatory.
preview2 (etc.) is definitely not.
There is a reason why the enum is called PM_PANEL.
src/texstudio.cpp
Outdated
| act->setData(ConfigManager::PM_INLINE); | ||
| act->setCheckable(true); | ||
| previewModeGroup->addAction(act); | ||
| act = newManagedAction(submenu, "preview6", tr("Show in embedded viewer"), SLOT(setPreviewMode())); |
There was a problem hiding this comment.
if you look at configdialog.cpp ll. 584..590, the last option is not present if no pdf previewer is build.
|
in configmanager.h |
|
and for consistency, I would actually prefer to stick to txs way of using menus. |
|
hope this is the last change. Thanks for your support. |
src/texstudio.cpp
Outdated
|
|
||
| ConfigManager::PreviewMode pm = configManager.previewMode; | ||
| switch (pm) { | ||
| case ConfigManager::PM_TOOLTIP_AS_FALLBACK: |
There was a problem hiding this comment.
The code is okay.
The action selection could be moved in an extra function as it is basically used twice.
|
thanks |
|
@sunderme I see that the German translation misses the accelerator key (&p) for the sub menu (s. image above). Is this intended? |
|
no |
|
changed to: Vorschau &Modus |

This PR adds a preview options group menu to the idefix menu and resolves #2760.