VirtualBox

Ignore:
Timestamp:
Nov 6, 2020 1:17:15 PM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Adding a close button to the find-in-page widget

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp

    r86821 r86826  
    8888    void sigSelectNextMatch();
    8989    void sigSelectPreviousMatch();
     90    void sigClose();
    9091
    9192public:
     
    106107    QIToolButton      *m_pNextButton;
    107108    QIToolButton      *m_pPreviousButton;
     109    QIToolButton      *m_pCloseButton;
    108110    QLabel            *m_pDragMoveLabel;
    109111    QPoint m_previousMousePosition;
     
    121123
    122124    void sigOpenLinkInNewTab(const QUrl &url);
     125    void sigCloseFindInPageWidget();
    123126
    124127public:
     
    200203    void sltHandleAddBookmarkAction();
    201204    void sltAnchorClicked(const QUrl &link);
     205    void sltCloseFindInPageWidget();
    202206
    203207private:
     
    276280    , m_pNextButton(0)
    277281    , m_pPreviousButton(0)
     282    , m_pCloseButton(0)
    278283    , m_previousMousePosition(-1, -1)
    279284{
     
    348353    m_pPreviousButton = new QIToolButton;
    349354    m_pNextButton = new QIToolButton;
     355    m_pCloseButton = new QIToolButton;
    350356
    351357    pLayout->addWidget(m_pPreviousButton);
    352358    pLayout->addWidget(m_pNextButton);
     359    pLayout->addWidget(m_pCloseButton);
    353360
    354361    m_pPreviousButton->setIcon(UIIconPool::iconSet(":/arrow_up_10px.png"));
    355362    m_pNextButton->setIcon(UIIconPool::iconSet(":/arrow_down_10px.png"));
     363    m_pCloseButton->setIcon(UIIconPool::iconSet(":/close_16px.png"));
    356364
    357365    connect(m_pPreviousButton, &QIToolButton::pressed, this, &UIFindInPageWidget::sigSelectPreviousMatch);
    358366    connect(m_pNextButton, &QIToolButton::pressed, this, &UIFindInPageWidget::sigSelectNextMatch);
     367    connect(m_pCloseButton, &QIToolButton::pressed, this, &UIFindInPageWidget::sigClose);
    359368}
    360369
     
    448457    connect(m_pContentViewer, &UIHelpBrowserViewer::sigOpenLinkInNewTab,
    449458        this, &UIHelpBrowserTab::sigOpenLinkInNewTab);
     459    connect(m_pContentViewer, &UIHelpBrowserViewer::sigCloseFindInPageWidget,
     460            this, &UIHelpBrowserTab::sltCloseFindInPageWidget);
     461
    450462    m_pContentViewer->setSource(initialUrl, m_strPageNotFoundText);
    451463}
     
    596608}
    597609
    598 
    599610void UIHelpBrowserTab::sltAnchorClicked(const QUrl &link)
    600611{
     
    602613}
    603614
     615void UIHelpBrowserTab::sltCloseFindInPageWidget()
     616{
     617    if (m_pFindInPageAction)
     618        m_pFindInPageAction->setChecked(false);
     619}
    604620
    605621/*********************************************************************************************************************************
     
    626642    connect(m_pFindInPageWidget, &UIFindInPageWidget::sigSelectNextMatch,
    627643            this, &UIHelpBrowserViewer::sltSelectNextMatch);
     644    connect(m_pFindInPageWidget, &UIFindInPageWidget::sigClose,
     645            this, &UIHelpBrowserViewer::sigCloseFindInPageWidget);
    628646
    629647    m_pFindInPageWidget->setVisible(false);
     
    697715        if (!m_fFindWidgetPositioned)
    698716        {
    699             m_pFindInPageWidget->move(width() - m_pFindInPageWidget->width() - 10, 10);
     717            m_pFindInPageWidget->move(m_iMarginForFindWidget, m_iMarginForFindWidget);
    700718            m_fFindWidgetPositioned = true;
    701719        }
     
    844862        m_pFindInPageWidget->setMatchCountAndCurrentIndex(m_matchedCursorPosition.size(), m_iSelectedMatchIndex);
    845863}
    846 
    847864
    848865/*********************************************************************************************************************************
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