summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-11-23 03:10:56 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-11-23 03:10:56 +0100
commited1a5bac8bb6e03063df1f5c499a6fdcfc14d9a5 (patch)
tree3405a9183b891ccb93b46c8f8888924e63d82499 /src
parentRemoved dpi option. (diff)
downloadrekonq-ed1a5bac8bb6e03063df1f5c499a6fdcfc14d9a5.tar.xz
Saving 4 bytes per tab :)
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp11
-rw-r--r--src/tabbar.cpp20
-rw-r--r--src/tabbar.h5
3 files changed, 16 insertions, 20 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a6857153..f2809beb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -212,6 +212,9 @@ void MainWindow::setupToolbars()
void MainWindow::postLaunch()
{
+ // KActionCollection read settings
+ m_ac->readSettings();
+
// notification system
connect(m_view, SIGNAL(showStatusBarMessage(const QString&, Rekonq::Notify)), this, SLOT(notifyMessage(const QString&, Rekonq::Notify)));
connect(m_view, SIGNAL(linkHovered(const QString&)), this, SLOT(notifyMessage(const QString&)));
@@ -239,9 +242,6 @@ void MainWindow::postLaunch()
// accept d'n'd
setAcceptDrops(true);
-
- // KActionCollection read settings
- m_ac->readSettings();
}
@@ -502,11 +502,6 @@ void MainWindow::updateConfiguration()
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);
diff --git a/src/tabbar.cpp b/src/tabbar.cpp
index 3eba53d7..6fdf4346 100644
--- a/src/tabbar.cpp
+++ b/src/tabbar.cpp
@@ -38,6 +38,7 @@
#include "urlbar.h"
#include "webview.h"
#include "websnap.h"
+#include "mainview.h"
// KDE Includes
#include <KShortcut>
@@ -59,9 +60,8 @@
#define MIN_WIDTH_DIVISOR 8
-TabBar::TabBar(MainView *parent)
+TabBar::TabBar(QWidget *parent)
: KTabBar(parent)
- , m_parent(parent)
, m_currentTabPreview(-1)
{
setElideMode(Qt::ElideRight);
@@ -84,10 +84,12 @@ TabBar::~TabBar()
QSize TabBar::tabSizeHint(int index) const
{
- int buttonSize = m_parent->addTabButton()->size().width();
- int tabBarWidth = m_parent->size().width() - buttonSize;
- int baseWidth = m_parent->sizeHint().width()/BASE_WIDTH_DIVISOR;
- int minWidth = m_parent->sizeHint().width()/MIN_WIDTH_DIVISOR;
+ MainView *view = qobject_cast<MainView *>(parent());
+
+ int buttonSize = view->addTabButton()->size().width();
+ int tabBarWidth = view->size().width() - buttonSize;
+ int baseWidth = view->sizeHint().width()/BASE_WIDTH_DIVISOR;
+ int minWidth = view->sizeHint().width()/MIN_WIDTH_DIVISOR;
int w;
if (baseWidth*count()<tabBarWidth)
@@ -139,8 +141,10 @@ void TabBar::reloadTab()
void TabBar::showTabPreview(int tab)
{
- WebView *view = m_parent->webView(tab);
- WebView *currentView = m_parent->webView(currentIndex());
+ MainView *mv = qobject_cast<MainView *>(parent());
+
+ WebView *view = mv->webView(tab);
+ WebView *currentView = mv->webView(currentIndex());
// should fix bug #212219
if(!currentView)
diff --git a/src/tabbar.h b/src/tabbar.h
index b78e9b24..76d70197 100644
--- a/src/tabbar.h
+++ b/src/tabbar.h
@@ -33,7 +33,6 @@
// Local Includes
#include "rekonqprivate_export.h"
-#include "mainview.h"
// Qt Includes
#include <QPointer>
@@ -59,7 +58,7 @@ class REKONQ_TESTS_EXPORT TabBar : public KTabBar
Q_OBJECT
public:
- TabBar(MainView *parent);
+ TabBar(QWidget *parent);
~TabBar();
void showTabPreview(int tab);
@@ -93,8 +92,6 @@ private slots:
private:
friend class MainView;
- MainView *m_parent;
-
/**
* the index in which we are seeing a Context menu
*/