Summary: | khelpcenter lost font size toolbuttons | ||
---|---|---|---|
Product: | [Applications] khelpcenter | Reporter: | Martin Koller <kollix> |
Component: | general | Assignee: | Cornelius Schumacher <schumacher> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | maurizio.colucci |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
Martin Koller
2002-12-01 20:16:22 UTC
By submitting a patch ;-) It indeed would be nice to have them back. I noticed that the actions are still in the khelpcenterui.rc file, and looking at the KHTML sources, it seems that KHTMLZoomFactorAction, which causes the font size buttons you want, is not part of the public API. I *think* they were lost when KHelpCenter was de-KPart-ized, since that also made it impossible for khtml to embed it's internal actions (like the zoom actions) into KHelpCenter. Either we add the KPart support back, or we copy those zoom factor actions into KHelpCenter. Cornelius, what do you think? Subject: kdebase/khelpcenter CVS commit by raabe: - The font zoom buttons are back CCMAIL:51402-done@bugs.kde.org M +20 -0 mainwindow.cpp 1.32 M +4 -0 mainwindow.h 1.15 M +12 -0 view.cpp 1.12 M +5 -0 view.h 1.10 --- kdebase/khelpcenter/mainwindow.cpp #1.31:1.32 @@ -184,4 +184,7 @@ void MainWindow::setupActions() */ History::self().setupActions( actionCollection() ); + + new KAction( i18n( "Increase Font Sizes" ), "viewmag+", KShortcut(), this, SLOT( slotIncFontSizes() ), actionCollection(), "incFontSizes" ); + new KAction( i18n( "Decrease Font Sizes" ), "viewmag-", KShortcut(), this, SLOT( slotDecFontSizes() ), actionCollection(), "decFontSizes" ); } @@ -336,4 +339,21 @@ void MainWindow::showSearchStderr() } +void MainWindow::slotIncFontSizes() +{ + mDoc->slotIncFontSizes(); + updateZoomActions(); +} + +void MainWindow::slotDecFontSizes() +{ + mDoc->slotDecFontSizes(); + updateZoomActions(); +} + +void MainWindow::updateZoomActions() +{ + actionCollection()->action( "incFontSizes" )->setEnabled( mDoc->zoomFactor() + mDoc->zoomStepping() <= 300 ); + actionCollection()->action( "decFontSizes" )->setEnabled( mDoc->zoomFactor() - mDoc->zoomStepping() >= 20 ); +} // vim:ts=2:sw=2:et --- kdebase/khelpcenter/mainwindow.h #1.14:1.15 @@ -61,6 +61,10 @@ class MainWindow : public KMainWindow, p void documentCompleted(); void openOwnManual(); + void slotIncFontSizes(); + void slotDecFontSizes(); private: + void updateZoomActions(); + View *mDoc; Navigator *mNavigator; --- kdebase/khelpcenter/view.cpp #1.11:1.12 @@ -15,4 +15,6 @@ View::View( QWidget *parentWidget, const : KHTMLPart( parentWidget, widgetName, parent, name, prof ), mState( Docu ) { + m_zoomStepping = 10; + connect( this, SIGNAL( setWindowCaption( const QString & ) ), this, SLOT( setTitle( const QString & ) ) ); @@ -178,4 +180,14 @@ void View::lastSearch() write( mSearchResult ); end(); +} + +void View::slotIncFontSizes() +{ + setZoomFactor( zoomFactor() + m_zoomStepping ); +} + +void View::slotDecFontSizes() +{ + setZoomFactor( zoomFactor() - m_zoomStepping ); } --- kdebase/khelpcenter/view.h #1.9:1.10 @@ -32,6 +32,10 @@ class View : public KHTMLPart void endSearchResult(); + int zoomStepping() const { return m_zoomStepping; } + public slots: void lastSearch(); + void slotIncFontSizes(); + void slotDecFontSizes(); signals: @@ -48,4 +52,5 @@ class View : public KHTMLPart QString mSearchResult; + int m_zoomStepping; }; |