VirtualBox

Ignore:
Timestamp:
May 11, 2012 3:15:16 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: UIPopupBox stuff: Refactoring/cleanup (part 2).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp

    r41255 r41257  
    8080    /* Update title-icon: */
    8181    updateTitleIcon();
     82    /* Recalculate title-size: */
     83    recalc();
    8284}
    8385
     
    9395    /* Update warning-icon: */
    9496    updateWarningIcon();
     97    /* Recalculate title-size: */
     98    recalc();
    9599}
    96100
     
    106110    /* Update title: */
    107111    updateTitle();
     112    /* Recalculate title-size: */
     113    recalc();
    108114}
    109115
     
    267273    /* Assign title-icon: */
    268274    m_pTitleIcon->setPixmap(m_titleIcon.pixmap(16, 16));
    269     /* Recalculate title-size: */
    270     recalc();
    271275}
    272276
     
    277281    /* Assign warning-icon: */
    278282    m_pWarningIcon->setPixmap(m_warningIcon.pixmap(16, 16));
    279     /* Recalculate title-size: */
    280     recalc();
    281283}
    282284
    283285void UIPopupBox::updateTitle()
    284286{
    285     /* Update title: */
     287    /* If title-link is disabled or not set: */
    286288    if (!m_fLinkEnabled || m_strLink.isEmpty())
     289    {
     290        /* We should just set simple text title: */
    287291        m_pTitleLabel->setText(QString("<b>%1</b>").arg(m_strTitle));
    288     /* Recalculate title-size: */
    289     recalc();
     292    }
     293    /* If title-link is enabled and set: */
     294    else if (m_fLinkEnabled && !m_strLink.isEmpty())
     295    {
     296        /* We should set html reference title: */
     297        QPalette pal = m_pTitleLabel->palette();
     298        m_pTitleLabel->setText(QString("<b><a style=\"text-decoration: none; color: %1\" href=\"%2\">%3</a></b>")
     299                               .arg(m_fHeaderHover ? pal.color(QPalette::Link).name() : pal.color(QPalette::WindowText).name())
     300                               .arg(m_strLink)
     301                               .arg(m_strTitle));
     302    }
    290303}
    291304
     
    328341
    329342    /* Update title: */
    330     QPalette pal = m_pTitleLabel->palette();
    331     m_pTitleLabel->setText(QString("<b><a style=\"text-decoration: none; color: %1\" href=\"%2\">%3</a></b>")
    332                            .arg(m_fHeaderHover ? pal.color(QPalette::Link).name() : pal.color(QPalette::WindowText).name())
    333                            .arg(m_strLink)
    334                            .arg(m_strTitle));
     343    updateTitle();
     344
     345    /* Call for update: */
    335346    update();
    336347}
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