- Timestamp:
- Apr 8, 2021 11:25:05 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.cpp
r88205 r88411 242 242 const char *UIExtraDataDefs::GUI_HelpBrowserDialogGeometry = "GUI/HelpBrowserDialogGeomety"; 243 243 const char *UIExtraDataDefs::GUI_HelpBrowserBookmarks = "GUI/HelpBrowserBookmarks"; 244 const char *UIExtraDataDefs::GUI_HelpBrowserZoomPercentage = "GUI/HelpBrowserZoomPercentage"; 244 245 245 246 /* VM Activity Overview: */ -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataDefs.h
r88205 r88411 441 441 SHARED_LIBRARY_STUFF extern const char *GUI_HelpBrowserDialogGeometry; 442 442 SHARED_LIBRARY_STUFF extern const char *GUI_HelpBrowserBookmarks; 443 SHARED_LIBRARY_STUFF extern const char *GUI_HelpBrowserZoomPercentage; 443 444 /** @} */ 444 445 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.cpp
r88205 r88411 1984 1984 << GUI_HelpBrowserLastURLList 1985 1985 << GUI_HelpBrowserDialogGeometry 1986 << GUI_HelpBrowserBookmarks; 1986 << GUI_HelpBrowserBookmarks 1987 << GUI_HelpBrowserZoomPercentage; 1987 1988 } 1988 1989 … … 4603 4604 { 4604 4605 return extraDataStringList(GUI_HelpBrowserLastURLList); 4606 } 4607 4608 void UIExtraDataManager::setHelpBrowserZoomPercentage(int iZoomPercentage) 4609 { 4610 setExtraDataString(GUI_HelpBrowserZoomPercentage, QString::number(iZoomPercentage)); 4611 } 4612 4613 int UIExtraDataManager::helpBrowserZoomPercentage() 4614 { 4615 return extraDataString(GUI_HelpBrowserZoomPercentage).toInt(); 4605 4616 } 4606 4617 -
trunk/src/VBox/Frontends/VirtualBox/src/extradata/UIExtraDataManager.h
r88205 r88411 789 789 void setHelpBrowserLastUrlList(const QStringList &urlList); 790 790 QStringList helpBrowserLastUrlList(); 791 void setHelpBrowserZoomPercentage(int iZoomPercentage); 792 int helpBrowserZoomPercentage(); 791 793 QRect helpBrowserDialogGeometry(QWidget *pWidget, QWidget *pParentWidget, const QRect &defaultGeometry); 792 794 void setHelpBrowserDialogGeometry(const QRect &geometry, bool fMaximized); -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpBrowserWidget.cpp
r88410 r88411 201 201 void print(QPrinter &printer); 202 202 void zoom(UIHelpViewer::ZoomOperation enmZoomOperation); 203 int zoomPercentage() const; 204 void setZoomPercentage(int iZoomPercentage); 203 205 204 206 private slots: … … 270 272 void setZoomWidgetVisible(bool fToggled); 271 273 void switchToTab(int iIndex); 274 /** returns the zoom percentage of 0th tab. */ 275 int zoomPercentage() const; 276 /** Sets the zoom percentage of all tabs. */ 277 void setZoomPercentage(int iZoomPercentage); 272 278 273 279 public slots: … … 574 580 if (m_pContentViewer) 575 581 m_pContentViewer->zoom(enmZoomOperation); 582 } 583 584 void UIHelpBrowserTab::setZoomPercentage(int iZoomPercentage) 585 { 586 if (m_pContentViewer) 587 m_pContentViewer->setZoomPercentage(iZoomPercentage); 588 } 589 590 int UIHelpBrowserTab::zoomPercentage() const 591 { 592 if (m_pContentViewer) 593 return m_pContentViewer->zoomPercentage(); 594 return 100; 576 595 } 577 596 … … 977 996 setCurrentIndex(iIndex); 978 997 } 998 999 int UIHelpBrowserTabManager::zoomPercentage() const 1000 { 1001 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(widget(0)); 1002 if (pTab) 1003 return pTab->zoomPercentage(); 1004 return 100; 1005 } 1006 1007 void UIHelpBrowserTabManager::setZoomPercentage(int iZoomPercentage) 1008 { 1009 for (int i = 0; i < count(); ++i) 1010 { 1011 UIHelpBrowserTab *pTab = qobject_cast<UIHelpBrowserTab*>(widget(i)); 1012 if (pTab) 1013 pTab->setZoomPercentage(iZoomPercentage); 1014 } 1015 } 1016 979 1017 980 1018 void UIHelpBrowserTabManager::sltHandletabTitleChange(const QString &strTitle) … … 1408 1446 void UIHelpBrowserWidget::loadOptions() 1409 1447 { 1448 if (m_pTabManager) 1449 m_pTabManager->setZoomPercentage(gEDataManager->helpBrowserZoomPercentage()); 1410 1450 } 1411 1451 … … 1443 1483 { 1444 1484 if (m_pTabManager) 1485 { 1445 1486 gEDataManager->setHelpBrowserLastUrlList(m_pTabManager->tabUrlList()); 1487 gEDataManager->setHelpBrowserZoomPercentage(m_pTabManager->zoomPercentage()); 1488 } 1446 1489 } 1447 1490 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.cpp
r88410 r88411 441 441 { 442 442 case ZoomOperation_In: 443 m_iZoomPercentage+= iZoomPercentageStep;443 iPrevZoom += iZoomPercentageStep; 444 444 break; 445 445 case ZoomOperation_Out: 446 m_iZoomPercentage-= iZoomPercentageStep;446 iPrevZoom -= iZoomPercentageStep; 447 447 break; 448 448 case ZoomOperation_Reset: 449 449 default: 450 m_iZoomPercentage= 100;450 iPrevZoom = 100; 451 451 break; 452 452 } 453 454 if (m_iZoomPercentage > zoomPercentageMinMax.second || 455 m_iZoomPercentage < zoomPercentageMinMax.first) 456 m_iZoomPercentage = iPrevZoom; 453 setZoomPercentage(iPrevZoom); 454 } 455 456 void UIHelpViewer::setZoomPercentage(int iZoomPercentage) 457 { 458 if (iZoomPercentage > zoomPercentageMinMax.second || 459 iZoomPercentage < zoomPercentageMinMax.first || 460 m_iZoomPercentage == iZoomPercentage) 461 return; 462 463 m_iZoomPercentage = iZoomPercentage; 457 464 scaleFont(); 458 459 465 emit sigZoomPercentageChanged(m_iZoomPercentage); 466 } 467 468 469 int UIHelpViewer::zoomPercentage() const 470 { 471 return m_iZoomPercentage; 460 472 } 461 473 -
trunk/src/VBox/Frontends/VirtualBox/src/helpbrowser/UIHelpViewer.h
r88410 r88411 67 67 bool isFindInPageWidgetVisible() const; 68 68 void zoom(ZoomOperation enmZoomOperation); 69 int zoomPercentage() const; 70 void setZoomPercentage(int iZoomPercentage); 69 71 70 72 static const QPair<int, int> zoomPercentageMinMax;
Note:
See TracChangeset
for help on using the changeset viewer.