Changeset 52349 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 11, 2014 6:24:56 PM (11 years ago)
- svn:sync-xref-src-repo-rev:
- 95476
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIStatusBarEditorWindow.cpp
r52097 r52349 807 807 m_pEmbeddedWidget->setGeometry(0, sh.height(), qMax(width(), sh.width()), sh.height()); 808 808 809 #ifdef Q_WS_X11 810 /* The setMask functionality is excessive under Win/Mac hosts 811 * because there is a Qt composition works properly, 812 * Mac host has native translucency support, 813 * Win host allows to enable it through Qt::WA_TranslucentBackground: */ 814 setMask(m_pEmbeddedWidget->geometry()); 815 #endif /* Q_WS_X11 */ 816 809 817 #ifdef Q_WS_WIN 810 818 /* Raise tool-window for proper z-order. */ … … 842 850 m_pEmbeddedWidget->setGeometry(0, 0, qMax(width(), sh.width()), sh.height()); 843 851 844 #ifdef Q_WS_WIN845 /* Raise tool-window for proper z-order. */846 raise();847 #endif /* Q_WS_WIN */848 }849 850 void UIStatusBarEditorWindow::updateAnimation()851 {852 /* Skip if no animation created: */853 if (!m_pAnimation)854 return;855 856 /* Recalculate mdi-sub-window geometry animation boundaries based on size-hint: */857 const QSize sh = m_pEmbeddedWidget->sizeHint();858 m_startWidgetGeometry = QRect(0, sh.height(), qMax(width(), sh.width()), sh.height());859 m_finalWidgetGeometry = QRect(0, 0, qMax(width(), sh.width()), sh.height());860 m_pAnimation->update();861 }862 863 void UIStatusBarEditorWindow::showEvent(QShowEvent*)864 {865 /* If window isn't expanded: */866 if (!m_fExpanded)867 {868 /* Start expand animation: */869 emit sigShown();870 }871 }872 873 void UIStatusBarEditorWindow::closeEvent(QCloseEvent *pEvent)874 {875 /* If window isn't expanded: */876 if (!m_fExpanded)877 {878 /* Ignore close-event: */879 pEvent->ignore();880 return;881 }882 883 /* If animation state is Final: */884 const QString strAnimationState = property("AnimationState").toString();885 bool fAnimationComplete = strAnimationState == "Final";886 if (fAnimationComplete)887 {888 /* Ignore close-event: */889 pEvent->ignore();890 /* And start collapse animation: */891 emit sigCollapse();892 }893 }894 895 void UIStatusBarEditorWindow::setWidgetGeometry(const QRect &rect)896 {897 /* Apply mdi-sub-window geometry: */898 m_pEmbeddedWidget->setGeometry(rect);899 900 852 #ifdef Q_WS_X11 901 853 /* The setMask functionality is excessive under Win/Mac hosts … … 905 857 setMask(m_pEmbeddedWidget->geometry()); 906 858 #endif /* Q_WS_X11 */ 859 860 #ifdef Q_WS_WIN 861 /* Raise tool-window for proper z-order. */ 862 raise(); 863 #endif /* Q_WS_WIN */ 864 } 865 866 void UIStatusBarEditorWindow::updateAnimation() 867 { 868 /* Skip if no animation created: */ 869 if (!m_pAnimation) 870 return; 871 872 /* Recalculate mdi-sub-window geometry animation boundaries based on size-hint: */ 873 const QSize sh = m_pEmbeddedWidget->sizeHint(); 874 m_startWidgetGeometry = QRect(0, sh.height(), qMax(width(), sh.width()), sh.height()); 875 m_finalWidgetGeometry = QRect(0, 0, qMax(width(), sh.width()), sh.height()); 876 m_pAnimation->update(); 877 } 878 879 void UIStatusBarEditorWindow::showEvent(QShowEvent*) 880 { 881 /* If window isn't expanded: */ 882 if (!m_fExpanded) 883 { 884 /* Start expand animation: */ 885 emit sigShown(); 886 } 887 } 888 889 void UIStatusBarEditorWindow::closeEvent(QCloseEvent *pEvent) 890 { 891 /* If window isn't expanded: */ 892 if (!m_fExpanded) 893 { 894 /* Ignore close-event: */ 895 pEvent->ignore(); 896 return; 897 } 898 899 /* If animation state is Final: */ 900 const QString strAnimationState = property("AnimationState").toString(); 901 bool fAnimationComplete = strAnimationState == "Final"; 902 if (fAnimationComplete) 903 { 904 /* Ignore close-event: */ 905 pEvent->ignore(); 906 /* And start collapse animation: */ 907 emit sigCollapse(); 908 } 909 } 910 911 void UIStatusBarEditorWindow::setWidgetGeometry(const QRect &rect) 912 { 913 /* Apply mdi-sub-window geometry: */ 914 m_pEmbeddedWidget->setGeometry(rect); 915 916 #ifdef Q_WS_X11 917 /* The setMask functionality is excessive under Win/Mac hosts 918 * because there is a Qt composition works properly, 919 * Mac host has native translucency support, 920 * Win host allows to enable it through Qt::WA_TranslucentBackground: */ 921 setMask(m_pEmbeddedWidget->geometry()); 922 #endif /* Q_WS_X11 */ 907 923 } 908 924
Note:
See TracChangeset
for help on using the changeset viewer.