summaryrefslogtreecommitdiff
path: root/src/application.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-24 10:47:44 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-24 10:47:44 +0200
commitc03cf973fd44223335615b6dd576785746e2b409 (patch)
treebb38f45ad79a78654b77f51b1d37fe333a06441f /src/application.cpp
parentNew Settings classes, one for each widget. (diff)
downloadrekonq-c03cf973fd44223335615b6dd576785746e2b409.tar.xz
Improving fonts situation
Diffstat (limited to 'src/application.cpp')
-rw-r--r--src/application.cpp51
1 files changed, 31 insertions, 20 deletions
diff --git a/src/application.cpp b/src/application.cpp
index 412999d8..556c3cf8 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -415,34 +415,45 @@ void Application::newWindow()
void Application::updateConfiguration()
{
- // FIXME:
- // all things related to mainview can be
- // improved/moved/replicated in all the mainwindows
- MainView *view = mainWindow()->mainView();
-
- // ============== General ==================
- view->updateTabBar();
-
// ============== Tabs ==================
- if (ReKonfig::closeTabSelectPrevious())
- view->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
- else
- view->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectRightTab);
+ bool b = ReKonfig::closeTabSelectPrevious();
+ Q_FOREACH(const QWeakPointer<MainWindow> &w, m_mainWindows)
+ {
+ MainView *mv = w.data()->mainView();
+ mv->updateTabBar();
+
+ if (b)
+ mv->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectPreviousTab);
+ else
+ mv->tabBar()->setSelectionBehaviorOnRemove(QTabBar::SelectRightTab);
+ }
+ QWebSettings *defaultSettings = QWebSettings::globalSettings();
+
// =========== Fonts ==============
- QWebSettings *defaultSettings = QWebSettings::globalSettings();
-
- int fnSize = ReKonfig::fontSize();
- int minFnSize = ReKonfig::minFontSize();
-
QFont standardFont = ReKonfig::standardFont();
+ kDebug() << "STANDARD FONT" << standardFont.pixelSize();
defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family());
- defaultSettings->setFontSize(QWebSettings::DefaultFontSize, fnSize);
- defaultSettings->setFontSize(QWebSettings::MinimumFontSize, minFnSize);
+ defaultSettings->setFontSize(QWebSettings::DefaultFontSize, standardFont.pointSize());
QFont fixedFont = ReKonfig::fixedFont();
defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family());
- defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fnSize);
+ defaultSettings->setFontSize(QWebSettings::DefaultFixedFontSize, fixedFont.pointSize());
+
+ QFont serifFont = ReKonfig::serifFont();
+ defaultSettings->setFontFamily(QWebSettings::SerifFont, serifFont.family());
+
+ QFont sansSerifFont = ReKonfig::sansSerifFont();
+ defaultSettings->setFontFamily(QWebSettings::SansSerifFont, sansSerifFont.family());
+
+ QFont cursiveFont = ReKonfig::cursiveFont();
+ defaultSettings->setFontFamily(QWebSettings::FixedFont, cursiveFont.family());
+
+ QFont fantasyFont = ReKonfig::fantasyFont();
+ defaultSettings->setFontFamily(QWebSettings::FantasyFont, fantasyFont.family());
+
+ int minimumFontSize = ReKonfig::minFontSize();
+ defaultSettings->setFontSize(QWebSettings::MinimumFontSize, minimumFontSize);
// ================ WebKit ============================
defaultSettings->setAttribute(QWebSettings::AutoLoadImages, ReKonfig::autoLoadImages());