Changeset 88408 in vbox
- Timestamp:
- Apr 8, 2021 9:22:28 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r88401 r88408 69 69 70 70 static const int iBookmarkUrlDataType = 6; 71 static int iFontPointSizeChangeStep = 2;72 const QPair<float, float> UIHelpBrowserWidget::fontScaleMinMax = QPair<float, float>(0.5f, 3.f);73 71 74 72 /********************************************************************************************************************************* 75 * UI ContentZoomWidget definition. *73 * UIZoomWidget definition. * 76 74 *********************************************************************************************************************************/ 77 class UI ContentZoomWidget : public QIWithRetranslateUI<QWidget>75 class UIZoomWidget : public QIWithRetranslateUI<QWidget> 78 76 { 79 77 … … 82 80 signals: 83 81 84 void sig FontPointSizeChanged(int iNewFontPointSize);82 void sigZoomChanged(UIHelpViewer::ZoomOperation enmOperation); 85 83 86 84 public: 87 85 88 UIContentZoomWidget(int iInitialFontPointSize, QWidget *pParent = 0); 89 void setFontPointSize(int iFontPointSize); 90 int fontPointSize() const; 86 87 UIZoomWidget(QWidget *pParent = 0); 88 int zoomPercentage() const; 89 void setZoomPercentage(int iZoomPercentage); 91 90 92 91 protected: … … 96 95 private slots: 97 96 98 void slt SetFontPointSize();97 void sltZoomOperation(); 99 98 100 99 private: 101 100 102 101 void prepare(); 103 int fontPercentage() const; 102 //int fontPercentage() const; 103 104 104 QHBoxLayout *m_pMainLayout; 105 105 QIToolButton *m_pMinusButton; … … 107 107 QIToolButton *m_pPlusButton; 108 108 QLabel *m_pValueLabel; 109 int m_iInitialFontPointSize;110 int m_iFontPointSize;111 109 }; 112 110 … … 190 188 void sigOpenLinkInNewTab(const QUrl &url, bool fBackground); 191 189 void sigAddBookmark(const QUrl &url, const QString &strTitle); 192 void sigFontPointSizeChanged(int iFontPointSize);193 190 void sigLinkHighlighted(const QString &strLink); 194 191 … … 203 200 void setToolBarVisible(bool fVisible); 204 201 void print(QPrinter &printer); 205 int initialFontPointSize() const; 206 void setFontPointSize(int iPointSize); 207 int fontPointSize() const; 202 void zoom(UIHelpViewer::ZoomOperation enmZoomOperation); 208 203 209 204 private slots: … … 226 221 virtual void retranslateUi() /* override */; 227 222 void setActionTextAndToolTip(QAction *pAction, const QString &strText, const QString &strToolTip); 223 // int initialFontPointSize() const; 224 // void setFontPointSize(int iPointSize); 225 // int fontPointSize() const; 228 226 229 227 QAction *m_pHomeAction; … … 260 258 public: 261 259 262 enum ZoomOperation263 {264 ZoomOperation_In = 0,265 ZoomOperation_Out,266 ZoomOperation_Reset,267 ZoomOperation_Max268 };269 270 260 UIHelpBrowserTabManager(const QHelpEngine *pHelpEngine, const QUrl &homeUrl, 271 261 const QStringList &urlList, QWidget *pParent = 0); … … 281 271 void setToolBarVisible(bool fVisible); 282 272 void printCurrent(QPrinter &printer); 283 int initialFontPointSize() const; 284 void setFontPointSize(int iPointSize); 285 int fontPointSize() const; 286 void setFontScaleWidgetVisible(bool fToggled); 273 void setZoomWidgetVisible(bool fToggled); 287 274 void switchToTab(int iIndex); 288 275 … … 303 290 void sltHandleContextMenuTabClose(); 304 291 void sltHandleCurrentChanged(int iTabIndex); 305 void sltHandle FontSizeChange(int iFontPointSize);292 void sltHandleZoomOperation(UIHelpViewer::ZoomOperation enmZoomOperation); 306 293 void sltShowTabBarContextMenu(const QPoint &pos); 307 294 void sltHandleCloseOtherTabsContextMenuAction(); … … 318 305 /* Returns the tab index with @Url if there is one. Returns -1 otherwise. */ 319 306 int findTab(const QUrl &Url) const; 307 // void setFontPointSize(int iPointSize); 308 // int initialFontPointSize() const; 309 // int fontPointSize() const; 310 320 311 const QHelpEngine* m_pHelpEngine; 321 UI ContentZoomWidget *m_pFontScaleWidget;312 UIZoomWidget *m_pZoomWidget; 322 313 QUrl m_homeUrl; 323 314 QStringList m_savedUrlList; … … 330 321 331 322 /********************************************************************************************************************************* 332 * UI ContentZoomWidget implementation. *323 * UIZoomWidget implementation. * 333 324 *********************************************************************************************************************************/ 334 325 335 UI ContentZoomWidget::UIContentZoomWidget(int iInitialFontPointSize,QWidget *pParent /* = 0 */)326 UIZoomWidget::UIZoomWidget(QWidget *pParent /* = 0 */) 336 327 :QIWithRetranslateUI<QWidget>(pParent) 337 328 , m_pMainLayout(0) … … 340 331 , m_pPlusButton(0) 341 332 , m_pValueLabel(0) 342 , m_iInitialFontPointSize(iInitialFontPointSize)343 , m_iFontPointSize(iInitialFontPointSize)344 333 { 345 334 prepare(); 346 335 } 347 336 348 void UIContentZoomWidget::setFontPointSize(int iFontPointSize) 349 { 350 if (m_iFontPointSize == iFontPointSize) 351 return; 352 m_iFontPointSize = iFontPointSize; 353 if (m_pValueLabel && m_iInitialFontPointSize != 0) 354 m_pValueLabel->setText(QString("%1%2").arg(QString::number(fontPercentage())).arg("%")); 355 } 356 357 int UIContentZoomWidget::fontPointSize() const 358 { 359 return m_iFontPointSize; 360 } 361 362 void UIContentZoomWidget::retranslateUi() 363 { 364 } 365 366 void UIContentZoomWidget::prepare() 337 void UIZoomWidget::retranslateUi() 338 { 339 } 340 341 void UIZoomWidget::prepare() 367 342 { 368 343 setAutoFillBackground(true); … … 380 355 m_pValueLabel); 381 356 382 m_pValueLabel->setText(QString("%1%2").arg(QString::number(fontPercentage())).arg("%"));357 //m_pValueLabel->setText(QString("%1%2").arg(QString::number(fontPercentage())).arg("%")); 383 358 384 359 m_pMinusButton->setIcon(UIIconPool::iconSet(":/help_browser_minus_32px.png")); … … 386 361 m_pPlusButton->setIcon(UIIconPool::iconSet(":/help_browser_plus_32px.png")); 387 362 388 connect(m_pPlusButton, &QIToolButton::pressed, this, &UI ContentZoomWidget::sltSetFontPointSize);389 connect(m_pMinusButton, &QIToolButton::pressed, this, &UI ContentZoomWidget::sltSetFontPointSize);390 connect(m_pResetButton, &QIToolButton::pressed, this, &UI ContentZoomWidget::sltSetFontPointSize);363 connect(m_pPlusButton, &QIToolButton::pressed, this, &UIZoomWidget::sltZoomOperation); 364 connect(m_pMinusButton, &QIToolButton::pressed, this, &UIZoomWidget::sltZoomOperation); 365 connect(m_pResetButton, &QIToolButton::pressed, this, &UIZoomWidget::sltZoomOperation); 391 366 392 367 m_pMainLayout->addWidget(m_pResetButton); … … 396 371 } 397 372 398 int UIContentZoomWidget::fontPercentage() const 399 { 400 if (m_iInitialFontPointSize == 0) 401 return 0; 402 return 100 * m_iFontPointSize / m_iInitialFontPointSize; 403 } 404 405 void UIContentZoomWidget::sltSetFontPointSize() 373 void UIZoomWidget::setZoomPercentage(int iZoomPercentage) 374 { 375 if (m_pValueLabel) 376 m_pValueLabel->setText(QString("%1%2").arg(QString::number(iZoomPercentage)).arg("%")); 377 } 378 379 void UIZoomWidget::sltZoomOperation() 406 380 { 407 381 if (!sender()) 408 382 return; 409 int iNewSize = m_iFontPointSize;383 UIHelpViewer::ZoomOperation enmOperation = UIHelpViewer::ZoomOperation_In; 410 384 if (sender() == m_pMinusButton) 411 iNewSize -= iFontPointSizeChangeStep;385 enmOperation = UIHelpViewer::ZoomOperation_Out; 412 386 else if (sender() == m_pPlusButton) 413 iNewSize += iFontPointSizeChangeStep;387 enmOperation = UIHelpViewer::ZoomOperation_In; 414 388 else if (sender() == m_pResetButton) 415 iNewSize = m_iInitialFontPointSize; 416 if (iNewSize >= UIHelpBrowserWidget::fontScaleMinMax.second * m_iInitialFontPointSize || 417 iNewSize <= UIHelpBrowserWidget::fontScaleMinMax.first * m_iInitialFontPointSize) 418 iNewSize = m_iFontPointSize; 419 setFontPointSize(iNewSize); 420 emit sigFontPointSizeChanged(m_iFontPointSize); 389 enmOperation = UIHelpViewer::ZoomOperation_Reset; 390 emit sigZoomChanged(enmOperation); 421 391 } 422 392 … … 607 577 } 608 578 609 int UIHelpBrowserTab::initialFontPointSize() const 579 void UIHelpBrowserTab::zoom(UIHelpViewer::ZoomOperation enmZoomOperation) 610 580 { 611 581 if (m_pContentViewer) 612 return m_pContentViewer->initialFontPointSize(); 613 return 0; 614 } 615 616 void UIHelpBrowserTab::setFontPointSize(int iPointSize) 617 { 618 if (m_pContentViewer) 619 { 620 if (m_pContentViewer->font().pointSize() == iPointSize) 621 return; 622 QFont mFont = m_pContentViewer->font(); 623 mFont.setPointSize(iPointSize); 624 m_pContentViewer->setFont(mFont); 625 } 626 } 627 628 int UIHelpBrowserTab::fontPointSize() const 629 { 630 if (!m_pContentViewer) 631 return 0; 632 return m_pContentViewer->font().pointSize(); 633 } 582 m_pContentViewer->zoom(enmZoomOperation); 583 } 584 // void UIHelpBrowserTab::setZoomPercentage(int iZoomPercentage) 585 // { 586 // if (m_pContentViewer) 587 // m_pContentViewer->setZoomPercentage(iZoomPercentage); 588 // } 589 590 // int UIHelpBrowserTab::initialFontPointSize() const 591 // { 592 // if (m_pContentViewer) 593 // return m_pContentViewer->initialFontPointSize(); 594 // return 0; 595 // } 596 597 // void UIHelpBrowserTab::setFontPointSize(int iPointSize) 598 // { 599 // if (m_pContentViewer) 600 // { 601 // if (m_pContentViewer->font().pointSize() == iPointSize) 602 // return; 603 // QFont mFont = m_pContentViewer->font(); 604 // mFont.setPointSize(iPointSize); 605 // m_pContentViewer->setFont(mFont); 606 // } 607 // } 608 609 // int UIHelpBrowserTab::fontPointSize() const 610 // { 611 // if (!m_pContentViewer) 612 // return 0; 613 // return m_pContentViewer->font().pointSize(); 614 // } 634 615 635 616 void UIHelpBrowserTab::prepare(const QUrl &initialUrl) … … 661 642 connect(m_pContentViewer, &UIHelpViewer::sigCloseFindInPageWidget, 662 643 this, &UIHelpBrowserTab::sltCloseFindInPageWidget); 663 connect(m_pContentViewer, &UIHelpViewer::sigFontPointSizeChanged,664 this, &UIHelpBrowserTab::sigFontPointSizeChanged);665 644 connect(m_pContentViewer, &UIHelpViewer::sigGoBackward, 666 645 this, &UIHelpBrowserTab::sltHandleBackwardAction); … … 836 815 : QITabWidget(pParent) 837 816 , m_pHelpEngine(pHelpEngine) 838 , m_p FontScaleWidget(0)817 , m_pZoomWidget(0) 839 818 , m_homeUrl(homeUrl) 840 819 , m_savedUrlList(urlList) … … 868 847 connect(pTabWidget, &UIHelpBrowserTab::sigAddBookmark, 869 848 this, &UIHelpBrowserTabManager::sigAddBookmark); 870 connect(pTabWidget, &UIHelpBrowserTab::sigFontPointSizeChanged,871 this, &UIHelpBrowserTabManager::sltHandleFontSizeChange);849 // connect(pTabWidget, &UIHelpBrowserTab::sigZoomPercentageChanged, 850 // this, &UIHelpBrowserTabManager::sltHandleZoomOperation); 872 851 connect(pTabWidget, &UIHelpBrowserTab::sigLinkHighlighted, 873 852 this, &UIHelpBrowserTabManager::sigLinkHighlighted); … … 876 855 setCurrentIndex(index); 877 856 878 if (!m_p FontScaleWidget)879 { 880 m_p FontScaleWidget = new UIContentZoomWidget(initialFontPointSize(),this);881 connect(m_p FontScaleWidget, &UIContentZoomWidget::sigFontPointSizeChanged,882 this, &UIHelpBrowserTabManager::sltHandle FontSizeChange);857 if (!m_pZoomWidget) 858 { 859 m_pZoomWidget = new UIZoomWidget(this); 860 connect(m_pZoomWidget, &UIZoomWidget::sigZoomChanged, 861 this, &UIHelpBrowserTabManager::sltHandleZoomOperation); 883 862 } 884 863 } … … 1012 991 void UIHelpBrowserTabManager::paintEvent(QPaintEvent *pEvent) 1013 992 { 1014 if (m_p FontScaleWidget)1015 { 1016 int iMargin = 20;1017 m_p FontScaleWidget->move(width() - m_pFontScaleWidget->width() - iMargin,1018 height() - m_pFontScaleWidget->height() - iMargin);993 if (m_pZoomWidget) 994 { 995 int iMargin = 1.5 * qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent); 996 m_pZoomWidget->move(width() - m_pZoomWidget->width() - iMargin, 997 height() - m_pZoomWidget->height() - iMargin); 1019 998 } 1020 999 QITabWidget::paintEvent(pEvent); 1021 1000 } 1022 1001 1023 int UIHelpBrowserTabManager::initialFontPointSize() const1024 {1025 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget());1026 if (!pTab)1027 return 0;1028 return pTab->initialFontPointSize();1029 }1030 1031 void UIHelpBrowserTabManager::setFontPointSize(int iPointSize)1032 {1033 for (int i = 0; i < count(); ++i)1034 {1035 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(widget(i));1036 if (!pTab)1037 continue;1038 pTab->setFontPointSize(iPointSize);1039 }1040 if (m_pFontScaleWidget)1041 m_pFontScaleWidget->setFontPointSize(iPointSize);1042 }1043 1044 int UIHelpBrowserTabManager::fontPointSize() const1045 {1046 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget());1047 if (!pTab)1048 return 0;1049 return pTab->fontPointSize();1050 }1051 1052 void UIHelpBrowserTabManager::set FontScaleWidgetVisible(bool fToggled)1053 { 1054 if (m_p FontScaleWidget)1055 m_p FontScaleWidget->setVisible(fToggled);1002 // int UIHelpBrowserTabManager::initialFontPointSize() const 1003 // { 1004 // UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 1005 // if (!pTab) 1006 // return 0; 1007 // return pTab->initialFontPointSize(); 1008 // } 1009 1010 // void UIHelpBrowserTabManager::setFontPointSize(int iPointSize) 1011 // { 1012 // for (int i = 0; i < count(); ++i) 1013 // { 1014 // UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(widget(i)); 1015 // if (!pTab) 1016 // continue; 1017 // pTab->setFontPointSize(iPointSize); 1018 // } 1019 // // if (m_pZoomWidget) 1020 // // m_pZoomWidget->setFontPointSize(iPointSize); 1021 // } 1022 1023 // int UIHelpBrowserTabManager::fontPointSize() const 1024 // { 1025 // UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(currentWidget()); 1026 // if (!pTab) 1027 // return 0; 1028 // return pTab->fontPointSize(); 1029 // } 1030 1031 void UIHelpBrowserTabManager::setZoomWidgetVisible(bool fToggled) 1032 { 1033 if (m_pZoomWidget) 1034 m_pZoomWidget->setVisible(fToggled); 1056 1035 } 1057 1036 … … 1135 1114 } 1136 1115 1137 void UIHelpBrowserTabManager::sltHandleFontSizeChange(int iFontPointSize) 1138 { 1139 setFontPointSize(iFontPointSize); 1116 void UIHelpBrowserTabManager::sltHandleZoomOperation(UIHelpViewer::ZoomOperation enmZoomOperation) 1117 { 1118 for (int i = 0; i < count(); ++i) 1119 { 1120 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(widget(i)); 1121 if (pTab) 1122 pTab->zoom(enmZoomOperation); 1123 } 1140 1124 } 1141 1125 … … 1211 1195 , m_pShowHideSideBarAction(0) 1212 1196 , m_pShowHideToolBarAction(0) 1213 , m_pShowHide FontScaleWidgetAction(0)1197 , m_pShowHideZoomWidgetAction(0) 1214 1198 , m_pShowHideStatusBarAction(0) 1215 , m_p FontSizeLargerAction(0)1216 , m_p FontSizeSmallerAction(0)1199 , m_pZoomInAction(0) 1200 , m_pZoomOutAction(0) 1217 1201 , m_pFontSizeResetAction(0) 1218 1202 , m_fModelContentCreated(false) … … 1284 1268 this, &UIHelpBrowserWidget::sltHandleWidgetVisibilityToggle); 1285 1269 1286 m_pShowHide FontScaleWidgetAction = new QAction(this);1287 m_pShowHide FontScaleWidgetAction->setCheckable(true);1288 m_pShowHide FontScaleWidgetAction->setChecked(true);1289 connect(m_pShowHide FontScaleWidgetAction, &QAction::toggled,1270 m_pShowHideZoomWidgetAction = new QAction(this); 1271 m_pShowHideZoomWidgetAction->setCheckable(true); 1272 m_pShowHideZoomWidgetAction->setChecked(true); 1273 connect(m_pShowHideZoomWidgetAction, &QAction::toggled, 1290 1274 this, &UIHelpBrowserWidget::sltHandleWidgetVisibilityToggle); 1291 1275 … … 1306 1290 1307 1291 /* For size control actions: */ 1308 m_p FontSizeLargerAction = new QAction(this);1309 m_p FontSizeLargerAction->setIcon(UIIconPool::iconSet(":/help_browser_plus_32px.png"));1310 1311 m_p FontSizeSmallerAction = new QAction(this);1312 m_p FontSizeSmallerAction->setIcon(UIIconPool::iconSet(":/help_browser_minus_32px.png"));1292 m_pZoomInAction = new QAction(this); 1293 m_pZoomInAction->setIcon(UIIconPool::iconSet(":/help_browser_plus_32px.png")); 1294 1295 m_pZoomOutAction = new QAction(this); 1296 m_pZoomOutAction->setIcon(UIIconPool::iconSet(":/help_browser_minus_32px.png")); 1313 1297 1314 1298 m_pFontSizeResetAction = new QAction(this); 1315 1299 m_pFontSizeResetAction->setIcon(UIIconPool::iconSet(":/help_browser_reset_32px.png")); 1316 1300 1317 connect(m_p FontSizeLargerAction, &QAction::triggered,1301 connect(m_pZoomInAction, &QAction::triggered, 1318 1302 this, &UIHelpBrowserWidget::sltHandleZoomActions); 1319 connect(m_p FontSizeSmallerAction, &QAction::triggered,1303 connect(m_pZoomOutAction, &QAction::triggered, 1320 1304 this, &UIHelpBrowserWidget::sltHandleZoomActions); 1321 1305 connect(m_pFontSizeResetAction, &QAction::triggered, … … 1463 1447 m_pFileMenu->addAction(m_pCloseDialogAction); 1464 1448 1465 if (m_p FontSizeLargerAction)1466 m_pViewMenu->addAction(m_p FontSizeLargerAction);1467 if (m_p FontSizeSmallerAction)1468 m_pViewMenu->addAction(m_p FontSizeSmallerAction);1449 if (m_pZoomInAction) 1450 m_pViewMenu->addAction(m_pZoomInAction); 1451 if (m_pZoomOutAction) 1452 m_pViewMenu->addAction(m_pZoomOutAction); 1469 1453 if (m_pFontSizeResetAction) 1470 1454 m_pViewMenu->addAction(m_pFontSizeResetAction); … … 1474 1458 if (m_pShowHideToolBarAction) 1475 1459 m_pViewMenu->addAction(m_pShowHideToolBarAction); 1476 if (m_pShowHide FontScaleWidgetAction)1477 m_pViewMenu->addAction(m_pShowHide FontScaleWidgetAction);1460 if (m_pShowHideZoomWidgetAction) 1461 m_pViewMenu->addAction(m_pShowHideZoomWidgetAction); 1478 1462 if (m_pShowHideStatusBarAction) 1479 1463 m_pViewMenu->addAction(m_pShowHideStatusBarAction); … … 1593 1577 if (m_pShowHideToolBarAction) 1594 1578 m_pShowHideToolBarAction->setText(tr("Show Tool Bar")); 1595 if (m_pShowHide FontScaleWidgetAction)1596 m_pShowHide FontScaleWidgetAction->setText(tr("Show Font Scale Widget"));1579 if (m_pShowHideZoomWidgetAction) 1580 m_pShowHideZoomWidgetAction->setText(tr("Show Font Scale Widget")); 1597 1581 if (m_pShowHideStatusBarAction) 1598 1582 m_pShowHideStatusBarAction->setText(tr("Show Status Bar")); … … 1604 1588 m_pCloseDialogAction->setText(tr("Close")); 1605 1589 1606 if (m_p FontSizeLargerAction)1607 m_p FontSizeLargerAction->setText(tr("Zoom &In"));1608 if (m_p FontSizeSmallerAction)1609 m_p FontSizeSmallerAction->setText(tr("Zoom &Out"));1590 if (m_pZoomInAction) 1591 m_pZoomInAction->setText(tr("Zoom &In")); 1592 if (m_pZoomOutAction) 1593 m_pZoomOutAction->setText(tr("Zoom &Out")); 1610 1594 if (m_pFontSizeResetAction) 1611 1595 m_pFontSizeResetAction->setText(tr("&Reset Zoom")); … … 1649 1633 m_pTabManager->setToolBarVisible(fToggled); 1650 1634 } 1651 else if (sender() == m_pShowHide FontScaleWidgetAction)1635 else if (sender() == m_pShowHideZoomWidgetAction) 1652 1636 { 1653 1637 if (m_pTabManager) 1654 m_pTabManager->set FontScaleWidgetVisible(fToggled);1638 m_pTabManager->setZoomWidgetVisible(fToggled); 1655 1639 } 1656 1640 else if (sender() == m_pShowHideStatusBarAction) … … 1880 1864 void UIHelpBrowserWidget::sltHandleZoomActions() 1881 1865 { 1882 if (!sender() || !m_pTabManager)1883 return;1884 int iFontPointSize = m_pTabManager->fontPointSize();1885 if (sender() == m_pFontSizeResetAction)1886 iFontPointSize = m_pTabManager->initialFontPointSize();1887 else if (sender() == m_pFontSizeLargerAction)1888 iFontPointSize += iFontPointSizeChangeStep;1889 else if (sender() == m_pFontSizeSmallerAction)1890 iFontPointSize -= iFontPointSizeChangeStep;1891 1892 if (iFontPointSize >= fontScaleMinMax.second * m_pTabManager->initialFontPointSize() ||1893 iFontPointSize <= fontScaleMinMax.first * m_pTabManager->initialFontPointSize())1894 return;1895 m_pTabManager->setFontPointSize(iFontPointSize);1866 // if (!sender() || !m_pTabManager) 1867 // return; 1868 // int iFontPointSize = m_pTabManager->fontPointSize(); 1869 // if (sender() == m_pFontSizeResetAction) 1870 // iFontPointSize = m_pTabManager->initialFontPointSize(); 1871 // else if (sender() == m_pZoomInAction) 1872 // iFontPointSize += iZoomPercentageStep; 1873 // else if (sender() == m_pZoomOutAction) 1874 // iFontPointSize -= iZoomPercentageStep; 1875 1876 // if (iFontPointSize >= zoomPercentageMinMax.second * m_pTabManager->initialFontPointSize() || 1877 // iFontPointSize <= zoomPercentageMinMax.first * m_pTabManager->initialFontPointSize()) 1878 // return; 1879 // m_pTabManager->setFontPointSize(iFontPointSize); 1896 1880 } 1897 1881 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.h
r88401 r88408 67 67 QIToolBar *toolbar() const { return m_pToolBar; } 68 68 #endif 69 70 static const QPair<float, float> fontScaleMinMax;71 69 72 70 protected: … … 167 165 QAction *m_pShowHideSideBarAction; 168 166 QAction *m_pShowHideToolBarAction; 169 QAction *m_pShowHide FontScaleWidgetAction;167 QAction *m_pShowHideZoomWidgetAction; 170 168 QAction *m_pShowHideStatusBarAction; 171 QAction *m_p FontSizeLargerAction;172 QAction *m_p FontSizeSmallerAction;169 QAction *m_pZoomInAction; 170 QAction *m_pZoomOutAction; 173 171 QAction *m_pFontSizeResetAction; 174 172 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r88401 r88408 49 49 50 50 #ifdef VBOX_WITH_QHELP_VIEWER 51 52 //static int iZoomPercentageStep = 20; 53 const QPair<int, int> UIHelpViewer::zoomPercentageMinMax = QPair<int, int>(20, 300); 51 54 52 55 … … 436 439 } 437 440 441 void UIHelpViewer::zoom(ZoomOperation enmZoomOperation) 442 { 443 Q_UNUSED(enmZoomOperation); 444 } 445 446 438 447 void UIHelpViewer::contextMenuEvent(QContextMenuEvent *event) 439 448 { -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r88393 r88408 50 50 public: 51 51 52 enum ZoomOperation 53 { 54 ZoomOperation_In = 0, 55 ZoomOperation_Out, 56 ZoomOperation_Reset, 57 ZoomOperation_Max 58 }; 59 52 60 UIHelpViewer(const QHelpEngine *pHelpEngine, QWidget *pParent = 0); 53 61 virtual QVariant loadResource(int type, const QUrl &name) /* override */; … … 57 65 void setFont(const QFont &); 58 66 bool isFindInPageWidgetVisible() const; 67 void zoom(ZoomOperation enmZoomOperation); 68 69 static const QPair<int, int> zoomPercentageMinMax; 59 70 60 71 public slots:
Note:
See TracChangeset
for help on using the changeset viewer.