VirtualBox

Changeset 73881 in vbox for trunk


Ignore:
Timestamp:
Aug 24, 2018 4:20:03 PM (6 years ago)
Author:
vboxsync
Message:

FE/Qt: VirtualBox Manager UI: UIToolbarTools: Temporary buttons for add-new-tool action.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.cpp

    r73637 r73881  
    2626# include <QLabel>
    2727# include <QStyle>
    28 # include <QToolButton>
    2928
    3029/* GUI includes: */
     30# include "QIToolButton.h"
    3131# include "UIActionPoolSelector.h"
     32# include "UIIconPool.h"
    3233# include "UITabBar.h"
    3334# include "UIToolBar.h"
     
    4041    : QWidget(pParent)
    4142    , m_pActionPool(pActionPool)
     43    , m_pLayoutMain(0)
    4244    , m_pTabBarMachine(0)
    4345    , m_pTabBarGlobal(0)
    44     , m_pLayoutMain(0)
     46    , m_pButtonMachine(0)
     47    , m_pButtonGlobal(0)
    4548{
    4649    prepare();
     
    5659            if (m_pTabBarGlobal)
    5760                m_pTabBarGlobal->setVisible(false);
     61            if (m_pButtonGlobal)
     62                m_pButtonGlobal->setVisible(false);
    5863            if (m_pTabBarMachine)
    5964                m_pTabBarMachine->setVisible(true);
     65            if (m_pButtonMachine)
     66                m_pButtonMachine->setVisible(true);
    6067            break;
    6168        }
     
    6471            if (m_pTabBarMachine)
    6572                m_pTabBarMachine->setVisible(false);
     73            if (m_pButtonMachine)
     74                m_pButtonMachine->setVisible(false);
    6675            if (m_pTabBarGlobal)
    6776                m_pTabBarGlobal->setVisible(true);
     77            if (m_pButtonGlobal)
     78                m_pButtonGlobal->setVisible(true);
    6879            break;
    6980        }
     
    7586    /* Update Machine tab-bar availability: */
    7687    m_pTabBarMachine->setEnabled(fEnabled);
     88    m_pButtonMachine->setEnabled(fEnabled);
    7789}
    7890
     
    8193    /* Update Global tab-bar availability: */
    8294    m_pTabBarGlobal->setEnabled(fEnabled);
     95    m_pButtonGlobal->setEnabled(fEnabled);
    8396}
    8497
     
    287300        }
    288301
     302        /* Let's use the simple button for now: */
     303        m_pButtonMachine = new QIToolButton;
     304        if (m_pButtonMachine)
     305        {
     306
     307            const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
     308            m_pButtonMachine->setIconSize(QSize(iMetric, iMetric));
     309            m_pButtonMachine->setIcon(UIIconPool::iconSet(":/edata_add_16px.png"));
     310            m_pButtonMachine->setMenu(m_pActionPool->action(UIActionIndexST_M_Tools_T_Machine)->menu());
     311            m_pButtonMachine->setPopupMode(QToolButton::InstantPopup);
     312
     313            /* Add into layout: */
     314            m_pLayoutMain->addWidget(m_pButtonMachine);
     315        }
     316
     317        /* Let's use the simple button for now: */
     318        m_pButtonGlobal = new QIToolButton;
     319        if (m_pButtonGlobal)
     320        {
     321
     322            const int iMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
     323            m_pButtonGlobal->setIconSize(QSize(iMetric, iMetric));
     324            m_pButtonGlobal->setIcon(UIIconPool::iconSet(":/edata_add_16px.png"));
     325            m_pButtonGlobal->setMenu(m_pActionPool->action(UIActionIndexST_M_Tools_T_Global)->menu());
     326            m_pButtonGlobal->setPopupMode(QToolButton::InstantPopup);
     327
     328            /* Add into layout: */
     329            m_pLayoutMain->addWidget(m_pButtonGlobal);
     330        }
     331
    289332        /* Let the tab-bars know our opinion: */
    290333        switchToTabBar(TabBarType_Machine);
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.h

    r73601 r73881  
    3333class QUuid;
    3434class QWidget;
     35class QIToolButton;
    3536class UIActionPool;
    3637class UITabBar;
     
    107108
    108109    /** Holds the main layout instance. */
    109     QHBoxLayout *m_pLayoutMain;
     110    QHBoxLayout  *m_pLayoutMain;
    110111    /** Holds the Machine tab-bar instance. */
    111     UITabBar    *m_pTabBarMachine;
     112    UITabBar     *m_pTabBarMachine;
    112113    /** Holds the Global tab-bar instance. */
    113     UITabBar    *m_pTabBarGlobal;
     114    UITabBar     *m_pTabBarGlobal;
     115    /** Holds the Machine tab-bar button. */
     116    QIToolButton *m_pButtonMachine;
     117    /** Holds the Global tab-bar button. */
     118    QIToolButton *m_pButtonGlobal;
    114119
    115120    /** Holds the map of opened Machine tool IDs. */
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