- Timestamp:
- Apr 7, 2021 2:39:51 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r88392 r88401 73 73 74 74 /********************************************************************************************************************************* 75 * UI FontScaleWidget definition. *75 * UIContentZoomWidget definition. * 76 76 *********************************************************************************************************************************/ 77 class UI FontScaleWidget : public QIWithRetranslateUI<QWidget>77 class UIContentZoomWidget : public QIWithRetranslateUI<QWidget> 78 78 { 79 79 … … 86 86 public: 87 87 88 UI FontScaleWidget(int iInitialFontPointSize, QWidget *pParent = 0);88 UIContentZoomWidget(int iInitialFontPointSize, QWidget *pParent = 0); 89 89 void setFontPointSize(int iFontPointSize); 90 90 int fontPointSize() const; … … 259 259 260 260 public: 261 262 enum ZoomOperation 263 { 264 ZoomOperation_In = 0, 265 ZoomOperation_Out, 266 ZoomOperation_Reset, 267 ZoomOperation_Max 268 }; 261 269 262 270 UIHelpBrowserTabManager(const QHelpEngine *pHelpEngine, const QUrl &homeUrl, … … 311 319 int findTab(const QUrl &Url) const; 312 320 const QHelpEngine* m_pHelpEngine; 313 UI FontScaleWidget *m_pFontScaleWidget;321 UIContentZoomWidget *m_pFontScaleWidget; 314 322 QUrl m_homeUrl; 315 323 QStringList m_savedUrlList; … … 322 330 323 331 /********************************************************************************************************************************* 324 * UI FontScaleWidget implementation.*332 * UIContentZoomWidget implementation. * 325 333 *********************************************************************************************************************************/ 326 334 327 UI FontScaleWidget::UIFontScaleWidget(int iInitialFontPointSize, QWidget *pParent /* = 0 */)335 UIContentZoomWidget::UIContentZoomWidget(int iInitialFontPointSize, QWidget *pParent /* = 0 */) 328 336 :QIWithRetranslateUI<QWidget>(pParent) 329 337 , m_pMainLayout(0) … … 338 346 } 339 347 340 void UI FontScaleWidget::setFontPointSize(int iFontPointSize)348 void UIContentZoomWidget::setFontPointSize(int iFontPointSize) 341 349 { 342 350 if (m_iFontPointSize == iFontPointSize) … … 347 355 } 348 356 349 int UI FontScaleWidget::fontPointSize() const357 int UIContentZoomWidget::fontPointSize() const 350 358 { 351 359 return m_iFontPointSize; 352 360 } 353 361 354 void UI FontScaleWidget::retranslateUi()355 { 356 } 357 358 void UI FontScaleWidget::prepare()362 void UIContentZoomWidget::retranslateUi() 363 { 364 } 365 366 void UIContentZoomWidget::prepare() 359 367 { 360 368 setAutoFillBackground(true); … … 378 386 m_pPlusButton->setIcon(UIIconPool::iconSet(":/help_browser_plus_32px.png")); 379 387 380 connect(m_pPlusButton, &QIToolButton::pressed, this, &UI FontScaleWidget::sltSetFontPointSize);381 connect(m_pMinusButton, &QIToolButton::pressed, this, &UI FontScaleWidget::sltSetFontPointSize);382 connect(m_pResetButton, &QIToolButton::pressed, this, &UI FontScaleWidget::sltSetFontPointSize);388 connect(m_pPlusButton, &QIToolButton::pressed, this, &UIContentZoomWidget::sltSetFontPointSize); 389 connect(m_pMinusButton, &QIToolButton::pressed, this, &UIContentZoomWidget::sltSetFontPointSize); 390 connect(m_pResetButton, &QIToolButton::pressed, this, &UIContentZoomWidget::sltSetFontPointSize); 383 391 384 392 m_pMainLayout->addWidget(m_pResetButton); … … 388 396 } 389 397 390 int UI FontScaleWidget::fontPercentage() const398 int UIContentZoomWidget::fontPercentage() const 391 399 { 392 400 if (m_iInitialFontPointSize == 0) … … 395 403 } 396 404 397 void UI FontScaleWidget::sltSetFontPointSize()405 void UIContentZoomWidget::sltSetFontPointSize() 398 406 { 399 407 if (!sender()) … … 870 878 if (!m_pFontScaleWidget) 871 879 { 872 m_pFontScaleWidget = new UI FontScaleWidget(initialFontPointSize(), this);873 connect(m_pFontScaleWidget, &UI FontScaleWidget::sigFontPointSizeChanged,880 m_pFontScaleWidget = new UIContentZoomWidget(initialFontPointSize(), this); 881 connect(m_pFontScaleWidget, &UIContentZoomWidget::sigFontPointSizeChanged, 874 882 this, &UIHelpBrowserTabManager::sltHandleFontSizeChange); 875 883 } … … 1308 1316 1309 1317 connect(m_pFontSizeLargerAction, &QAction::triggered, 1310 this, &UIHelpBrowserWidget::sltHandle FontSizeActions);1318 this, &UIHelpBrowserWidget::sltHandleZoomActions); 1311 1319 connect(m_pFontSizeSmallerAction, &QAction::triggered, 1312 this, &UIHelpBrowserWidget::sltHandle FontSizeActions);1320 this, &UIHelpBrowserWidget::sltHandleZoomActions); 1313 1321 connect(m_pFontSizeResetAction, &QAction::triggered, 1314 this, &UIHelpBrowserWidget::sltHandle FontSizeActions);1322 this, &UIHelpBrowserWidget::sltHandleZoomActions); 1315 1323 } 1316 1324 … … 1597 1605 1598 1606 if (m_pFontSizeLargerAction) 1599 m_pFontSizeLargerAction->setText(tr(" Increase Font Size"));1607 m_pFontSizeLargerAction->setText(tr("Zoom &In")); 1600 1608 if (m_pFontSizeSmallerAction) 1601 m_pFontSizeSmallerAction->setText(tr(" Decrease Font Size"));1609 m_pFontSizeSmallerAction->setText(tr("Zoom &Out")); 1602 1610 if (m_pFontSizeResetAction) 1603 m_pFontSizeResetAction->setText(tr(" Reset Font Size"));1611 m_pFontSizeResetAction->setText(tr("&Reset Zoom")); 1604 1612 } 1605 1613 … … 1870 1878 } 1871 1879 1872 void UIHelpBrowserWidget::sltHandle FontSizeActions()1880 void UIHelpBrowserWidget::sltHandleZoomActions() 1873 1881 { 1874 1882 if (!sender() || !m_pTabManager) -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r87656 r88401 93 93 void sltCopyLink(); 94 94 void sltAddNewBookmark(const QUrl &url, const QString &strTitle); 95 void sltHandle FontSizeActions();95 void sltHandleZoomActions(); 96 96 void sltHandleTabListChanged(const QStringList &titleList); 97 97 void sltHandleTabChoose(); -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r88398 r88401 375 375 QTextBrowser::setSource(url); 376 376 QTextDocument *pDocument = document(); 377 //iterateDocumentImages();377 iterateDocumentImages(); 378 378 if (!pDocument || pDocument->isEmpty()) 379 379 { … … 508 508 void UIHelpViewer::wheelEvent(QWheelEvent *pEvent) 509 509 { 510 Q_UNUSED(pEvent); 511 /* Disable wheel scaling for now: */ 512 #if 0 510 513 int iPreviousSize = font().pointSize(); 514 /* QTextBrowser::wheelEvent sets a new font size: */ 511 515 QTextBrowser::wheelEvent(pEvent); 512 516 /* Don't allow font size to get too large or small: */ … … 520 524 else 521 525 emit sigFontPointSizeChanged(font().pointSize()); 526 #endif 522 527 } 523 528
Note:
See TracChangeset
for help on using the changeset viewer.