- Timestamp:
- Aug 6, 2018 6:28:09 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/UIVirtualBoxManagerWidget.cpp
r73527 r73534 53 53 , m_pTabBarMachine(0) 54 54 , m_pTabBarGlobal(0) 55 , m_pActionTabBarMachine(0)56 , m_pActionTabBarGlobal(0)57 55 , m_pToolbarTools(0) 58 56 , m_pPaneChooser(0) … … 293 291 void UIVirtualBoxManagerWidget::sltHandleShowTabBarMachine() 294 292 { 295 m_p ActionTabBarGlobal->setVisible(false);296 m_p ActionTabBarMachine->setVisible(true);293 m_pTabBarGlobal->setVisible(false); 294 m_pTabBarMachine->setVisible(true); 297 295 } 298 296 299 297 void UIVirtualBoxManagerWidget::sltHandleShowTabBarGlobal() 300 298 { 301 m_p ActionTabBarMachine->setVisible(false);302 m_p ActionTabBarGlobal->setVisible(true);299 m_pTabBarMachine->setVisible(false); 300 m_pTabBarGlobal->setVisible(true); 303 301 } 304 302 … … 396 394 #endif /* VBOX_WS_MAC */ 397 395 398 /* Create Machine tab-bar: */399 m_pTabBarMachine = new UITabBar;400 if (m_pTabBarMachine)401 {402 /* Configure tab-bar: */403 const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin);404 const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin);405 m_pTabBarMachine->setContentsMargins(iL, 0, iR, 0);406 407 /* Add into toolbar: */408 m_pActionTabBarMachine = m_pToolBar->addWidget(m_pTabBarMachine);409 }410 411 /* Create Global tab-bar: */412 m_pTabBarGlobal = new UITabBar;413 if (m_pTabBarGlobal)414 {415 /* Configure tab-bar: */416 const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin);417 const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin);418 m_pTabBarGlobal->setContentsMargins(iL, 0, iR, 0);419 420 /* Add into toolbar: */421 m_pActionTabBarGlobal = m_pToolBar->addWidget(m_pTabBarGlobal);422 }423 424 /* Create Tools toolbar: */425 m_pToolbarTools = new UIToolbarTools(actionPool());426 if (m_pToolbarTools)427 {428 /* Configure toolbar: */429 m_pToolbarTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding);430 connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarMachine,431 this, &UIVirtualBoxManagerWidget::sltHandleShowTabBarMachine);432 connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarGlobal,433 this, &UIVirtualBoxManagerWidget::sltHandleShowTabBarGlobal);434 m_pToolbarTools->setTabBars(m_pTabBarMachine, m_pTabBarGlobal);435 436 /* Create exclusive action-group: */437 QActionGroup *pActionGroupTools = new QActionGroup(m_pToolbarTools);438 if (pActionGroupTools)439 {440 /* Configure action-group: */441 pActionGroupTools->setExclusive(true);442 443 /* Add 'Tools' actions into action-group: */444 pActionGroupTools->addAction(actionPool()->action(UIActionIndexST_M_Tools_T_Machine));445 pActionGroupTools->addAction(actionPool()->action(UIActionIndexST_M_Tools_T_Global));446 }447 448 /* Add into toolbar: */449 m_pToolBar->addWidget(m_pToolbarTools);450 }451 452 396 #ifdef VBOX_WS_MAC 453 397 // WORKAROUND: … … 502 446 pLayoutRight->addWidget(m_pToolBar); 503 447 448 /* Create Machine tab-bar: */ 449 m_pTabBarMachine = new UITabBar(UITabBar::Align_Left); 450 if (m_pTabBarMachine) 451 { 452 /* Add into toolbar: */ 453 pLayoutRight->addWidget(m_pTabBarMachine); 454 } 455 456 /* Create Global tab-bar: */ 457 m_pTabBarGlobal = new UITabBar(UITabBar::Align_Left); 458 if (m_pTabBarGlobal) 459 { 460 /* Add into toolbar: */ 461 pLayoutRight->addWidget(m_pTabBarGlobal); 462 } 463 464 /* Create Tools toolbar: */ 465 m_pToolbarTools = new UIToolbarTools(actionPool()); 466 if (m_pToolbarTools) 467 { 468 /* Configure toolbar: */ 469 m_pToolbarTools->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); 470 connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarMachine, 471 this, &UIVirtualBoxManagerWidget::sltHandleShowTabBarMachine); 472 connect(m_pToolbarTools, &UIToolbarTools::sigShowTabBarGlobal, 473 this, &UIVirtualBoxManagerWidget::sltHandleShowTabBarGlobal); 474 m_pToolbarTools->setTabBars(m_pTabBarMachine, m_pTabBarGlobal); 475 476 /* Create exclusive action-group: */ 477 QActionGroup *pActionGroupTools = new QActionGroup(m_pToolbarTools); 478 if (pActionGroupTools) 479 { 480 /* Configure action-group: */ 481 pActionGroupTools->setExclusive(true); 482 483 /* Add 'Tools' actions into action-group: */ 484 pActionGroupTools->addAction(actionPool()->action(UIActionIndexST_M_Tools_T_Machine)); 485 pActionGroupTools->addAction(actionPool()->action(UIActionIndexST_M_Tools_T_Global)); 486 } 487 488 /* Add into toolbar: */ 489 m_pToolBar->addWidget(m_pToolbarTools); 490 } 491 504 492 /* Create sliding-widget: */ 505 493 m_pSlidingWidget = new UISlidingWidget; … … 515 503 516 504 /* Add into layout: */ 517 pLayoutRight->addWidget(m_pSlidingWidget );505 pLayoutRight->addWidget(m_pSlidingWidget, 1); 518 506 } 519 507 } -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManagerWidget.h
r73492 r73534 190 190 /** Holds the Global tab-bar instance. */ 191 191 UITabBar *m_pTabBarGlobal; 192 /** Holds the Machine tab-bar action reference. */193 QAction *m_pActionTabBarMachine;194 /** Holds the Global tab-bar action reference. */195 QAction *m_pActionTabBarGlobal;196 192 197 193 /** Holds the Tools-toolbar instance. */
Note:
See TracChangeset
for help on using the changeset viewer.