Changeset 103093 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Jan 26, 2024 4:40:51 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 161339
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.cpp
r103083 r103093 27 27 28 28 /* Qt includes: */ 29 #include <Q HBoxLayout>29 #include <QGridLayout> 30 30 #include <QLabel> 31 31 #include <QStyle> 32 #include <QVBoxLayout>33 32 #include <QUrl> 34 33 … … 102 101 103 102 /* Prepare main layout: */ 104 Q HBoxLayout *pMainLayout = new QHBoxLayout(this);103 QGridLayout *pMainLayout = new QGridLayout(this); 105 104 if (pMainLayout) 106 105 { 107 /* Prepare welcome layout: */ 108 QVBoxLayout *pLayoutWelcome = new QVBoxLayout; 109 if (pLayoutWelcome) 106 const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2; 107 const int iT = qApp->style()->pixelMetric(QStyle::PM_LayoutTopMargin); 108 const int iR = qApp->style()->pixelMetric(QStyle::PM_LayoutRightMargin); 109 const int iB = qApp->style()->pixelMetric(QStyle::PM_LayoutBottomMargin) / 2; 110 #ifdef VBOX_WS_MAC 111 const int iSpacing = 20; 112 #else 113 const int iSpacing = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing); 114 #endif 115 pMainLayout->setContentsMargins(iL, iT, iR, iB); 116 pMainLayout->setSpacing(iSpacing); 117 pMainLayout->setRowStretch(1, 1); 118 119 /* Prepare greetings label: */ 120 m_pLabelGreetings = new QIRichTextLabel(this); 121 if (m_pLabelGreetings) 110 122 { 111 const int iL = qApp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) / 2; 112 #ifdef VBOX_WS_MAC 113 const int iSpacing = 20; 114 #else 115 const int iSpacing = qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing); 116 #endif 117 pLayoutWelcome->setContentsMargins(iL, 0, 0, 0); 118 pLayoutWelcome->setSpacing(iSpacing); 119 120 /* Prepare greetings label: */ 121 m_pLabelGreetings = new QIRichTextLabel(this); 122 if (m_pLabelGreetings) 123 { 124 m_pLabelGreetings->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); 125 connect(m_pLabelGreetings, &QIRichTextLabel::sigLinkClicked, this, &UIWelcomePane::sltHandleLinkActivated); 126 pLayoutWelcome->addWidget(m_pLabelGreetings); 127 } 128 129 /* Add stretch: */ 130 pLayoutWelcome->addStretch(); 131 132 /* Add into layout: */ 133 pMainLayout->addLayout(pLayoutWelcome); 123 m_pLabelGreetings->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Minimum); 124 connect(m_pLabelGreetings, &QIRichTextLabel::sigLinkClicked, this, &UIWelcomePane::sltHandleLinkActivated); 125 pMainLayout->addWidget(m_pLabelGreetings, 0, 0); 134 126 } 135 127 … … 139 131 { 140 132 m_pLabelIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 141 142 /* Add into layout: */ 143 pMainLayout->addWidget(m_pLabelIcon); 144 pMainLayout->setAlignment(m_pLabelIcon, Qt::AlignHCenter | Qt::AlignTop); 133 pMainLayout->addWidget(m_pLabelIcon, 0, 1); 145 134 } 146 135 }
Note:
See TracChangeset
for help on using the changeset viewer.