VirtualBox

Ignore:
Timestamp:
May 23, 2019 7:11:40 AM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:6143. Saving/loading the dialog geometry.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
7 edited

Legend:

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

    r78519 r78680  
    204204const char *UIExtraDataDefs::GUI_GuestControl_ProcessControlDialogGeometry = "GUI/GuestControl/ProcessControlDialogGeometry";
    205205
     206/* Soft Keyboard: */
     207const char *UIExtraDataDefs::GUI_SoftKeyboard_DialogGeometry = "GUI/SoftKeyboardDialogGeometry";
     208
    206209/* File Manager options: */
    207210const char *UIExtraDataDefs::GUI_GuestControl_FileManagerOptions = "GUI/GuestControl/FileManagerOptions";
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h

    r78567 r78680  
    382382    /** @} */
    383383
     384    /** @name Soft Keyboard related data
     385      * @{ */
     386        extern const char *GUI_SoftKeyboard_DialogGeometry;
     387    /** @} */
     388
    384389    /** @name File Manager options
    385390      * @{ */
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp

    r78519 r78680  
    42894289}
    42904290
     4291QRect UIExtraDataManager::softKeyboardDialogGeometry(QWidget *pWidget, const QRect &defaultGeometry)
     4292{
     4293    return dialogGeometry(GUI_SoftKeyboard_DialogGeometry, pWidget, defaultGeometry);
     4294}
     4295
     4296void UIExtraDataManager::setSoftKeyboardDialogGeometry(const QRect &geometry, bool fMaximized)
     4297{
     4298    setDialogGeometry(GUI_SoftKeyboard_DialogGeometry, geometry, fMaximized);
     4299}
     4300
     4301bool UIExtraDataManager::softKeyboardDialogShouldBeMaximized()
     4302{
     4303    /* Get corresponding extra-data: */
     4304    const QStringList data = extraDataStringList(GUI_SoftKeyboard_DialogGeometry);
     4305
     4306    /* Make sure 5th item has required value: */
     4307    return data.size() == 5 && data[4] == GUI_Geometry_State_Max;
     4308}
     4309
    42914310void UIExtraDataManager::setFileManagerOptions(bool fListDirectoriesFirst,
    42924311                                               bool fShowDeleteConfirmation,
  • trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h

    r78519 r78680  
    669669        void setFileManagerVisiblePanels(const QStringList &panelNameList);
    670670        QStringList fileManagerVisiblePanels();
     671    /** @} */
     672
     673    /** @name Soft Keyboard
     674      * @{ */
     675        QRect softKeyboardDialogGeometry(QWidget *pWidget, const QRect &defaultGeometry);
     676        void setSoftKeyboardDialogGeometry(const QRect &geometry, bool fMaximized);
     677        bool softKeyboardDialogShouldBeMaximized();
    671678    /** @} */
    672679
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp

    r78672 r78680  
    636636    setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
    637637    /* Create layout: */
    638 
    639638    m_pMainLayout = new QHBoxLayout(this);
    640639    if (!m_pMainLayout)
     
    643642    if (!m_pContainerWidget)
    644643        return;
    645     m_pContainerWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
     644    //m_pContainerWidget->setStyleSheet("background-color:red;");
    646645    m_pMainLayout->addWidget(m_pContainerWidget);
    647646}
     
    720719
    721720    int y = 0;
     721    int totalHeight = 0;
     722    int totalWidth = 0;
    722723    for (int i = 0; i < m_rows.size(); ++i)
    723724    {
     
    728729        pRow->setVisible(true);
    729730        y += fMultiplier * pRow->m_iHeight;
    730          pRow->updateLayout();
    731     }
    732     update();
     731        totalWidth += fMultiplier * pRow->m_iWidth;
     732        totalHeight += fMultiplier * pRow->m_iHeight;
     733        pRow->updateLayout();
     734    }
    733735}
    734736
  • trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboardDialog.cpp

    r78635 r78680  
    109109    const QRect desktopRect = gpDesktop->availableGeometry(this);
    110110    int iDefaultWidth = desktopRect.width() / 2;
    111     int iDefaultHeight = desktopRect.height() * 3 / 4;
     111    int iDefaultHeight = 0.5 * iDefaultWidth;
    112112
    113113    QRect defaultGeometry(0, 0, iDefaultWidth, iDefaultHeight);
     
    116116
    117117    /* Load geometry from extradata: */
    118     QRect geometry = gEDataManager->guestProcessControlDialogGeometry(this, defaultGeometry);
     118    QRect geometry = gEDataManager->softKeyboardDialogGeometry(this, defaultGeometry);
    119119
    120120    /* Restore geometry: */
     
    131131    /* darwinIsWindowMaximized expects a non-const QWidget*. thus const_cast: */
    132132    QWidget *pw = const_cast<QWidget*>(qobject_cast<const QWidget*>(this));
    133     gEDataManager->setGuestProcessControlDialogGeometry(saveGeometry, ::darwinIsWindowMaximized(pw));
     133    gEDataManager->setSoftKeyboardDialogGeometry(saveGeometry, ::darwinIsWindowMaximized(pw));
    134134#else /* !VBOX_WS_MAC */
    135     gEDataManager->setGuestProcessControlDialogGeometry(saveGeometry, isMaximized());
     135    gEDataManager->setSoftKeyboardDialogGeometry(saveGeometry, isMaximized());
    136136#endif /* !VBOX_WS_MAC */
    137     LogRel2(("GUI: Guest Process Control Dialog: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
     137    LogRel2(("GUI: Soft Keyboard Dialog: Geometry saved as: Origin=%dx%d, Size=%dx%d\n",
    138138             saveGeometry.x(), saveGeometry.y(), saveGeometry.width(), saveGeometry.height()));
    139139}
     
    141141bool UISoftKeyboardDialog::shouldBeMaximized() const
    142142{
    143     return gEDataManager->guestProcessControlDialogShouldBeMaximized();
     143    return gEDataManager->softKeyboardDialogShouldBeMaximized();
    144144}
    145145
  • trunk/src/VBox/Frontends/VirtualBox/xml/us_layout.xml

    r78672 r78680  
    22<layout>
    33    <row>
    4         <height>50</height>
     4        <height>40</height>
    55        <key>
    66            <width>50</width>
     
    9595    </row>
    9696    <row>
    97         <height>50</height>
     97        <height>40</height>
    9898        <key>
    9999            <width>50</width>
     
    195195    </row>
    196196    <row>
    197         <height>50</height>
     197        <height>40</height>
    198198        <key>
    199199            <width>70</width>
     
    286286
    287287    <row>
    288         <height>50</height>
     288        <height>40</height>
    289289        <key>
    290290            <width>70</width>
     
    370370    </row>
    371371    <row>
    372         <height>50</height>
     372        <height>40</height>
    373373        <key>
    374374            <width>115</width>
     
    451451
    452452    <row>
    453         <height>50</height>
     453        <height>40</height>
    454454        <key>
    455455            <width>90</width>
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