Changeset 73533 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 6, 2018 6:26:58 PM (6 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r72707 r73533 1957 1957 1958 1958 /* Create Machine tab-bar: */ 1959 m_pTabBarMachine = new UITabBar ;1959 m_pTabBarMachine = new UITabBar(UITabBar::Align_Right); 1960 1960 AssertPtrReturnVoid(m_pTabBarMachine); 1961 1961 { … … 1970 1970 1971 1971 /* Create Global tab-bar: */ 1972 m_pTabBarGlobal = new UITabBar ;1972 m_pTabBarGlobal = new UITabBar(UITabBar::Align_Right); 1973 1973 AssertPtrReturnVoid(m_pTabBarGlobal); 1974 1974 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.cpp
r72715 r73533 720 720 *********************************************************************************************************************************/ 721 721 722 UITabBar::UITabBar( QWidget *pParent /* = 0 */)722 UITabBar::UITabBar(Alignment enmAlignment, QWidget *pParent /* = 0 */) 723 723 : QWidget(pParent) 724 , m_enmAlignment(enmAlignment) 724 725 , m_pLayoutMain(0) 725 726 , m_pLayoutTab(0) … … 745 746 connect(pItem, &UITabBarItem::sigDragObjectDestroy, this, &UITabBar::sltHandleDragObjectDestroy); 746 747 /* Add item into layout and list: */ 747 m_pLayoutTab->insertWidget(0, pItem); 748 m_aItems.prepend(pItem); 748 switch (m_enmAlignment) 749 { 750 case Align_Left: 751 m_pLayoutTab->addWidget(pItem); 752 m_aItems.append(pItem); 753 break; 754 case Align_Right: 755 m_pLayoutTab->insertWidget(0, pItem); 756 m_aItems.prepend(pItem); 757 break; 758 } 749 759 /* Update children styles: */ 750 760 updateChildrenStyles(); … … 1021 1031 m_pLayoutMain->setContentsMargins(0, 0, 0, 0); 1022 1032 1023 /// @todo Workout stretch at the and as well, 1024 // depending on which alignment is set. 1025 /* Add strech into beginning: */ 1026 m_pLayoutMain->addStretch(); 1033 /* Add strech to beginning: */ 1034 if (m_enmAlignment == Align_Right) 1035 m_pLayoutMain->addStretch(); 1027 1036 1028 1037 /* Create tab layout: */ … … 1033 1042 m_pLayoutMain->addLayout(m_pLayoutTab); 1034 1043 } 1044 1045 /* Add strech to end: */ 1046 if (m_enmAlignment == Align_Left) 1047 m_pLayoutMain->addStretch(); 1035 1048 } 1036 1049 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UITabBar.h
r69057 r73533 56 56 public: 57 57 58 /** Alignment types. */ 59 enum Alignment { Align_Left, Align_Right }; 60 58 61 /** Constructs tab-bar passing @a pParent to the base-class. */ 59 UITabBar( QWidget *pParent = 0);62 UITabBar(Alignment enmAlignment, QWidget *pParent = 0); 60 63 61 64 /** Adds new tab for passed @a pAction. @returns unique tab ID. */ … … 104 107 void updateChildrenStyles(); 105 108 109 /** @name Contents: Common 110 * @{ */ 111 /** Holds the alignment. */ 112 Alignment m_enmAlignment; 113 /** @} */ 114 106 115 /** @name Contents: Widgets 107 116 * @{ */
Note:
See TracChangeset
for help on using the changeset viewer.