VirtualBox

Ignore:
Timestamp:
May 28, 2020 3:01:49 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9653: VirtualBox Manager: Chooser pane: Chooser-view prepare-cascade cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser
Files:
2 edited

Legend:

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

    r84587 r84596  
    232232    QAccessible::installFactory(UIAccessibilityInterfaceForUIChooserView::pFactory);
    233233
     234    /* Prepare everything: */
     235    prepareThis();
     236    prepareWidget();
     237
     238    /* Update everything: */
     239    updateSceneRect();
     240    updateSearchWidgetGeometry();
     241
     242    /* Apply language settings: */
     243    retranslateUi();
     244}
     245
     246void UIChooserView::prepareThis()
     247{
    234248    /* Prepare palette: */
    235     preparePalette();
    236 
    237     /* Setup frame: */
     249    QPalette pal = qApp->palette();
     250    const QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110);
     251    pal.setColor(QPalette::Base, bodyColor);
     252    setPalette(pal);
     253
     254    /* Prepare frame: */
    238255    setFrameShape(QFrame::NoFrame);
    239256    setFrameShadow(QFrame::Plain);
    240257    setAlignment(Qt::AlignLeft | Qt::AlignTop);
    241258
    242     /* Setup scroll-bars policy: */
     259    /* Prepare scroll-bars policy: */
    243260    setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    244261    setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
    245 
    246     /* Create the search widget (hidden): */
     262}
     263
     264void UIChooserView::prepareWidget()
     265{
     266    /* Create the search widget (initially hidden): */
    247267    m_pSearchWidget = new UIChooserSearchWidget(this);
    248268    if (m_pSearchWidget)
     
    256276                this, &UIChooserView::sltHandleSearchWidgetVisibilityToggle);
    257277    }
    258 
    259     /* Update scene rectangle: */
    260     updateSceneRect();
    261     /* Update the location and size of the search widget: */
    262     updateSearchWidgetGeometry();
    263 
    264     /* Apply language settings: */
    265     retranslateUi();
    266 }
    267 
    268 void UIChooserView::preparePalette()
    269 {
    270     QPalette pal = qApp->palette();
    271     const QColor bodyColor = pal.color(QPalette::Active, QPalette::Midlight).darker(110);
    272     pal.setColor(QPalette::Base, bodyColor);
    273     setPalette(pal);
    274278}
    275279
     
    281285    emit sigResized();
    282286
    283     /* Update scene rectangle: */
     287    /* Update everything: */
    284288    updateSceneRect();
    285     /* Update search widget geometry: */
    286289    updateSearchWidgetGeometry();
    287290}
  • trunk/src/VBox/Frontends/VirtualBox/src/manager/chooser/UIChooserView.h

    r84587 r84596  
    4545public:
    4646
    47     /** Constructs a Chooser-view passing @a pParent to the base-class.
    48       * @param  pParent  Brings the chooser container to embed into. */
     47    /** Constructs a Chooser-view passing @a pParent to the base-class. */
    4948    UIChooserView(QWidget *pParent);
    5049
     
    6362        /** Makes search widget @a fVisible. */
    6463        void setSearchWidgetVisible(bool fVisible);
     64
    6565        /** Updates search widget's results count.
    6666          * @param  iTotalMatchCount             Brings total search results count.
     
    113113        /** Prepares all. */
    114114        void prepare();
    115         /** Prepares palette. */
    116         void preparePalette();
     115        /** Prepares this. */
     116        void prepareThis();
     117        /** Prepares widgets. */
     118        void prepareWidget();
    117119    /** @} */
    118120
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