- Timestamp:
- Jun 9, 2009 2:09:13 PM (16 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxDefs.h
r20412 r20441 151 151 static const char* GUI_SaveMountedAtRuntime; 152 152 static const char* GUI_ShowMiniToolBar; 153 static const char* GUI_MiniToolBarAutoHide; 153 154 static const char* GUI_LastCloseAction; 154 155 static const char* GUI_SuppressMessages; -
trunk/src/VBox/Frontends/VirtualBox/include/VBoxMiniToolBar.h
r20412 r20441 49 49 }; 50 50 51 VBoxMiniToolBar (QWidget *aParent, Alignment aAlignment); 52 53 void setActive (bool aIsActive); 54 void setIsSeamlessMode (bool aIsSeamless); 51 VBoxMiniToolBar (QWidget *aParent, Alignment aAlignment, bool aIsActive, bool aAutoHide); 55 52 56 53 VBoxMiniToolBar& operator<< (QList <QMenu*> aMenus); 57 54 55 void setSeamlessMode (bool aIsSeamless); 56 void setDisplayText (const QString &aText); 57 58 bool isAutoHide() const; 59 58 60 void updateDisplay (bool aShow, bool aSetHideFlag); 59 void setDisplayText (const QString &aText);60 61 61 62 signals: … … 88 89 QBasicTimer mAutoScrollTimer; 89 90 90 int mAutoHideCounter; 91 bool mActive; 92 bool mPolished; 93 bool mSeamless; 91 94 bool mAutoHide; 92 95 bool mSlideToScreen; 93 96 bool mHideAfterSlide; 94 bool mPolished;95 97 98 int mAutoHideCounter; 96 99 int mPositionX; 97 100 int mPositionY; 98 99 bool mIsActive;100 bool mIsSeamless;101 101 102 102 /* Lists of used spacers */ -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r20412 r20441 807 807 AssertWrapperOk (csession); 808 808 809 console = new VBoxConsoleView (this, cconsole, mode, 810 centralWidget()); 809 console = new VBoxConsoleView (this, cconsole, mode, centralWidget()); 810 static_cast <QGridLayout*> (centralWidget()->layout())->addWidget (console, 1, 1, Qt::AlignVCenter | Qt::AlignHCenter); 811 812 CMachine cmachine = csession.GetMachine(); 811 813 812 814 /* Mini toolbar */ 815 bool isActive = !(cmachine.GetExtraData (VBoxDefs::GUI_ShowMiniToolBar) == "no"); 816 bool isAutoHide = !(cmachine.GetExtraData (VBoxDefs::GUI_MiniToolBarAutoHide) == "off"); 813 817 QList <QMenu*> menus (QList <QMenu*> () << mMiniVMMenu << mDevicesMenu); 814 mMiniToolBar = new VBoxMiniToolBar (centralWidget(), VBoxMiniToolBar::AlignBottom); 818 mMiniToolBar = new VBoxMiniToolBar (centralWidget(), VBoxMiniToolBar::AlignBottom, 819 isActive, isAutoHide); 815 820 *mMiniToolBar << menus; 816 821 connect (mMiniToolBar, SIGNAL (exitAction()), this, SLOT (mtExitMode())); … … 820 825 821 826 activateUICustomizations(); 822 823 static_cast<QGridLayout*>(centralWidget()->layout())->addWidget(console, 1, 1, Qt::AlignVCenter | Qt::AlignHCenter);824 825 CMachine cmachine = csession.GetMachine();826 827 827 828 /* Set the VM-specific application icon */ … … 899 900 if (str == "no") 900 901 mIsAutoSaveMedia = false; 901 902 str = cmachine.GetExtraData (VBoxDefs::GUI_ShowMiniToolBar);903 if (str == "no")904 mMiniToolBar->setActive (false);905 902 906 903 /* Check if one of extended modes to be activated on loading */ … … 1582 1579 machine.SetExtraData (VBoxDefs::GUI_AutoresizeGuest, 1583 1580 mVmAutoresizeGuestAction->isChecked() ? "on" : "off"); 1581 machine.SetExtraData (VBoxDefs::GUI_MiniToolBarAutoHide, 1582 mMiniToolBar->isAutoHide() ? "on" : "off"); 1584 1583 1585 1584 #ifdef VBOX_WITH_DEBUGGER_GUI … … 2451 2450 if (aOn) 2452 2451 { 2453 mMiniToolBar->set IsSeamlessMode (aSeamless);2452 mMiniToolBar->setSeamlessMode (aSeamless); 2454 2453 mMiniToolBar->updateDisplay (true, true); 2455 2454 } -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxDefs.cpp
r20412 r20441 33 33 const char* VBoxDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime"; 34 34 const char* VBoxDefs::GUI_ShowMiniToolBar = "GUI/ShowMiniToolBar"; 35 const char* VBoxDefs::GUI_MiniToolBarAutoHide = "GUI/MiniToolBarAutoHide"; 35 36 const char* VBoxDefs::GUI_LastCloseAction = "GUI/LastCloseAction"; 36 37 const char* VBoxDefs::GUI_SuppressMessages = "GUI/SuppressMessages"; -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxMiniToolBar.cpp
r20412 r20441 38 38 #include <QToolButton> 39 39 40 VBoxMiniToolBar::VBoxMiniToolBar (QWidget *aParent, Alignment aAlignment )40 VBoxMiniToolBar::VBoxMiniToolBar (QWidget *aParent, Alignment aAlignment, bool aActive, bool aAutoHide) 41 41 : VBoxToolBar (aParent) 42 , mAutoHideCounter (0) 43 , mAutoHide (true) 42 , mActive (aActive) 43 , mPolished (false) 44 , mSeamless (false) 45 , mAutoHide (aAutoHide) 44 46 , mSlideToScreen (true) 45 47 , mHideAfterSlide (false) 46 , mPolished (false) 47 , mIsActive (true) 48 , mIsSeamless (false) 48 , mAutoHideCounter (0) 49 49 , mAlignment (aAlignment) 50 50 , mAnimated (true) … … 108 108 } 109 109 110 void VBoxMiniToolBar::setActive (bool aIsActive)111 {112 mIsActive = aIsActive;113 }114 115 void VBoxMiniToolBar::setIsSeamlessMode (bool aIsSeamless)116 {117 mIsSeamless = aIsSeamless;118 }119 120 110 VBoxMiniToolBar& VBoxMiniToolBar::operator<< (QList <QMenu*> aMenus) 121 111 { … … 135 125 } 136 126 127 void VBoxMiniToolBar::setSeamlessMode (bool aSeamless) 128 { 129 mSeamless = aSeamless; 130 } 131 132 /* Update the display text, usually the VM Name */ 133 void VBoxMiniToolBar::setDisplayText (const QString &aText) 134 { 135 mDisplayLabel->setText (aText); 136 } 137 138 bool VBoxMiniToolBar::isAutoHide() const 139 { 140 return mAutoHide; 141 } 142 137 143 void VBoxMiniToolBar::updateDisplay (bool aShow, bool aSetHideFlag) 138 144 { … … 153 159 mSlideToScreen = true; 154 160 } 155 if (m IsActive) show();161 if (mActive) show(); 156 162 mScrollTimer.start (mScrollDelay, this); 157 163 } 158 else if (m IsActive) show();164 else if (mActive) show(); 159 165 160 166 if (mAutoHide) … … 182 188 mAutoScrollTimer.stop(); 183 189 } 184 }185 186 /* Update the display text, usually the VM Name */187 void VBoxMiniToolBar::setDisplayText (const QString &aText)188 {189 mDisplayLabel->setText (aText);190 190 } 191 191 … … 226 226 case AlignBottom: 227 227 { 228 QRect screen = m IsSeamless ? QApplication::desktop()->availableGeometry (this) :229 228 QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (this) : 229 QApplication::desktop()->screenGeometry (this); 230 230 if (((mPositionY == screen.height() - height()) && mSlideToScreen) || 231 231 ((mPositionY == screen.height() - 1) && !mSlideToScreen)) … … 361 361 void VBoxMiniToolBar::moveToBase() 362 362 { 363 QRect screen = m IsSeamless ? QApplication::desktop()->availableGeometry (this) :364 363 QRect screen = mSeamless ? QApplication::desktop()->availableGeometry (this) : 364 QApplication::desktop()->screenGeometry (this); 365 365 mPositionX = screen.width() / 2 - width() / 2; 366 366 switch (mAlignment) … … 389 389 QPoint globalPosition = parentWidget()->mapFromGlobal (aPoint); 390 390 QRect fullArea = QApplication::desktop()->screenGeometry (this); 391 QRect realArea = m IsSeamless ? QApplication::desktop()->availableGeometry (this) :392 391 QRect realArea = mSeamless ? QApplication::desktop()->availableGeometry (this) : 392 QApplication::desktop()->screenGeometry (this); 393 393 QPoint shiftToReal (realArea.topLeft() - fullArea.topLeft()); 394 394 return globalPosition + shiftToReal;
Note:
See TracChangeset
for help on using the changeset viewer.