VirtualBox

Changeset 87208 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jan 11, 2021 9:04:21 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9831. Adding a context menu item for find in page action

Location:
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
Files:
3 edited

Legend:

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

    r87176 r87208  
    764764{
    765765    if (m_pContentViewer)
    766         m_pContentViewer->toggleFindInPageWidget(fToggled);
     766        m_pContentViewer->sltToggleFindInPageWidget(fToggled);
    767767}
    768768
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp

    r87204 r87208  
    385385}
    386386
    387 void UIHelpViewer::toggleFindInPageWidget(bool fVisible)
     387void UIHelpViewer::sltToggleFindInPageWidget(bool fVisible)
    388388{
    389389    if (!m_pFindInPageWidget)
     
    423423        m_pFindInPageWidget->setFont(wFont);
    424424    }
     425}
     426
     427bool UIHelpViewer::isFindInPageWidgetVisible() const
     428{
     429    if (m_pFindInPageWidget)
     430        return m_pFindInPageWidget->isVisible();
     431    return false;
    425432}
    426433
     
    454461            this, &UIHelpViewer::sltHandleCopyLink);
    455462
     463
     464    QAction *pFindInPage = new QAction(UIHelpBrowserWidget::tr("Find in Page"));
     465    pFindInPage->setCheckable(true);
     466    if (m_pFindInPageWidget)
     467        pFindInPage->setChecked(m_pFindInPageWidget->isVisible());
     468    connect(pFindInPage, &QAction::toggled, this, &UIHelpViewer::sltToggleFindInPageWidget);
     469
    456470    pMenu.addAction(pNavigationActions);
    457471    pMenu.addAction(pOpenLinkAction);
    458472    pMenu.addAction(pOpenInNewTabAction);
    459473    pMenu.addAction(pCopyLink);
     474    pMenu.addAction(pFindInPage);
    460475
    461476    QString strAnchor = anchorAt(event->pos());
  • trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h

    r87160 r87208  
    5353    void emitHistoryChangedSignal();
    5454    void setSource(const QUrl &url) /* override */;
    55     void toggleFindInPageWidget(bool fVisible);
    5655    int initialFontPointSize() const;
    5756    void setFont(const QFont &);
     57    bool isFindInPageWidgetVisible() const;
    5858
    5959public slots:
    60 
     60    void sltToggleFindInPageWidget(bool fVisible);
    6161
    6262protected:
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