VirtualBox

Changeset 103069 in vbox


Ignore:
Timestamp:
Jan 25, 2024 4:04:33 PM (10 months ago)
Author:
vboxsync
Message:

FE/Qt: UIWelcomePane: Reworking widget layout to be able to have additional widgets.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/UIWelcomePane.cpp

    r103068 r103069  
    7878{
    7979    /* Translate greetings text: */
    80     m_pLabelGreetings->setText(tr("<h3>Welcome to VirtualBox!</h3>"
    81                                   "<p>The left part of application window contains global tools and "
    82                                   "lists all virtual machines and virtual machine groups on your computer. "
    83                                   "You can import, add and create new VMs using corresponding toolbar buttons. "
    84                                   "You can popup a tools of currently selected element using corresponding element button.</p>"
    85                                   "<p>You can press the <b>%1</b> key to get instant help, or visit "
    86                                   "<a href=https://www.virtualbox.org>www.virtualbox.org</a> "
    87                                   "for more information and latest news.</p>")
    88                                   .arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
     80    if (m_pLabelGreetings)
     81        m_pLabelGreetings->setText(tr("<h3>Welcome to VirtualBox!</h3>"
     82                                      "<p>The left part of application window contains global tools and "
     83                                      "lists all virtual machines and virtual machine groups on your computer. "
     84                                      "You can import, add and create new VMs using corresponding toolbar buttons. "
     85                                      "You can popup a tools of currently selected element using corresponding element "
     86                                      "button.</p>"
     87                                      "<p>You can press the <b>%1</b> key to get instant help, or visit "
     88                                      "<a href=https://www.virtualbox.org>www.virtualbox.org</a> "
     89                                      "for more information and latest news.</p>")
     90                                      .arg(QKeySequence(QKeySequence::HelpContents).toString(QKeySequence::NativeText)));
    8991}
    9092
     
    100102
    101103    /* Prepare main layout: */
    102     QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     104    QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    103105    if (pMainLayout)
    104106    {
    105107        /* Prepare welcome layout: */
    106         QHBoxLayout *pLayoutWelcome = new QHBoxLayout;
     108        QVBoxLayout *pLayoutWelcome = new QVBoxLayout;
    107109        if (pLayoutWelcome)
    108110        {
    109111            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
    110117            pLayoutWelcome->setContentsMargins(iL, 0, 0, 0);
     118            pLayoutWelcome->setSpacing(iSpacing);
    111119
    112120            /* Prepare greetings label: */
     
    119127            }
    120128
    121             /* Prepare icon label: */
    122             m_pLabelIcon = new QLabel(this);
    123             if (m_pLabelIcon)
    124             {
    125                 m_pLabelIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
    126 
    127                 /* Add into layout: */
    128                 pLayoutWelcome->addWidget(m_pLabelIcon);
    129                 pLayoutWelcome->setAlignment(m_pLabelIcon, Qt::AlignHCenter | Qt::AlignTop);
    130             }
     129            /* Add stretch: */
     130            pLayoutWelcome->addStretch();
    131131
    132132            /* Add into layout: */
     
    134134        }
    135135
    136         /* Add stretch: */
    137         pMainLayout->addStretch();
     136        /* Prepare icon label: */
     137        m_pLabelIcon = new QLabel(this);
     138        if (m_pLabelIcon)
     139        {
     140            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);
     145        }
    138146    }
    139147
     
    164172{
    165173    /* Assign corresponding icon: */
    166     if (!m_icon.isNull())
     174    if (!m_icon.isNull() && m_pLabelIcon)
    167175    {
    168176        /* Check which size goes as the default one: */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette