VirtualBox

Ignore:
Timestamp:
Dec 25, 2023 9:28:49 AM (12 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10513: UIAdvancedSettingsDialog: Adjust UIFilterEditor button to have search icon by default.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp

    r102636 r102696  
    178178    /** Adjusts editor geometry. */
    179179    void adjustEditorGeometry();
     180    /** Adjusts editor button icon. */
     181    void adjustEditorButtonIcon();
    180182
    181183    /** Defines internal widget @a iWidth. */
     
    478480void UIFilterEditor::sltHandleEditorTextChanged(const QString &strText)
    479481{
    480     m_pToolButton->setHidden(m_pLineEdit->text().isEmpty());
     482    adjustEditorButtonIcon();
    481483    emit sigTextChanged(strText);
    482484}
     
    519521                                      image: none;\
    520522                                      }");
    521         m_pToolButton->hide();
    522523        m_pToolButton->setIconSize(QSize(10, 10));
    523         m_pToolButton->setIcon(UIIconPool::iconSet(":/close_16px.png"));
    524524        connect(m_pToolButton, &QToolButton::clicked,
    525525                this, &UIFilterEditor::sltHandleButtonClicked);
     
    532532                                                         SIGNAL(sigFocused()), SIGNAL(sigUnfocused()));
    533533
    534     /* Adjust filter editor geometry initially: */
     534    /* Adjust stuff initially: */
    535535    adjustEditorGeometry();
     536    adjustEditorButtonIcon();
    536537}
    537538
     
    569570    m_pAnimation->update();
    570571    setEditorWidth(m_fFocused ? m_iFocusedEditorWidth : m_iUnfocusedEditorWidth);
     572}
     573
     574void UIFilterEditor::adjustEditorButtonIcon()
     575{
     576    AssertPtrReturnVoid(m_pLineEdit);
     577    AssertPtrReturnVoid(m_pToolButton);
     578    m_pToolButton->setIcon(  m_pLineEdit->text().isEmpty()
     579                           ? UIIconPool::iconSet(":/search_16px.png")
     580                           : UIIconPool::iconSet(":/close_16px.png"));
    571581}
    572582
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