Changeset 57511 in vbox for trunk/src/VBox
- Timestamp:
- Aug 24, 2015 1:57:15 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxAboutDlg.cpp
r52722 r57511 24 24 # include <QEvent> 25 25 # include <QPainter> 26 # include <QLabel> 26 27 # include <iprt/path.h> 27 28 # include <VBox/version.h> /* VBOX_VENDOR */ … … 38 39 39 40 VBoxAboutDlg::VBoxAboutDlg(QWidget *pParent, const QString &strVersion) 40 : QIWithRetranslateUI2<QIDialog>(pParent , Qt::CustomizeWindowHint | Qt::WindowTitleHint)41 : QIWithRetranslateUI2<QIDialog>(pParent) 41 42 , m_strVersion(strVersion) 42 43 { … … 63 64 m_pixmap = icon.pixmap(m_size); 64 65 66 /* Create main layout: */ 67 QVBoxLayout *pMainLayout = new QVBoxLayout(this); 68 69 /* Create label for version text: */ 70 m_pLabel = new QLabel(); 71 pMainLayout->addWidget(m_pLabel); 72 73 QPalette palette; 74 /* Branding: Set a different text color (because splash also could be white), 75 * otherwise use white as default color: */ 76 QString strColor = vboxGlobal().brandingGetKey("UI/AboutTextColor"); 77 if (!strColor.isEmpty()) 78 palette.setColor(QPalette::WindowText, QColor(strColor).name()); 79 else 80 palette.setColor(QPalette::WindowText, Qt::black); 81 m_pLabel->setPalette(palette); 82 m_pLabel->setTextInteractionFlags(Qt::TextSelectableByMouse); 83 m_pLabel->setFont(font()); 84 85 pMainLayout->setAlignment(m_pLabel, Qt::AlignRight | Qt::AlignBottom); 86 65 87 /* Translate: */ 66 88 retranslateUi(); … … 71 93 if (pEvent->type() == QEvent::Polish) 72 94 setFixedSize(m_size); 73 if (pEvent->type() == QEvent::WindowDeactivate)74 close();75 95 return QIDialog::event(pEvent); 76 96 } … … 80 100 QPainter painter(this); 81 101 painter.drawPixmap(0, 0, m_pixmap); 82 painter.setFont(font());83 84 /* Branding: Set a different text color (because splash also could be white),85 otherwise use white as default color: */86 QString strColor = vboxGlobal().brandingGetKey("UI/AboutTextColor");87 if (!strColor.isEmpty())88 painter.setPen(QColor(strColor).name());89 else90 painter.setPen(Qt::black);91 #if VBOX_OSE92 painter.drawText(QRect(0, 400, 600, 32),93 Qt::AlignCenter | Qt::AlignVCenter | Qt::TextWordWrap,94 m_strAboutText);95 #else /* VBOX_OSE */96 painter.drawText(QRect(271, 370, 360, 72),97 Qt::AlignLeft | Qt::AlignBottom | Qt::TextWordWrap,98 m_strAboutText);99 #endif /* VBOX_OSE */100 }101 102 void VBoxAboutDlg::mouseReleaseEvent(QMouseEvent* /* pEvent */)103 {104 /* Close the dialog on mouse button release: */105 close();106 102 } 107 103 … … 109 105 { 110 106 setWindowTitle(tr("VirtualBox - About")); 111 QString strAboutText = 107 QString strAboutText = tr("VirtualBox Graphical User Interface"); 112 108 #ifdef VBOX_BLEEDING_EDGE 113 109 QString strVersionText = "EXPERIMENTAL build %1 - " + QString(VBOX_BLEEDING_EDGE); … … 121 117 m_strAboutText = strAboutText + "\n" + strVersionText.arg(m_strVersion); 122 118 #endif /* VBOX_OSE */ 119 m_strAboutText = m_strAboutText + "\n" + QString("Copyright %1 2015 Oracle and/or its affiliates. All rights reserved.").arg(QChar(0xa9)); 120 m_pLabel->setText(m_strAboutText); 123 121 } 124 122 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxAboutDlg.h
r55401 r57511 28 28 /* Forward declarations */ 29 29 class QEvent; 30 class QLabel; 30 31 31 32 /* VBox about dialog */ … … 44 45 bool event(QEvent *pEvent); 45 46 void paintEvent(QPaintEvent *pEvent); 46 void mouseReleaseEvent(QMouseEvent *pEvent);47 47 48 48 /* Language stuff: */ … … 56 56 QPixmap m_pixmap; 57 57 QSize m_size; 58 QLabel *m_pLabel; 58 59 }; 59 60
Note:
See TracChangeset
for help on using the changeset viewer.