From 06981ab37e9bcbbed7fcbe08b6dd2be725f04d24 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 2 Oct 2009 01:29:16 +0200 Subject: Changin (again) layout and fixing last Visited page counter.. :) --- data/home.html | 62 +++++++++++++++++++++++++++----------------------------- src/homepage.cpp | 28 ++++++++++++------------- 2 files changed, 43 insertions(+), 47 deletions(-) diff --git a/data/home.html b/data/home.html index 1c9cf733..d709a1dc 100644 --- a/data/home.html +++ b/data/home.html @@ -24,57 +24,53 @@ text-align: center; } h1{ +font: normal bold 2em sans-serif; +text-align:right; color: #3F7AB7; +margin-right:3%; +margin-bottom: 20px; } +h2{ +font: normal bold 1.2em sans-serif; +color: #3F7AB7; +margin-top: 2em; +} /* ------------------------------------------------------- */ /* page sections */ #container { -width: 90%; -margin: auto; -} - - -#header{ -/* width: 95%; */ -text-align:right; +width: 100%; } #navigation { -/* width: 95%; */ -/* background: #3F7AB7; */ -margin: 2em 0; +float: right; +width: 20%; +text-align:center; } #content { -/* width: 100%; */ +width: 80%; text-align: left; +margin: 20px; } +.link { +width:96%; +margin: 10px 0; +background-color:#3F7AB7; +} /* -------------------------------------------------------- */ /* div navigations styles */ -div#navigation ul{ -margin: 0; -padding: 0; -list-style-type: none; -} - -div#navigation li{ -display: inline; -margin: 0 1em; -border-right: solid 1px; -padding: 0 1em; -} - -div#navigation a{ -/* color:#FFF; */ -font: normal bold 1.2em/2.5em arial,sans-serif; +div.link a{ +color:#FFF; +text-decoration:none; +font: normal bold 1.2em/2.5em sans-serif; } -div#navigation a:hover{ +div.link a:hover{ color: #ff0; } @@ -87,7 +83,7 @@ text-align: center; float:left; width:228px; padding: 11px 0px 0px 0px; -margin: 15px; +margin: 10px 10px 10px 0; } .thumbnail a { @@ -105,8 +101,10 @@ text-decoration:none;
- - +
%3
diff --git a/src/homepage.cpp b/src/homepage.cpp index e3af4cc2..bfbf0400 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -99,7 +99,7 @@ QString HomePage::fillFavorites() QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); - QString speed = ""; + QString speed = "

Favorites

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

Last Visited Sites

"; + int sites = 0; int i = 0; do { QModelIndex index = model->index(i, 0, QModelIndex() ); if(model->hasChildren(index)) { - for(int j=0; j< model->rowCount(index) && j<8; ++j) + for(int j=0; j< model->rowCount(index) && sites<8; ++j) { QModelIndex son = model->index(j, 0, index ); @@ -147,13 +148,12 @@ QString HomePage::lastVisitedSites() last += ""; last += "

"; last += "" + text + ""; - - i++; + sites++; } } i++; } - while( i<8 || model->hasIndex( i , 0 , QModelIndex() ) ); + while( sites<8 || model->hasIndex( i , 0 , QModelIndex() ) ); return last; @@ -162,21 +162,20 @@ QString HomePage::lastVisitedSites() QString HomePage::homePageMenu() { - QString menu = ""; + QString menu = ""; + menu += "
Last Visited Sites
"; + menu += "
History
"; + menu += "
Bookmarks
"; + menu += "
Favorites
"; return menu; } QString HomePage::fillHistory() { - QString history = ""; HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); + QString history = "

History

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

Bookmarks

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