VirtualBox

Changeset 101071 in vbox


Ignore:
Timestamp:
Sep 8, 2023 2:59:59 PM (15 months ago)
Author:
vboxsync
Message:

FE/Qt: Global Preferences / Display page: Reorder Font Scaling editor with Display Features editor.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/settings/global
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.cpp

    r101053 r101071  
    5454               && (m_guiMaximumGuestScreenSizeValue == other.m_guiMaximumGuestScreenSizeValue)
    5555               && (m_scaleFactors == other.m_scaleFactors)
     56               && (m_iFontScalingFactor == other.m_iFontScalingFactor)
    5657               && (m_fActivateHoveredMachineWindow == other.m_fActivateHoveredMachineWindow)
    5758               && (m_fDisableHostScreenSaver == other.m_fDisableHostScreenSaver)
    58                && (m_iFontScalingFactor == other.m_iFontScalingFactor)
    5959                  ;
    6060    }
     
    6969    /** Holds the guest screen scale-factor. */
    7070    QList<double>                  m_scaleFactors;
     71    /** Holds the font scaling factor. */
     72    int                            m_iFontScalingFactor;
    7173    /** Holds whether we should automatically activate machine window under the mouse cursor. */
    7274    bool                           m_fActivateHoveredMachineWindow;
    7375    /** Holds whether we should disable host sceen saver on a vm is running. */
    7476    bool                           m_fDisableHostScreenSaver;
    75     /** Holds font scaling factor. */
    76     int                            m_iFontScalingFactor;
    7777};
    7878
     
    8686    , m_pEditorMaximumGuestScreenSize(0)
    8787    , m_pEditorScaleFactor(0)
     88    , m_pFontScaleEditor(0)
    8889    , m_pEditorDisplayFeatures(0)
    89     , m_pFontScaleEditor(0)
    9090{
    9191    prepare();
     
    119119                                                                             gEDataManager->maxGuestResolutionForPolicyFixed());
    120120    oldData.m_scaleFactors = gEDataManager->scaleFactors(UIExtraDataManager::GlobalID);
     121    oldData.m_iFontScalingFactor = gEDataManager->fontScaleFactor();
    121122    oldData.m_fActivateHoveredMachineWindow = gEDataManager->activateHoveredMachineWindow();
    122123#if defined(VBOX_WS_WIN) || defined(VBOX_WS_NIX)
    123124    oldData.m_fDisableHostScreenSaver = gEDataManager->disableHostScreenSaver();
    124125#endif
    125     oldData.m_iFontScalingFactor = gEDataManager->fontScaleFactor();
    126126    m_pCache->cacheInitialData(oldData);
    127127
     
    145145        m_pEditorScaleFactor->setMonitorCount(UIDesktopWidgetWatchdog::screenCount());
    146146    }
     147    if (m_pFontScaleEditor)
     148        m_pFontScaleEditor->setFontScaleFactor(oldData.m_iFontScalingFactor);
    147149    if (m_pEditorDisplayFeatures)
    148150    {
     
    150152        m_pEditorDisplayFeatures->setDisableHostScreenSaver(oldData.m_fDisableHostScreenSaver);
    151153    }
    152     if (m_pFontScaleEditor)
    153         m_pFontScaleEditor->setFontScaleFactor(oldData.m_iFontScalingFactor);
    154154}
    155155
     
    168168    if (m_pEditorScaleFactor)
    169169        newData.m_scaleFactors = m_pEditorScaleFactor->scaleFactors();
     170    if (m_pFontScaleEditor)
     171        newData.m_iFontScalingFactor = m_pFontScaleEditor->fontScaleFactor();
    170172    if (m_pEditorDisplayFeatures)
    171173    {
     
    173175        newData.m_fDisableHostScreenSaver = m_pEditorDisplayFeatures->disableHostScreenSaver();
    174176    }
    175     if (m_pFontScaleEditor)
    176         newData.m_iFontScalingFactor = m_pFontScaleEditor->fontScaleFactor();
    177177    m_pCache->cacheCurrentData(newData);
    178178}
     
    196196    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorMaximumGuestScreenSize->minimumLabelHorizontalHint());
    197197    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorScaleFactor->minimumLabelHorizontalHint());
     198    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pFontScaleEditor->minimumLabelHorizontalHint());
    198199    iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorDisplayFeatures->minimumLabelHorizontalHint());
    199     iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pFontScaleEditor->minimumLabelHorizontalHint());
    200200    m_pEditorMaximumGuestScreenSize->setMinimumLayoutIndent(iMinimumLayoutHint);
    201201    m_pEditorScaleFactor->setMinimumLayoutIndent(iMinimumLayoutHint);
     202    m_pFontScaleEditor->setMinimumLayoutIndent(iMinimumLayoutHint);
    202203    m_pEditorDisplayFeatures->setMinimumLayoutIndent(iMinimumLayoutHint);
    203     m_pFontScaleEditor->setMinimumLayoutIndent(iMinimumLayoutHint);
    204204}
    205205
     
    239239        }
    240240
     241        /* Prepare 'font scale' editor: */
     242        m_pFontScaleEditor = new UIFontScaleEditor(this);
     243        if (m_pFontScaleEditor)
     244        {
     245            m_editors << m_pFontScaleEditor;
     246            pLayout->addWidget(m_pFontScaleEditor);
     247        }
     248
    241249        /* Prepare 'display features' editor: */
    242250        m_pEditorDisplayFeatures = new UIDisplayFeaturesEditor(this);
     
    247255        }
    248256
    249         /* Prepare 'font scale' editor: */
    250         m_pFontScaleEditor = new UIFontScaleEditor(this);
    251         if (m_pFontScaleEditor)
    252         {
    253             m_editors << m_pFontScaleEditor;
    254             pLayout->addWidget(m_pFontScaleEditor);
    255         }
    256 
    257257        /* Add stretch to the end: */
    258258        pLayout->addStretch();
     
    293293            && newData.m_scaleFactors != oldData.m_scaleFactors)
    294294            /* fSuccess = */ gEDataManager->setScaleFactors(newData.m_scaleFactors, UIExtraDataManager::GlobalID);
     295        /* Save font scale factor: */
     296        if (   fSuccess
     297            && newData.m_iFontScalingFactor != oldData.m_iFontScalingFactor)
     298            /* fSuccess = */ gEDataManager->setFontScaleFactor(newData.m_iFontScalingFactor);
    295299        /* Save whether hovered machine-window should be activated automatically: */
    296300        if (   fSuccess
     
    303307            /* fSuccess = */ gEDataManager->setDisableHostScreenSaver(newData.m_fDisableHostScreenSaver);
    304308#endif /* VBOX_WS_WIN || VBOX_WS_NIX */
    305         /* Save font scale factor: */
    306         if (   fSuccess
    307             && newData.m_iFontScalingFactor != oldData.m_iFontScalingFactor)
    308             /* fSuccess = */ gEDataManager->setFontScaleFactor(newData.m_iFontScalingFactor);
    309309    }
    310310    /* Return result: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsDisplay.h

    r101053 r101071  
    9898        /** Holds the 'scale-factor' editor instance. */
    9999        UIScaleFactorEditor            *m_pEditorScaleFactor;
     100        /** Holds the 'font scale' editor instance. */
     101        UIFontScaleEditor              *m_pFontScaleEditor;
    100102        /** Holds the 'display features' editor instance. */
    101103        UIDisplayFeaturesEditor        *m_pEditorDisplayFeatures;
    102         /** Holds the 'font scale' editor instance. */
    103         UIFontScaleEditor              *m_pFontScaleEditor;
    104104    /** @} */
    105105};
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