summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-03-01 12:10:53 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-03-01 12:10:53 +0100
commitea94738bf6c59ce254a6f177e978814019c856a4 (patch)
treeb79c4c22114ee1bbc3133bfa56ec8ef7146ddccf
parentRemoved unuseful headers (diff)
downloadrekonq-ea94738bf6c59ce254a6f177e978814019c856a4.tar.xz
Fixing Font Troubles. Try 1..
-rw-r--r--src/mainwindow.cpp24
-rw-r--r--src/mainwindow.h5
-rw-r--r--src/settings.cpp3
-rw-r--r--src/webview.cpp2
4 files changed, 25 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 07b0fb9c..5a591883 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -51,6 +51,8 @@
#include <KMessageBox>
#include <KFileDialog>
#include <KMenu>
+#include <KGlobalSettings>
+
// Qt Includes
#include <QPlainTextEdit>
@@ -302,12 +304,28 @@ void MainWindow::slotUpdateConf()
m_homePage = ReKonfig::homePage();
// =========== Fonts ==============
- QFont standardFont = ReKonfig::standardFont();
- QFont fixedFont = ReKonfig::fixedFont();
-
QWebSettings *defaultSettings = QWebSettings::globalSettings();
+
+ QFont standardFont = ReKonfig::standardFont();
+ if( !standardFont.exactMatch() )
+ {
+ kWarning() << "Webkit Standard Font doesn't match! Setting to KDE general font..";
+ standardFont = KGlobalSettings::generalFont();
+ ReKonfig::setStandardFont( standardFont );
+ ReKonfig::self()->writeConfig();
+ }
defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family());
defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize());
+
+
+ QFont fixedFont = ReKonfig::fixedFont();
+ if( !fixedFont.exactMatch() )
+ {
+ kWarning() << "Webkit Fixed Font doesn't match! Setting to KDE fixed font..";
+ fixedFont = KGlobalSettings::fixedFont();
+ ReKonfig::setFixedFont( fixedFont );
+ ReKonfig::self()->writeConfig();
+ }
defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family());
defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize());
diff --git a/src/mainwindow.h b/src/mainwindow.h
index a1f4464b..4864f347 100644
--- a/src/mainwindow.h
+++ b/src/mainwindow.h
@@ -46,7 +46,6 @@ class WebView;
* It handles the menus, toolbars, and status bars.
*
*/
-
class MainWindow : public KXmlGuiWindow
{
Q_OBJECT
@@ -82,10 +81,6 @@ private slots:
void slotOpenPrevious();
void slotOpenNext();
-/* void slotShowWindow();
- void slotSwapFocus();*/
-
-
// File Menu slots
void slotFileNew();
void slotFileOpen();
diff --git a/src/settings.cpp b/src/settings.cpp
index f5476ad3..7be3e1fa 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -156,6 +156,9 @@ void SettingsDialog::saveSettings()
// Fonts
ReKonfig::setStandardFont( d->fontsUi.standardFontChooser->font() );
ReKonfig::setFixedFont( d->fontsUi.standardFontChooser->font() );
+
+ // Save
+ ReKonfig::self()->writeConfig();
}
diff --git a/src/webview.cpp b/src/webview.cpp
index b90f85cc..e6748263 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -40,9 +40,9 @@
#include <QClipboard>
#include <QMenu>
#include <QMouseEvent>
-#include <QWebHitTestResult>
#include <QBuffer>
// ---
+#include <QtWebKit>
#include <QUiLoader>
WebPage::WebPage(QObject *parent)