- Timestamp:
- Aug 24, 2018 4:20:03 PM (6 years ago)
- 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 26 26 # include <QLabel> 27 27 # include <QStyle> 28 # include <QToolButton>29 28 30 29 /* GUI includes: */ 30 # include "QIToolButton.h" 31 31 # include "UIActionPoolSelector.h" 32 # include "UIIconPool.h" 32 33 # include "UITabBar.h" 33 34 # include "UIToolBar.h" … … 40 41 : QWidget(pParent) 41 42 , m_pActionPool(pActionPool) 43 , m_pLayoutMain(0) 42 44 , m_pTabBarMachine(0) 43 45 , m_pTabBarGlobal(0) 44 , m_pLayoutMain(0) 46 , m_pButtonMachine(0) 47 , m_pButtonGlobal(0) 45 48 { 46 49 prepare(); … … 56 59 if (m_pTabBarGlobal) 57 60 m_pTabBarGlobal->setVisible(false); 61 if (m_pButtonGlobal) 62 m_pButtonGlobal->setVisible(false); 58 63 if (m_pTabBarMachine) 59 64 m_pTabBarMachine->setVisible(true); 65 if (m_pButtonMachine) 66 m_pButtonMachine->setVisible(true); 60 67 break; 61 68 } … … 64 71 if (m_pTabBarMachine) 65 72 m_pTabBarMachine->setVisible(false); 73 if (m_pButtonMachine) 74 m_pButtonMachine->setVisible(false); 66 75 if (m_pTabBarGlobal) 67 76 m_pTabBarGlobal->setVisible(true); 77 if (m_pButtonGlobal) 78 m_pButtonGlobal->setVisible(true); 68 79 break; 69 80 } … … 75 86 /* Update Machine tab-bar availability: */ 76 87 m_pTabBarMachine->setEnabled(fEnabled); 88 m_pButtonMachine->setEnabled(fEnabled); 77 89 } 78 90 … … 81 93 /* Update Global tab-bar availability: */ 82 94 m_pTabBarGlobal->setEnabled(fEnabled); 95 m_pButtonGlobal->setEnabled(fEnabled); 83 96 } 84 97 … … 287 300 } 288 301 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 289 332 /* Let the tab-bars know our opinion: */ 290 333 switchToTabBar(TabBarType_Machine); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIToolbarTools.h
r73601 r73881 33 33 class QUuid; 34 34 class QWidget; 35 class QIToolButton; 35 36 class UIActionPool; 36 37 class UITabBar; … … 107 108 108 109 /** Holds the main layout instance. */ 109 QHBoxLayout *m_pLayoutMain;110 QHBoxLayout *m_pLayoutMain; 110 111 /** Holds the Machine tab-bar instance. */ 111 UITabBar *m_pTabBarMachine;112 UITabBar *m_pTabBarMachine; 112 113 /** 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; 114 119 115 120 /** Holds the map of opened Machine tool IDs. */
Note:
See TracChangeset
for help on using the changeset viewer.