Changeset 27401 in vbox
- Timestamp:
- Mar 16, 2010 1:16:47 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58863
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxCocoaSpecialControls.h
r25171 r27401 56 56 signals: 57 57 void clicked (bool checked = false); 58 59 protected: 60 void resizeEvent(QResizeEvent *pEvent); 58 61 59 62 private: -
trunk/src/VBox/Frontends/VirtualBox/src/darwin/VBoxCocoaSpecialControls.mm
r24187 r27401 1 /* $Id$ */ 1 2 /** @file 2 3 * … … 204 205 : QMacCocoaViewContainer (0, aParent) 205 206 { 207 setContentsMargins(0, 0, 0, 0); 206 208 switch (aType) 207 209 { … … 250 252 } 251 253 254 void VBoxCocoaButton::resizeEvent(QResizeEvent * /* pEvent */) 255 { 256 NSRect frame = [mNativeRef frame]; 257 frame.size.width = width(); 258 frame.size.height = height(); 259 [mNativeRef setFrame:frame]; 260 } 261 252 262 void VBoxCocoaButton::setText (const QString& aText) 253 263 { -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloader.cpp
r27374 r27401 27 27 #include "VBoxGlobal.h" 28 28 #include "VBoxProblemReporter.h" 29 #include "VBoxSpecialControls.h" 29 30 30 31 /* Global includes */ … … 35 36 : QWidget(pParent) 36 37 , m_pProgressBar(new QProgressBar(this)) 37 , m_pCancelButton(new QToolButton(this))38 , m_pCancelButton(new VBoxMiniCancelButton(this)) 38 39 { 39 40 /* Progress Bar setup */ … … 43 44 44 45 /* Cancel Button setup */ 45 m_pCancelButton->setAutoRaise(true);46 46 m_pCancelButton->setFocusPolicy(Qt::TabFocus); 47 m_pCancelButton->removeBorder(); 47 48 connect(m_pCancelButton, SIGNAL(clicked()), 48 49 this, SIGNAL(sigCancel())); 49 50 51 setContentsMargins(0, 0, 0, 0); 52 setFixedHeight(16); 53 50 54 /* Layout setup */ 51 setFixedHeight(16);52 55 QHBoxLayout *pMainLayout = new QHBoxLayout(this); 56 VBoxGlobal::setLayoutMargin(pMainLayout, 0); 57 58 #ifdef Q_WS_MAC 59 pMainLayout->setSpacing(2); 60 m_pProgressBar->setFixedHeight(14); 61 m_pCancelButton->setFixedHeight(11); 62 pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignTop); 63 pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignBottom); 64 #else /* Q_WS_MAC */ 53 65 pMainLayout->setSpacing(0); 54 VBoxGlobal::setLayoutMargin(pMainLayout, 0); 55 pMainLayout->addWidget(m_pProgressBar); 56 pMainLayout->addWidget(m_pCancelButton); 66 pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignCenter); 67 pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignCenter); 68 #endif /* !Q_WS_MAC */ 69 57 70 pMainLayout->addStretch(1); 71 58 72 } 59 73 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloader.h
r27374 r27401 28 28 #include <QWidget> 29 29 30 /* Local forward declarations */ 31 class QIHttp; 32 class VBoxMiniCancelButton; 33 30 34 /* Global forward declarations */ 31 class QIHttp;32 35 class QHttpResponseHeader; 33 36 class QProgressBar; 34 class QToolButton;35 37 36 38 class UIMiniProcessWidget : public QWidget … … 66 68 /* Private member vars */ 67 69 QProgressBar *m_pProgressBar; 68 QToolButton *m_pCancelButton; 70 VBoxMiniCancelButton *m_pCancelButton; 71 69 72 QString m_strSource; 70 73 }; -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxSpecialControls.cpp
r26715 r27401 43 43 this, SIGNAL (clicked())); 44 44 setFixedSize (mButton->size()); 45 } 46 47 void VBoxMiniCancelButton::resizeEvent(QResizeEvent * /* pEvent */) 48 { 49 mButton->resize(size()); 45 50 } 46 51 … … 103 108 ":/delete_dis_16px.png"); 104 109 setIcon (cancelIcon); 110 } 111 112 void VBoxMiniCancelButton::removeBorder() 113 { 114 setStyleSheet("QToolButton { border: 0px }"); 105 115 } 106 116 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/VBoxSpecialControls.h
r25178 r27401 49 49 void setText (const QString &aText) { mButton->setText (aText); } 50 50 void setToolTip (const QString &aTip) { mButton->setToolTip (aTip); } 51 void removeBorder() {} 51 52 52 53 protected: 53 54 void paintEvent (QPaintEvent * /* aEvent */) {} 55 void resizeEvent(QResizeEvent *pEvent); 54 56 55 57 private: … … 130 132 public: 131 133 VBoxMiniCancelButton (QWidget *aParent = 0); 134 void removeBorder(); 132 135 133 136 protected:
Note:
See TracChangeset
for help on using the changeset viewer.