From fe3c587f98f1212ba0f639a4954e681743185bce Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Tue, 6 Oct 2009 12:30:50 +0200 Subject: HomePage style fixes. I'm quite sure this is going to be home page style for rekonq 0.3 --- data/home.html | 27 +++++++++++++++------------ src/homepage.cpp | 35 +++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/data/home.html b/data/home.html index 6a7db227..8ad4a7ce 100644 --- a/data/home.html +++ b/data/home.html @@ -24,17 +24,18 @@ text-align: center; } h1{ -font: normal bold 2em sans-serif; +font: normal bold 1.5em sans-serif; text-align:right; -color: #3F7AB7; -margin-right:3%; -margin-bottom: 20px; +color: #FFF; +margin-right:1%; +margin-bottom: 15px; } h2{ font: normal bold 1.2em sans-serif; color: #3F7AB7; -margin-top: 2em; +text-align: left; +margin: 20px 20px 20px 22px; } /* ------------------------------------------------------- */ @@ -57,9 +58,11 @@ margin: 20px; } .link { -width:96%; -margin: 10px 0; -background-color:#3F7AB7; +text-align:left; +margin: 10px; +background-color:#6096CF; +padding: 10px 10px 20px 10px; +border-width: 10px; } /* -------------------------------------------------------- */ /* div navigations styles */ @@ -67,7 +70,7 @@ background-color:#3F7AB7; div.link a{ color:#FFF; text-decoration:none; -font: normal bold 1.2em/2.5em sans-serif; +font: normal bold 1em sans-serif; } div.link a:hover{ @@ -102,11 +105,11 @@ text-decoration:none;
- diff --git a/src/homepage.cpp b/src/homepage.cpp index 723e670c..a9c51c9a 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -74,18 +74,31 @@ QString HomePage::rekonqHomePage(const KUrl &url) QString imagesPath = QString("file://") + KGlobal::dirs()->findResourceDir("data", "rekonq/pics/bg.png") + QString("rekonq/pics"); QString menu = homePageMenu(); - QString speed; + QString title, speed; if(url == KUrl("rekonq:lastSites")) + { + title = "

" + i18n("Last Visited Sites") + "

"; speed = lastVisitedSites(); + } if(url == KUrl("rekonq:history")) + { + title = "

" + i18n("History") + "

"; speed = fillHistory(); + } if(url == KUrl("rekonq:bookmarks")) + { + title = "

" + i18n("Bookmarks") + "

"; speed = fillBookmarks(); + } if(url == KUrl("rekonq:home") || url == KUrl("rekonq:favorites")) + { + title = "

" + i18n("Favorites") + "

"; speed = fillFavorites(); + } QString html = QString(QLatin1String(file.readAll())) .arg(imagesPath) + .arg(title) .arg(menu) .arg(speed) ; @@ -99,7 +112,7 @@ QString HomePage::fillFavorites() QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); - QString speed = "

Favorites

"; + QString speed; for(int i=0; i<8; ++i) { QString text = names.at(i); @@ -124,7 +137,7 @@ QString HomePage::lastVisitedSites() { HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); - QString last = "

Last Visited Sites

"; + QString last; int sites = 0; int i = 0; do @@ -162,11 +175,13 @@ QString HomePage::lastVisitedSites() QString HomePage::homePageMenu() { - QString menu = ""; - menu += ""; - menu += ""; - menu += ""; - menu += ""; + QString menu = "
"; + menu += "

rekonq

"; + menu += "Last Visited Sites
"; + menu += "History
"; + menu += "Bookmarks
Favorites
"; + menu += "
"; return menu; } @@ -175,7 +190,7 @@ QString HomePage::fillHistory() { HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); - QString history = "

History

"; + QString history; int i = 0; do { @@ -210,7 +225,7 @@ QString HomePage::fillBookmarks() return QString("Error retrieving bookmarks!"); } - QString str = "

Bookmarks

"; + QString str; KBookmark bookmark = bookGroup.first(); while (!bookmark.isNull()) { -- cgit v1.2.1