Bug 51402 - khelpcenter lost font size toolbuttons
Summary: khelpcenter lost font size toolbuttons
Status: RESOLVED FIXED
Alias: None
Product: khelpcenter
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Cornelius Schumacher
URL:
Keywords:
: 62318 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-12-01 20:16 UTC by Martin Koller
Modified: 2003-08-07 13:59 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Koller 2002-12-01 20:16:22 UTC
Version:           3.1 (using KDE 3.0.9)
Compiler:          gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98)
OS:          Linux (i686) release 2.4.17

CVS from 15.11.2002.
If I start khelpcenter, I only have 4 Icon-buttons in the toolbar (Home, back, forward, print), but in a previous version I also had "find", and more important "increase font size" and "decrease font size".
How can I get those buttons back?
Comment 1 Cornelius Schumacher 2003-03-06 15:46:13 UTC
By submitting a patch ;-) It indeed would be nice to have them back. 
 
Comment 2 Frerich Raabe 2003-04-30 17:32:31 UTC
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? 
Comment 3 Frerich Raabe 2003-05-01 07:52:42 UTC
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;
 };
 


Comment 4 Lauri Watts 2003-08-07 13:59:40 UTC
*** Bug 62318 has been marked as a duplicate of this bug. ***