Changeset 6370 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jan 17, 2008 4:40:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r6173 r6370 564 564 565 565 mLicenseText->setTextFormat (Qt::RichText); 566 mAgreeButton->setEnabled (false);567 mDisagreeButton->setEnabled (false);568 566 569 567 connect (mLicenseText->verticalScrollBar(), SIGNAL (valueChanged (int)), … … 581 579 buttonLayout->addWidget (mDisagreeButton); 582 580 581 mLicenseText->verticalScrollBar()->installEventFilter (this); 582 583 583 resize (600, 450); 584 584 } … … 607 607 { 608 608 if (aValue == mLicenseText->verticalScrollBar()->maxValue()) 609 { 610 mAgreeButton->setEnabled (true); 611 mDisagreeButton->setEnabled (true); 612 } 609 unlockButtons(); 610 } 611 612 void unlockButtons() 613 { 614 mAgreeButton->setEnabled (true); 615 mDisagreeButton->setEnabled (true); 613 616 } 614 617 615 618 private: 619 620 void showEvent (QShowEvent *aEvent) 621 { 622 QDialog::showEvent (aEvent); 623 bool isScrollBarHidden = mLicenseText->verticalScrollBar()->isHidden() 624 && !(windowState() & WindowMinimized); 625 mAgreeButton->setEnabled (isScrollBarHidden); 626 mDisagreeButton->setEnabled (isScrollBarHidden); 627 } 628 629 bool eventFilter (QObject *aObject, QEvent *aEvent) 630 { 631 switch (aEvent->type()) 632 { 633 case QEvent::Hide: 634 if (aObject == mLicenseText->verticalScrollBar() && 635 (windowState() & WindowActive)) 636 unlockButtons(); 637 default: 638 break; 639 } 640 return QDialog::eventFilter (aObject, aEvent); 641 } 616 642 617 643 QString mFilePath;
Note:
See TracChangeset
for help on using the changeset viewer.