summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analyzer/networkanalyzer.cpp12
-rw-r--r--src/application.cpp4
-rw-r--r--src/data/CMakeLists.txt1
-rw-r--r--src/data/default.css10
-rw-r--r--src/sessionmanager.cpp19
-rw-r--r--src/urlbar/listitem.cpp4
-rw-r--r--src/urlbar/urlbar.cpp8
-rw-r--r--src/webview.cpp17
8 files changed, 43 insertions, 32 deletions
diff --git a/src/analyzer/networkanalyzer.cpp b/src/analyzer/networkanalyzer.cpp
index 22a7c243..47713557 100644
--- a/src/analyzer/networkanalyzer.cpp
+++ b/src/analyzer/networkanalyzer.cpp
@@ -51,11 +51,11 @@ NetworkAnalyzer::NetworkAnalyzer(QWidget *parent)
headers << i18n("Method") << i18n("URL") << i18n("Response") << i18n("Length") << i18n("Content Type") << i18n("Info");
_requestList->setHeaderLabels( headers );
- _requestList->header()->setResizeMode(0, QHeaderView::ResizeToContents);
- _requestList->header()->setResizeMode(1, QHeaderView::Stretch);
- _requestList->header()->setResizeMode(2, QHeaderView::ResizeToContents);
- _requestList->header()->setResizeMode(3, QHeaderView::ResizeToContents);
- _requestList->header()->setResizeMode(4, QHeaderView::ResizeToContents);
+ _requestList->header()->setResizeMode(0, QHeaderView::Interactive);
+ _requestList->header()->setResizeMode(1, QHeaderView::Interactive);
+ _requestList->header()->setResizeMode(2, QHeaderView::Interactive);
+ _requestList->header()->setResizeMode(3, QHeaderView::Interactive);
+ _requestList->header()->setResizeMode(4, QHeaderView::Interactive);
_requestList->setAlternatingRowColors(true);
@@ -107,6 +107,8 @@ void NetworkAnalyzer::addRequest( QNetworkAccessManager::Operation op, const QNe
_mapper->setMapping( reply, reply );
connect( reply, SIGNAL( finished() ), _mapper, SLOT( map() ) );
+
+ _requestList->header()->resizeSections(QHeaderView::ResizeToContents);
}
diff --git a/src/application.cpp b/src/application.cpp
index 94a89c90..366191f4 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -525,9 +525,7 @@ void Application::updateConfiguration()
// Applies user defined CSS to all open webpages. If there no longer is a
// user defined CSS removes it from all open webpages.
- if (ReKonfig::userCSS().isEmpty())
- defaultSettings->setUserStyleSheetUrl(KUrl(KStandardDirs::locate("appdata" , "default.css")));
- else
+ if (!ReKonfig::userCSS().isEmpty())
defaultSettings->setUserStyleSheetUrl(ReKonfig::userCSS());
// ====== load Settings on main classes
diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt
index ef777c9c..5f0ac164 100644
--- a/src/data/CMakeLists.txt
+++ b/src/data/CMakeLists.txt
@@ -9,7 +9,6 @@ INSTALL(
INSTALL(
FILES
defaultbookmarks.xbel
- default.css
DESTINATION ${DATA_INSTALL_DIR}/rekonq
)
diff --git a/src/data/default.css b/src/data/default.css
deleted file mode 100644
index 3ddd3026..00000000
--- a/src/data/default.css
+++ /dev/null
@@ -1,10 +0,0 @@
-/*
-rekonq default css properties
-this file will not be considered
-setting a local stylesheet in rekonq config
-*/
-
-/* Set background color to white for sites forgetting this */
-body{
-background-color:#FFFFFF;
-} \ No newline at end of file
diff --git a/src/sessionmanager.cpp b/src/sessionmanager.cpp
index 6eb0cb6c..56e24f16 100644
--- a/src/sessionmanager.cpp
+++ b/src/sessionmanager.cpp
@@ -107,14 +107,14 @@ bool SessionManager::restoreSession()
do
{
line = in.readLine();
- if (line == QString("window"))
+ if (line == QL1S("window"))
{
line = in.readLine();
Application::instance()->loadUrl( KUrl(line), Rekonq::NewWindow);
}
else
{
- if (line == QString("currenttab"))
+ if (line == QL1S("currenttab"))
{
line = in.readLine();
bool ok;
@@ -129,10 +129,6 @@ bool SessionManager::restoreSession()
emit mv->tabBar()->setCurrentIndex(idx);
}
}
- else
- {
- kDebug() << "Failed to convert currenttab index line <" << line << "> to in value" << endl;
- }
}
else
{
@@ -164,9 +160,16 @@ QStringList SessionManager::closedSites()
do
{
line = in.readLine();
- if (line != QString("window"))
+ if (line != QL1S("window"))
{
- list << QString(line);
+ if(line == QL1S("currenttab"))
+ {
+ in.readLine(); // drop out the next field, containing the index of the current tab..
+ }
+ else
+ {
+ list << QString(line);
+ }
}
}
while (!line.isEmpty());
diff --git a/src/urlbar/listitem.cpp b/src/urlbar/listitem.cpp
index 97cd5cd8..037afb06 100644
--- a/src/urlbar/listitem.cpp
+++ b/src/urlbar/listitem.cpp
@@ -53,7 +53,7 @@
#include <QMouseEvent>
#include <QWebSettings>
#include <QFile>
-
+#include <QTextDocument>
ListItem::ListItem(const UrlSearchItem &item, QWidget *parent)
: QWidget(parent)
@@ -299,7 +299,7 @@ SearchListItem::SearchListItem(const UrlSearchItem &item, const QString &text, Q
QString SearchListItem::searchItemTitle(QString engine, QString text)
{
- return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for <b>%2</b>", engine, text));
+ return QString(i18nc("%1=search engine, e.g. Google, Wikipedia %2=text to search for", "Search %1 for <b>%2</b>", engine, Qt::escape(text)));
}
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 33515de6..5c3cba28 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -156,13 +156,17 @@ void UrlBar::activated(const KUrl& url, Rekonq::OpenType type)
void UrlBar::paintEvent(QPaintEvent *event)
{
QColor backgroundColor;
+ QColor foregroundColor;
+
if (_privateMode)
{
backgroundColor = QColor(220, 220, 220); // light gray
+ foregroundColor = Qt::black;
}
else
{
backgroundColor = Application::palette().color(QPalette::Base);
+ foregroundColor = Application::palette().color(QPalette::Text);
}
// set background color of UrlBar
@@ -174,13 +178,13 @@ void UrlBar::paintEvent(QPaintEvent *event)
if (_tab->url().scheme() == QL1S("https"))
{
backgroundColor = QColor(255, 255, 171); // light yellow
+ foregroundColor = Qt::black;
}
p.setBrush(QPalette::Base, backgroundColor);
+ p.setBrush(QPalette::Text, foregroundColor);
}
else
{
- // NOTE: I chose this instead of the old QColor(116, 192, 250)
- // to try respecting style colors
QColor loadingColor = Application::palette().color(QPalette::ToolTipBase);
QLinearGradient gradient( QPoint(0, 0), QPoint(width(), height()) );
diff --git a/src/webview.cpp b/src/webview.cpp
index 9efd3a8c..afa63028 100644
--- a/src/webview.cpp
+++ b/src/webview.cpp
@@ -57,6 +57,7 @@
#include <QtGui/QClipboard>
#include <QtGui/QKeyEvent>
#include <QtGui/QLayout>
+#include <QtGui/QWindowsStyle>
#include <QtDBus/QDBusConnectionInterface>
#include <QtDBus/QDBusInterface>
@@ -74,7 +75,21 @@ WebView::WebView(QWidget* parent)
{
WebPage *page = new WebPage(this);
setPage(page);
-
+
+ // // NOTE This is a lot hackish. We copied it from Arora, but using a "Windows Style"
+ // // seems really a pity to me. The problem is that using a KStyle everything seems "broken"
+ // // (at least with dark colors). So I think the code should be somthing like:
+ // KStyle s;
+ // setPalette( s.standardPalette() );
+ // // But it doesn't work :(
+ // // We'll see in next KDE releases...
+ QPalette p;
+ if (p.color(QPalette::Window) != Qt::white) {
+ QWindowsStyle s;
+ p = s.standardPalette();
+ setPalette(p);
+ }
+
// download system
connect(this, SIGNAL(linkShiftClicked(const KUrl &)), page, SLOT(downloadUrl(const KUrl &)));
connect(page, SIGNAL(downloadRequested(const QNetworkRequest &)), page, SLOT(downloadRequest(const QNetworkRequest &)));