VirtualBox

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


Ignore:
Timestamp:
Aug 3, 2012 2:27:38 AM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: 6234: Support for VM groups: Machine mini-tool-bar disabled as non-stable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r42563 r42564  
    5353    , m_iCornerRadius(6)
    5454{
    55     /* Prepare: */
    56     prepare();
     55//    /* Prepare: */
     56//    prepare();
    5757
    5858    /* Add item to the parent: */
     
    7474    , m_iCornerRadius(6)
    7575{
    76     /* Prepare: */
    77     prepare();
     76//    /* Prepare: */
     77//    prepare();
    7878
    7979    /* Add item to the parent: */
     
    204204            int iPixmapWidth = data(MachineItemData_PixmapSize).toSize().width();
    205205            int iMachineItemMajorSpacing = data(MachineItemData_MajorSpacing).toInt();
     206            int iMachineItemMinorSpacing = data(MachineItemData_MinorSpacing).toInt();
    206207            int iToolBarWidth = data(MachineItemData_ToolBarSize).toSize().width();
    207208            int iMaximumWidth = (int)geometry().width() - iMargin -
    208                                                           iPixmapWidth - iMachineItemMajorSpacing -
    209                                                           iToolBarWidth - iMachineItemMajorSpacing;
     209                                                          iPixmapWidth -
     210                                                          iMachineItemMajorSpacing -
     211                                                          iMachineItemMinorSpacing -
     212                                                          iMachineItemMajorSpacing -
     213                                                          iMargin;
     214            if (m_pToolBar)
     215                iMaximumWidth -= iToolBarWidth;
    210216            return iMaximumWidth;
    211217        }
     
    215221            return QSize(fm.width(data(MachineItemData_StateText).toString()), fm.height());
    216222        }
    217         case MachineItemData_ToolBarSize: return m_pToolBar->minimumSizeHint().toSize();
     223        case MachineItemData_ToolBarSize:
     224        {
     225            return m_pToolBar ? m_pToolBar->minimumSizeHint().toSize() : QSize(0, 0);
     226        }
    218227        /* Default: */
    219228        default: break;
     
    266275void UIGChooserItemMachine::updateLayout()
    267276{
    268     /* Prepare variables: */
    269     QSize size = geometry().size().toSize();
    270 
    271     /* Prepare variables: */
    272     int iMachineItemWidth = size.width();
    273     int iMachineItemHeight = size.height();
    274     int iToolBarHeight = data(MachineItemData_ToolBarSize).toSize().height();
    275 
    276     /* Configure tool-bar: */
    277     QSize toolBarSize = m_pToolBar->minimumSizeHint().toSize();
    278     int iToolBarX = iMachineItemWidth - 1 - toolBarSize.width();
    279     int iToolBarY = (iMachineItemHeight - iToolBarHeight) / 2;
    280     m_pToolBar->setPos(iToolBarX, iToolBarY);
    281     m_pToolBar->resize(toolBarSize);
    282     m_pToolBar->updateLayout();
    283 
    284     /* Configure buttons: */
    285     m_pStartButton->updateAnimation();
    286     m_pSettingsButton->updateAnimation();
    287     m_pCloseButton->updateAnimation();
    288     m_pPauseButton->updateAnimation();
     277    if (m_pToolBar)
     278    {
     279        /* Prepare variables: */
     280        QSize size = geometry().size().toSize();
     281
     282        /* Prepare variables: */
     283        int iMachineItemWidth = size.width();
     284        int iMachineItemHeight = size.height();
     285        int iToolBarHeight = data(MachineItemData_ToolBarSize).toSize().height();
     286
     287        /* Configure tool-bar: */
     288        QSize toolBarSize = m_pToolBar->minimumSizeHint().toSize();
     289        int iToolBarX = iMachineItemWidth - 1 - toolBarSize.width();
     290        int iToolBarY = (iMachineItemHeight - iToolBarHeight) / 2;
     291        m_pToolBar->setPos(iToolBarX, iToolBarY);
     292        m_pToolBar->resize(toolBarSize);
     293        m_pToolBar->updateLayout();
     294
     295        /* Configure buttons: */
     296        m_pStartButton->updateAnimation();
     297        m_pSettingsButton->updateAnimation();
     298        m_pCloseButton->updateAnimation();
     299        m_pPauseButton->updateAnimation();
     300    }
    289301}
    290302
     
    671683    }
    672684
    673     /* Show/hide start-button: */
    674     if (isHovered())
    675     {
    676         if (!m_pToolBar->isVisible())
    677             m_pToolBar->show();
    678     }
    679     else
    680     {
    681         if (m_pToolBar->isVisible())
    682             m_pToolBar->hide();
     685    if (m_pToolBar)
     686    {
     687        /* Show/hide tool-bar: */
     688        if (isHovered())
     689        {
     690            if (!m_pToolBar->isVisible())
     691                m_pToolBar->show();
     692        }
     693        else
     694        {
     695            if (m_pToolBar->isVisible())
     696                m_pToolBar->hide();
     697        }
    683698    }
    684699}
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