@@ -2478,7 +2478,6 @@ void PDFWidget::fitWindow(bool checked)
2478
2478
if (scrollArea && !pages.isEmpty ()) {
2479
2479
qreal portWidth = scrollArea->viewport ()->width () - GridBorder * (gridx - 1 );
2480
2480
int gy=globalConfig->gridy ;
2481
- if (pdfdocument->embeddedMode ) gy=1 ;
2482
2481
qreal portHeight = scrollArea->viewport ()->height () - GridBorder * (gy - 1 ); // use globalConfig->gridy as gridy is automatically increased in continous mode to force rendering of surrounding pages
2483
2482
QSizeF pageSize = maxPageSizeFDpiAdjusted ();
2484
2483
qreal sfh = portWidth / pageSize.width () / gridx;
@@ -3340,39 +3339,32 @@ void PDFDocument::init(bool embedded)
3340
3339
connect (actionFit_to_Window, SIGNAL (triggered (bool )), pdfWidget, SLOT (fitWindow (bool )));
3341
3340
3342
3341
3343
- if (!embedded) {
3344
- conf->registerOption (" Preview/GridX" , &globalConfig->gridx , 1 );
3345
- conf->registerOption (" Preview/GridY" , &globalConfig->gridy , 1 );
3346
- pdfWidget->setGridSize (globalConfig->gridx , globalConfig->gridy , true );
3347
- conf->registerOption (" Preview/PageOffset" , &globalConfig->pageOffset , 0 );
3348
- pdfWidget->setPageOffset (globalConfig->pageOffset , true );
3349
- // set grid menu entry checked
3350
- QString gs=QString (" %1x%2" ).arg (globalConfig->gridx ).arg (globalConfig->gridy );
3351
- bool found=false ;
3352
- for (QAction *a:actionGroupGrid->actions ()){
3353
- if (a->property (" grid" ).toString ()==gs){
3354
- a->setChecked (true );
3355
- found=true ;
3356
- break ;
3357
- }
3358
- }
3359
- if (!found){
3360
- // if no other grid action fits, use custom
3361
- actionCustom->setChecked (true );
3342
+ conf->registerOption (" Preview/GridX" , &globalConfig->gridx , 1 );
3343
+ conf->registerOption (" Preview/GridY" , &globalConfig->gridy , 1 );
3344
+ pdfWidget->setGridSize (globalConfig->gridx , globalConfig->gridy , true );
3345
+ conf->registerOption (" Preview/PageOffset" , &globalConfig->pageOffset , 0 );
3346
+ pdfWidget->setPageOffset (globalConfig->pageOffset , true );
3347
+ // set grid menu entry checked
3348
+ QString gs=QString (" %1x%2" ).arg (globalConfig->gridx ).arg (globalConfig->gridy );
3349
+ bool found=false ;
3350
+ for (QAction *a:actionGroupGrid->actions ()){
3351
+ if (a->property (" grid" ).toString ()==gs){
3352
+ a->setChecked (true );
3353
+ found=true ;
3354
+ break ;
3362
3355
}
3363
-
3364
- // connect(actionSinglePageStep, SIGNAL(toggled(bool)), pdfWidget, SLOT(setSinglePageStep(bool)));
3365
- conf->registerOption (" Preview/Single Page Step" , &globalConfig->singlepagestep , true );
3366
- conf->linkOptionToObject (&globalConfig->singlepagestep , actionSinglePageStep, LO_NONE);
3367
- connect (actionContinuous, SIGNAL (toggled (bool )), scrollArea, SLOT (setContinuous (bool )));
3368
- conf->registerOption (" Preview/Continuous" , &globalConfig->continuous , true );
3369
- conf->linkOptionToObject (&globalConfig->continuous , actionContinuous, LO_NONE);
3370
- } else {
3371
- pdfWidget->setGridSize (1 , 1 , true );
3372
- pdfWidget->setPageOffset (0 , true );
3373
- pdfWidget->setSinglePageStep (true );
3374
- scrollArea->setContinuous (true );
3375
3356
}
3357
+ if (!found){
3358
+ // if no other grid action fits, use custom
3359
+ actionCustom->setChecked (true );
3360
+ }
3361
+
3362
+ // connect(actionSinglePageStep, SIGNAL(toggled(bool)), pdfWidget, SLOT(setSinglePageStep(bool)));
3363
+ conf->registerOption (" Preview/Single Page Step" , &globalConfig->singlepagestep , true );
3364
+ conf->linkOptionToObject (&globalConfig->singlepagestep , actionSinglePageStep, LO_NONE);
3365
+ connect (actionContinuous, SIGNAL (toggled (bool )), scrollArea, SLOT (setContinuous (bool )));
3366
+ conf->registerOption (" Preview/Continuous" , &globalConfig->continuous , true );
3367
+ conf->linkOptionToObject (&globalConfig->continuous , actionContinuous, LO_NONE);
3376
3368
3377
3369
// connect(actionZoom_In, SIGNAL(triggered()), pdfWidget, SLOT(zoomIn()));
3378
3370
// connect(actionZoom_Out, SIGNAL(triggered()), pdfWidget, SLOT(zoomOut()));
@@ -3395,6 +3387,10 @@ void PDFDocument::init(bool embedded)
3395
3387
conf->linkOptionToObject (&globalConfig->followFromScroll , actionCursor_follows_scrolling);
3396
3388
conf->registerOption (" Preview/Sync Multiple Views" , &globalConfig->syncViews , true );
3397
3389
conf->linkOptionToObject (&globalConfig->syncViews , actionSynchronize_multiple_views);
3390
+ if (embedded) {
3391
+ pdfWidget->addAction (actionContinuous);
3392
+ pdfWidget->addAction (menuGrid->menuAction ());
3393
+ }
3398
3394
conf->registerOption (" Preview/Invert Colors" , &globalConfig->invertColors , false );
3399
3395
conf->linkOptionToObject (&globalConfig->invertColors , actionInvertColors);
3400
3396
pdfWidget->addAction (actionInvertColors); // add invert color to widget context menu
@@ -4281,7 +4277,7 @@ void PDFDocument::setCurrentFile(const QString &fileName)
4281
4277
curFileUnnormalized = fileName;
4282
4278
curFile = QFileInfo (fileName).canonicalFilePath ();
4283
4279
QString niceFile = QFileInfo (curFile).fileName ();
4284
- setWindowTitle (tr (" %1[*] - %2" ).arg (niceFile,tr (TEXSTUDIO)));
4280
+ setWindowTitle (tr (" %1[*] - %2" ).arg (niceFile,tr (TEXSTUDIO)));
4285
4281
}
4286
4282
4287
4283
PDFDocument *PDFDocument::findDocument (const QString &fileName)
0 commit comments