VirtualBox

Changeset 59726 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Feb 18, 2016 3:19:41 PM (9 years ago)
Author:
vboxsync
Message:

FE/Qt: ​bugref:7839: Extra-Data Manager: Adding fallback option to move center of log-window and information-window to center of default-screen.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r59507 r59726  
    23152315        geometry.setSize(geometry.size().expandedTo(pWidget->minimumSizeHint()));
    23162316
    2317     /* Get screen-geometry [of screen with point (iX, iY) if possible]: */
     2317    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
    23182318    const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
    23192319                                          vboxGlobal().availableGeometry();
     
    23262326#endif /* Q_WS_WIN */
    23272327
    2328     /* Move default-geometry to screen-geometry' center: */
     2328    /* As final fallback, move default-geometry to available-geometry' center: */
    23292329    if (!fOk)
    23302330        geometry.moveCenter(availableGeometry.center());
     
    35273527        geometry.setSize(geometry.size().expandedTo(pWidget->minimumSizeHint()));
    35283528
    3529     /* In Windows Qt fails to reposition out of screen window properly, so moving to centre: */
    3530 #ifdef Q_WS_WIN
    35313529    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
    35323530    const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
    35333531                                          vboxGlobal().availableGeometry();
    35343532
     3533    /* In Windows Qt fails to reposition out of screen window properly, so moving to centre: */
     3534#ifdef Q_WS_WIN
    35353535    /* Make sure resulting geometry is within current bounds: */
    35363536    if (fOk && geometry.intersects(availableGeometry))
     
    35383538#endif /* Q_WS_WIN */
    35393539
    3540     /* Move default-geometry to pParentWidget' geometry center: */
     3540    /* As a fallback, move default-geometry to pParentWidget' geometry center: */
    35413541    if (!fOk && pParentWidget)
    35423542        geometry.moveCenter(pParentWidget->geometry().center());
     3543    /* As final fallback, move default-geometry to available-geometry' center: */
     3544    else if (!fOk)
     3545        geometry.moveCenter(availableGeometry.center());
    35433546
    35443547    /* Return result: */
     
    36943697#endif /* Q_WS_WIN */
    36953698
    3696     /* Move default-geometry to current screen center: */
     3699    /* As final fallback, move default-geometry to available-geometry' center: */
    36973700    if (!fOk)
    36983701        geometry.moveCenter(availableGeometry.center());
     
    38023805    /* In Windows Qt fails to reposition out of screen window properly, so moving to centre: */
    38033806#ifdef Q_WS_WIN
    3804     /* Get screen-geometry [of screen with point (iX, iY) if possible]: */
    3805     const QRect availableGeometry = vboxGlobal().availableGeometry(QPoint(iX, iY));
     3807    /* Get available-geometry [of screen with point (iX, iY) if possible]: */
     3808    const QRect availableGeometry = fOk ? vboxGlobal().availableGeometry(QPoint(iX, iY)) :
     3809                                          vboxGlobal().availableGeometry();
    38063810
    38073811    /* Make sure resulting geometry is within current bounds: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette