Skip to content
Snippets Groups Projects
Commit 0dca52e7 authored by Jure Repinc's avatar Jure Repinc Committed by Marco Martin
Browse files

Fixed KHelpCenter Font Scaling (bug 243082)

When user clicked a button to change font size the entire document was
zoomed, instead of just the font size. This meant that the text would
run past the right edge and user had to scroll horizontaly to read the
whole line. After this patch only the font size changes.

Thanks to Jonathan Ryshpan for bringing this bug to my attention.
BUG: 243082
FIXED-IN: 4.7.2
CCMAIL: jonrysh@pacbell.net
REVIEW: 102528
parent d8706000
No related branches found
No related tags found
No related merge requests found
......@@ -158,8 +158,8 @@ MainWindow::MainWindow()
KConfig konqCfg( "konquerorrc" );
const_cast<KHTMLSettings *>( mDoc->settings() )->init( &konqCfg );
}
const int zoomFactor = configGroup.readEntry( "Font zoom factor", 100 );
mDoc->setZoomFactor( zoomFactor );
const int fontScaleFactor = configGroup.readEntry( "Font zoom factor", 100 );
mDoc->setFontScaleFactor( fontScaleFactor );
}
setupActions();
......@@ -471,22 +471,22 @@ void MainWindow::showSearchStderr()
void MainWindow::slotIncFontSizes()
{
mDoc->slotIncFontSizes();
updateZoomActions();
updateFontScaleActions();
}
void MainWindow::slotDecFontSizes()
{
mDoc->slotDecFontSizes();
updateZoomActions();
updateFontScaleActions();
}
void MainWindow::updateZoomActions()
void MainWindow::updateFontScaleActions()
{
actionCollection()->action( QLatin1String("incFontSizes") )->setEnabled( mDoc->zoomFactor() + mDoc->zoomStepping() <= 300 );
actionCollection()->action( QLatin1String("decFontSizes") )->setEnabled( mDoc->zoomFactor() - mDoc->zoomStepping() >= 20 );
actionCollection()->action( QLatin1String("incFontSizes") )->setEnabled( mDoc->fontScaleFactor() + mDoc->fontScaleStepping() <= 300 );
actionCollection()->action( QLatin1String("decFontSizes") )->setEnabled( mDoc->fontScaleFactor() - mDoc->fontScaleStepping() >= 20 );
KConfigGroup configGroup( KGlobal::config(), QLatin1String("General") );
configGroup.writeEntry( QLatin1String("Font zoom factor"), mDoc->zoomFactor() );
configGroup.writeEntry( QLatin1String("Font zoom factor"), mDoc->fontScaleFactor() );
configGroup.sync();
}
......
......@@ -90,7 +90,7 @@ class MainWindow : public KXmlGuiWindow
void slotCopySelectedText();
private:
void updateZoomActions();
void updateFontScaleActions();
QSplitter *mSplitter;
View *mDoc;
......
......@@ -41,7 +41,7 @@ View::View( QWidget *parentWidget, QObject *parent, KHTMLPart::GUIProfile prof,
kDebug() << "Unable to read Formatter templates.";
}
m_zoomStepping = 10;
m_fontScaleStepping = 10;
connect( this, SIGNAL( setWindowCaption( const QString & ) ),
this, SLOT( setTitle( const QString & ) ) );
......@@ -177,12 +177,12 @@ void View::lastSearch()
void View::slotIncFontSizes()
{
setZoomFactor( zoomFactor() + m_zoomStepping );
setFontScaleFactor( fontScaleFactor() + m_fontScaleStepping );
}
void View::slotDecFontSizes()
{
setZoomFactor( zoomFactor() - m_zoomStepping );
setFontScaleFactor( fontScaleFactor() - m_fontScaleStepping );
}
void View::showMenu( const QString& url, const QPoint& pos)
......
......@@ -48,7 +48,7 @@ class View : public KHTMLPart
void beginInternal( const KUrl & );
KUrl internalUrl() const;
int zoomStepping() const { return m_zoomStepping; }
int fontScaleStepping() const { return m_fontScaleStepping; }
Formatter *formatter() const { return mFormatter; }
......@@ -82,7 +82,7 @@ class View : public KHTMLPart
QString mSearchResult;
KUrl mInternalUrl;
int m_zoomStepping;
int m_fontScaleStepping;
Formatter *mFormatter;
KActionCollection *mActionCollection;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment