Skip to content

Add grid actions in case of embedded PDF-Viewer#3554

Closed
octaeder wants to merge 2 commits intotexstudio-org:masterfrom
octaeder:#222-gridImbeddedPdf
Closed

Add grid actions in case of embedded PDF-Viewer#3554
octaeder wants to merge 2 commits intotexstudio-org:masterfrom
octaeder:#222-gridImbeddedPdf

Conversation

@octaeder
Copy link
Copy Markdown
Contributor

@octaeder octaeder commented Mar 7, 2024

This PR resolves #222. For this the context menu of the embedded (not the windowed) PDF-viewer integrates some of the actions known from the View menu of the windowed viewer.

2x1 grid, non continuous

image

context menu of embedded viewer

image

This looks similar to the View menu:

image

@octaeder octaeder changed the title #222 grid imbedded pdf Add grid actions in case of embedded PDF-Viewer Mar 7, 2024
@sunderme
Copy link
Copy Markdown
Member

sunderme commented Mar 7, 2024

I would prefer to keep at least the config for the two viewers separate.
You can well use 2x1 continous for the windowed viewer , but 1x1 for the embedded ...

@octaeder
Copy link
Copy Markdown
Contributor Author

octaeder commented Mar 7, 2024

This sound a little tricky. I started with

QString previewOptionBase = QString("Preview");
if(embedded) previewOptionBase = "PreviewEmbedded";
conf->registerOption(previewOptionBase+"/GridX", &globalConfig->gridx, 1);

and so on. So variable gridx holds a value that is one time for the embedded and then for the windowed case. So toggleEmdedded() needs to store gridx in the appropriate option. But how can this be done? I think the value is written when we close txs but there we can't distinguish cases, just the last value is stored.

Currently I see options of both cases in the ini file but having the same value respectively:

Preview\GridX=1
PreviewEmbedded\GridX=1

But the first value has been 2 until I switched to the embedded viewer (getting defaults) and then closed txt.

@sunderme
Copy link
Copy Markdown
Member

sunderme commented Mar 7, 2024

alternatively start always with 1x1 in embedded mode ?

@octaeder octaeder force-pushed the #222-gridImbeddedPdf branch 2 times, most recently from 8091da4 to b07c37d Compare March 9, 2024 00:05
@sunderme
Copy link
Copy Markdown
Member

are you still working on this ?

@octaeder
Copy link
Copy Markdown
Contributor Author

I tried to split the affected options (continuous,...) into two options (say continuous1 and continuous2) and copy the one actually needed to the target variable (continuous) and back as necessary. But I gave up on that try.
From my point of view using same options for both cases makes it easy switching between embedded and windowed viewer. The relevance for using different setups may even decrease because the embedded viewer works almost the same as the windowed one. So one may prefer that there is no pending window.

@sunderme
Copy link
Copy Markdown
Member

From my point of view using same options for both cases makes it easy ...

No.

The side effect is that if someone wants to have an overview on the windowed viewer, the same view is shown then on the embedded one. This is clearly not desirable and is a functional break with current implementation/expectation.

@octaeder
Copy link
Copy Markdown
Contributor Author

How could this be resolved? I would not expect that setting a 1x1 grid on start of embedded viewer will solve the problem without splitting options.
What I couldn't handle are some cases where those options are used directly:
conf->linkOptionToObject(&globalConfig->continuous, actionContinuous, LO_NONE);
QString gs=QString("%1x%2").arg(globalConfig->gridx).arg(globalConfig->gridy);

@octaeder octaeder force-pushed the #222-gridImbeddedPdf branch from b07c37d to d8f5eb8 Compare March 17, 2024 01:37
@octaeder octaeder force-pushed the #222-gridImbeddedPdf branch from d8f5eb8 to fcfb742 Compare March 23, 2024 16:08
@sunderme
Copy link
Copy Markdown
Member

are you working on this ?

@octaeder
Copy link
Copy Markdown
Contributor Author

octaeder commented Apr 1, 2024

I won't work on this for a long time. Feel free to close the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Access to grid view, while viewer is embedded.

2 participants