Changeset 47013 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jul 5, 2013 4:09:25 PM (12 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp
r47012 r47013 154 154 iTextPaneHeight); 155 155 m_pTextPane->layoutContent(); 156 /* Button-box: */ 156 157 /* Button-pane: */ 157 158 m_pButtonPane->move(m_iLayoutMargin + iTextPaneWidth + m_iLayoutSpacing, 158 159 m_iLayoutMargin); … … 163 164 void UIPopupPane::sltButtonClicked(int iButtonID) 164 165 { 166 /* Complete popup with corresponding code: */ 165 167 done(iButtonID & AlertButtonMask); 166 168 } … … 168 170 void UIPopupPane::prepare() 169 171 { 170 /* Install 'hover' animation for 'opacity' property: */171 UIAnimation::installPropertyAnimation(this, "opacity", "defaultOpacity", "hoveredOpacity",172 SIGNAL(sigHoverEnter()), SIGNAL(sigHoverLeave()));173 172 /* Prepare content: */ 174 173 prepareContent(); 174 /* Prepare animation: */ 175 prepareAnimation(); 175 176 } 176 177 … … 179 180 /* Prepare this: */ 180 181 installEventFilter(this); 182 181 183 /* Create message-label: */ 182 184 m_pTextPane = new UIPopupPaneTextPane(this); 183 185 { 184 186 /* Prepare label: */ 185 connect(m_pTextPane, SIGNAL(sigSizeHintChanged()), 186 this, SIGNAL(sigSizeHintChanged())); 187 connect(m_pTextPane, SIGNAL(sigSizeHintChanged()), this, SIGNAL(sigSizeHintChanged())); 187 188 m_pTextPane->installEventFilter(this); 188 189 m_pTextPane->setText(m_strMessage); 189 190 m_pTextPane->setProposeAutoConfirmation(m_fProposeAutoConfirmation); 190 191 } 192 191 193 /* Create button-box: */ 192 194 m_pButtonPane = new UIPopupPaneButtonPane(this); 193 195 { 194 196 /* Prepare button-box: */ 195 connect(m_pButtonPane, SIGNAL(sigButtonClicked(int)), 196 this, SLOT(sltButtonClicked(int))); 197 connect(m_pButtonPane, SIGNAL(sigButtonClicked(int)), this, SLOT(sltButtonClicked(int))); 197 198 m_pButtonPane->installEventFilter(this); 198 199 m_pButtonPane->setButtons(m_buttonDescriptions); … … 205 206 setFocusProxy(m_pButtonPane); 206 207 m_pTextPane->setFocusProxy(m_pButtonPane); 208 } 209 210 void UIPopupPane::prepareAnimation() 211 { 212 /* Install 'hover' animation for 'opacity' property: */ 213 UIAnimation::installPropertyAnimation(this, "opacity", "defaultOpacity", "hoveredOpacity", 214 SIGNAL(sigHoverEnter()), SIGNAL(sigHoverLeave())); 207 215 } 208 216 … … 275 283 painter.setRenderHint(QPainter::Antialiasing); 276 284 277 /* Configure painter clipping: */ 285 /* Configure clipping: */ 286 configureClipping(rect, painter); 287 288 /* Paint background: */ 289 paintBackground(rect, painter); 290 } 291 292 void UIPopupPane::configureClipping(const QRect &rect, QPainter &painter) 293 { 294 /* Configure clipping: */ 278 295 QPainterPath path; 279 296 int iDiameter = 6; … … 289 306 path.closeSubpath(); 290 307 painter.setClipPath(path); 291 292 /* Fill with background: */ 308 } 309 310 void UIPopupPane::paintBackground(const QRect &rect, QPainter &painter) 311 { 312 /* Paint background: */ 293 313 QColor currentColor(palette().color(QPalette::Window)); 294 314 QColor newColor1(currentColor.red(), currentColor.green(), currentColor.blue(), opacity()); -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.h
r47012 r47013 28 28 class UIPopupPaneButtonPane; 29 29 30 /* Popup-pane prototype class: */30 /* Popup-pane prototype: */ 31 31 class UIPopupPane : public QWidget 32 32 { … … 84 84 void prepare(); 85 85 void prepareContent(); 86 void prepareAnimation(); 86 87 87 88 /* Handler: Event-filter stuff: */ … … 90 91 /* Handler: Event stuff: */ 91 92 void paintEvent(QPaintEvent *pEvent); 93 94 /* Helpers: Paint stuff: */ 95 void configureClipping(const QRect &rect, QPainter &painter); 96 void paintBackground(const QRect &rect, QPainter &painter); 92 97 93 98 /* Helper: Complete stuff: */
Note:
See TracChangeset
for help on using the changeset viewer.