- Timestamp:
- Aug 4, 2017 10:00:45 AM (7 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.cpp
r68253 r68295 374 374 UITabBar::UITabBar(QWidget *pParent /* = 0 */) 375 375 : QWidget(pParent) 376 , m_pLayout(0) 376 , m_pLayoutMain(0) 377 , m_pLayoutTab(0) 377 378 , m_pCurrentItem(0) 378 379 { … … 393 394 connect(pItem, &UITabBarItem::sigCloseClicked, this, &UITabBar::sltHandleChildClose); 394 395 /* Add item into layout and list: */ 395 m_pLayout ->insertWidget(1, pItem);396 m_aItems << pItem;396 m_pLayoutTab->insertWidget(0, pItem); 397 m_aItems.prepend(pItem); 397 398 /* Return unique ID: */ 398 399 return uuid; … … 495 496 { 496 497 /* Create main layout: */ 497 m_pLayout = new QHBoxLayout(this);498 if (m_pLayout)498 m_pLayoutMain = new QHBoxLayout(this); 499 AssertPtrReturnVoid(m_pLayoutMain); 499 500 { 500 501 /* Configure layout: */ 501 m_pLayout ->setSpacing(0);502 m_pLayout ->setContentsMargins(0, 0, 0, 0);502 m_pLayoutMain->setSpacing(0); 503 m_pLayoutMain->setContentsMargins(0, 0, 0, 0); 503 504 504 505 // TODO: Workout stretch at the and as well, 505 506 // depending on which alignment is set. 506 507 /* Add strech into beginning: */ 507 m_pLayout->addStretch(); 508 m_pLayoutMain->addStretch(); 509 510 /* Create tab layout: */ 511 m_pLayoutTab = new QHBoxLayout; 512 AssertPtrReturnVoid(m_pLayoutTab); 513 { 514 /* Add into layout: */ 515 m_pLayoutMain->addLayout(m_pLayoutTab); 516 } 508 517 } 509 518 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.h
r68145 r68295 75 75 void prepare(); 76 76 77 /** Holds the main layout instance. */ 78 QHBoxLayout *m_pLayout; 77 /** @name Contents: Widgets 78 * @{ */ 79 /** Holds the main layout instance. */ 80 QHBoxLayout *m_pLayoutMain; 81 /** Holds the tab layout instance. */ 82 QHBoxLayout *m_pLayoutTab; 79 83 80 /** Holds the current item reference. */81 UITabBarItem *m_pCurrentItem;84 /** Holds the current item reference. */ 85 UITabBarItem *m_pCurrentItem; 82 86 83 /** Holds the array of items instances. */ 84 QList<UITabBarItem*> m_aItems; 87 /** Holds the array of items instances. */ 88 QList<UITabBarItem*> m_aItems; 89 /** @} */ 85 90 }; 86 91
Note:
See TracChangeset
for help on using the changeset viewer.