summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-11-20 01:24:24 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-11-20 01:24:24 +0100
commit1ceb5dcba054641648c5c33da78ed45754d36339 (patch)
tree9039201598b25f2f576b419b0cb00f3f55b9148c /src/mainwindow.cpp
parentEelko patch about private browsing in the title (diff)
downloadrekonq-1ceb5dcba054641648c5c33da78ed45754d36339.tar.xz
Minimum font size
Cedric's patch. Thanks :)
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 420015d8..137f0f2c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -468,14 +468,15 @@ void MainWindow::setupSidePanel()
// setup side panel actions
KAction* a = (KAction *) m_sidePanel->toggleViewAction();
- a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H)); // WARNING : is this the right shortcut ??
+ a->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_H));
a->setIcon(KIcon("view-history"));
actionCollection()->addAction(QLatin1String("show_history_panel"), a);
}
+
void MainWindow::setupBookmarksPanel()
{
- m_bookmarksPanel = new BookmarksPanel(i18n("Bookmarks Panel"), this);
+ m_bookmarksPanel = new BookmarksPanel(i18n("Bookmarks Panel"), this);
connect(m_bookmarksPanel, SIGNAL(openUrl(const KUrl&)), Application::instance(), SLOT(loadUrl(const KUrl&)));
connect(m_bookmarksPanel, SIGNAL(destroyed()), Application::instance(), SLOT(saveConfiguration()));
@@ -483,7 +484,7 @@ void MainWindow::setupBookmarksPanel()
// setup side panel actions
KAction* a = (KAction *) m_bookmarksPanel->toggleViewAction();
- a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B)); // FIXME: this shortcut should be configurable !
+ a->setShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B));
a->setIcon(KIcon("bookmarks-organize"));
actionCollection()->addAction(QLatin1String("show_bookmarks_panel"), a);
}
@@ -498,10 +499,17 @@ void MainWindow::updateConfiguration()
QWebSettings *defaultSettings = QWebSettings::globalSettings();
int fnSize = ReKonfig::fontSize();
+ int minFnSize = ReKonfig::minFontSize();
+
+ // font size / dpi WARNING: is this right? why we need this?
+ float toPix = m_view->logicalDpiY()/72.0;
+ if (toPix < 96.0/72.0)
+ toPix = 96.0/72.0;
QFont standardFont = ReKonfig::standardFont();
defaultSettings->setFontFamily(QWebSettings::StandardFont, standardFont.family());
- defaultSettings->setFontSize(QWebSettings::DefaultFontSize, fnSize);
+ defaultSettings->setFontSize(QWebSettings::DefaultFontSize, fnSize*toPix);
+ defaultSettings->setFontSize(QWebSettings::MinimumFontSize, minFnSize*toPix);
QFont fixedFont = ReKonfig::fixedFont();
defaultSettings->setFontFamily(QWebSettings::FixedFont, fixedFont.family());