summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-10-06 12:30:50 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-10-06 12:30:50 +0200
commitfe3c587f98f1212ba0f639a4954e681743185bce (patch)
tree27eadc8b91e065a470481e8b07f75827966a3f0e
parentCleaning headers and so on... (diff)
downloadrekonq-fe3c587f98f1212ba0f639a4954e681743185bce.tar.xz
HomePage style fixes.
I'm quite sure this is going to be home page style for rekonq 0.3
-rw-r--r--data/home.html27
-rw-r--r--src/homepage.cpp35
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;
<body>
<div id="container">
-<div id="navigation">
-<h1>rekonq</h1>
%2
+<div id="navigation">
+%3
</div>
-<div id="content">%3</div>
+<div id="content">%4</div>
</div>
</body>
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 = "<h2>" + i18n("Last Visited Sites") + "</h2>";
speed = lastVisitedSites();
+ }
if(url == KUrl("rekonq:history"))
+ {
+ title = "<h2>" + i18n("History") + "</h2>";
speed = fillHistory();
+ }
if(url == KUrl("rekonq:bookmarks"))
+ {
+ title = "<h2>" + i18n("Bookmarks") + "</h2>";
speed = fillBookmarks();
+ }
if(url == KUrl("rekonq:home") || url == KUrl("rekonq:favorites"))
+ {
+ title = "<h2>" + i18n("Favorites") + "</h2>";
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 = "<h2>Favorites</h2>";
+ 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 = "<h2>Last Visited Sites</h2>";
+ QString last;
int sites = 0;
int i = 0;
do
@@ -162,11 +175,13 @@ QString HomePage::lastVisitedSites()
QString HomePage::homePageMenu()
{
- QString menu = "";
- menu += "<div class=\"link\"><a href=\"rekonq:lastSites\">Last Visited Sites</a></div>";
- menu += "<div class=\"link\"><a href=\"rekonq:history\">History</a></div>";
- menu += "<div class=\"link\"><a href=\"rekonq:bookmarks\">Bookmarks</a></div>";
- menu += "<div class=\"link\"><a href=\"rekonq:favorites\">Favorites</a></div>";
+ QString menu = "<div class=\"link\">";
+ menu += "<h1>rekonq</h1>";
+ menu += "<a href=\"rekonq:lastSites\">Last Visited Sites</a><br />";
+ menu += "<a href=\"rekonq:history\">History</a><br />";
+ menu += "<a href=\"rekonq:bookmarks\">Bookmarks</a><br /";
+ menu += "<a href=\"rekonq:favorites\">Favorites</a><br />";
+ menu += "</div>";
return menu;
}
@@ -175,7 +190,7 @@ QString HomePage::fillHistory()
{
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
- QString history = "<h2>History</h2>";
+ QString history;
int i = 0;
do
{
@@ -210,7 +225,7 @@ QString HomePage::fillBookmarks()
return QString("Error retrieving bookmarks!");
}
- QString str = "<h2>Bookmarks</h2>";
+ QString str;
KBookmark bookmark = bookGroup.first();
while (!bookmark.isNull())
{