summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-29 01:59:14 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-29 01:59:14 +0200
commit130b9564624b976b2b1e615e7457d43f985ef0ce (patch)
tree88a91bd6367e01a171c093a7c4f2dd6873c29c07
parentFixing crash on opening tabs after closing other window(s). (diff)
downloadrekonq-130b9564624b976b2b1e615e7457d43f985ef0ce.tar.xz
New rekonq home page layout
-rw-r--r--data/home.html106
-rw-r--r--src/homepage.cpp63
-rw-r--r--src/homepage.h2
3 files changed, 81 insertions, 90 deletions
diff --git a/data/home.html b/data/home.html
index b5ca9b67..1daa34fb 100644
--- a/data/home.html
+++ b/data/home.html
@@ -6,6 +6,9 @@
<style type="text/css">
+/* ------------------------------------------------------- */
+/* generic styles */
+
html{
margin:0;
padding:0;
@@ -17,108 +20,95 @@ margin:0;
padding:0;
font-family: sans-serif;
font-size: 100%;
+text-align: center;
}
-#header{
-text-align:right;
-padding: 10px;
-margin:5px;
+h1{
+color: #3F7AB7;
}
+
/* ------------------------------------------------------- */
+/* page sections */
-h1{
-color: #3F7AB7;
+#container {
+width: 85%;
+margin: auto;
}
-#float {
-float: right;
-width: 275px;
-clear: right;
-margin-right: 15px;
-}
-.block {
-background: url(%1/bot.gif) bottom center no-repeat #f3f3f3;
-border-left: 1px solid #d9d9d9;
-border-right: 1px solid #d9d9d9;
-padding: 5px;
-width: 245px;
-margin: 0 15px 15px 0px;
-font-size: 0.8em;
-color: #444;
+#header{
+width: 95%;
+text-align:right;
+}
-/*font-weight: bold;
-clear: right;*/
+#navigation {
+width: 95%;
+background: #3F7AB7;
+margin: 2em 0;
}
-.block h2 {
-background: url(%1/top.png) no-repeat;
-color: #333;
-line-height: 24px;
-padding: 0 7px;
-border: 0;
-margin: -6px -6px 0 -6px;
-font-size: 1em;
+#thumbs {
+width: 100%;
+text-align: center;
}
-.block ul {
-padding-left: 1.5em;
+/* -------------------------------------------------------- */
+/* div navigations styles */
+
+div#navigation ul{
+margin: 0;
+padding: 0;
+list-style-type: none;
}
-.block ul a {
-color: #444;
-text-decoration: none;
+div#navigation li{
+display: inline;
+margin: 0 1em;
+border-right: solid 1px;
+padding: 0 1em;
}
-.block ul a:hover {
-text-decoration: underline;
+div#navigation a{
+color:#FFF;
+font: normal bold 1.2em/2.5em arial,sans-serif;
}
-#left{
-margin: 0 290px 0 0;
-background-color:#444;
-/*width:70%;
-margin-right:30%;*/
+div#navigation a:hover{
+color: #ff0;
}
+/* -------------------------------------------------------- */
+/* Thumbnail class */
+
.thumbnail {
background: url(%1/bg.png) no-repeat;
text-align: center;
float:left;
width:228px;
padding: 11px 0px 0px 0px;
-margin: 0 15px;
+margin: 15px;
}
.thumbnail a {
display: block;
text-align: center;
-width:228px;
-padding: 11px 0px 5px 0px;
color: #767676;
font-size: 0.8em;
text-decoration:none;
}
+/* -------------------------------------------------------- */
</style>
-
-<!-- =================================================================================== -->
-
</head>
<body>
-<div id="header">
-<h1>rekonq</h1>
-</div>
-
-
-<div id="float">
-<div class="block">%2</div>
-<div class="block">%3</div>
+<div id="container">
+<div id="header"><h1>rekonq</h1></div>
+<div id="navigation">%2</div>
+<table>%3</table>
</div>
-<div id="left">%4</div>
</body>
</html>
diff --git a/src/homepage.cpp b/src/homepage.cpp
index 4c72712f..912ed11d 100644
--- a/src/homepage.cpp
+++ b/src/homepage.cpp
@@ -73,17 +73,13 @@ QString HomePage::rekonqHomePage()
QString imagesPath = QString("file://") + KGlobal::dirs()->findResourceDir("data", "rekonq/pics/bg.png") + QString("rekonq/pics");
QString speed = speedDial();
- QString search = searchEngines();
- QString lastBlock = ReKonfig::showLastVisitedSites() ? fillRecentHistory() : recentlyClosedTabs() ;
+ QString menu = homePageMenu();
-
QString html = QString(QLatin1String(file.readAll()))
.arg(imagesPath)
- .arg(search)
- .arg(lastBlock)
+ .arg(menu)
.arg(speed)
;
-
return html;
}
@@ -93,32 +89,31 @@ QString HomePage::speedDial()
QStringList names = ReKonfig::previewNames();
QStringList urls = ReKonfig::previewUrls();
- QString speed;
- for(int i = 0; i< urls.count(); ++i)
+ QString speed = "<tr>";
+ for(int i=0; i<4; ++i)
{
- speed += "<div class=\"thumbnail\">";
+ speed += "<td><div class=\"thumbnail\">";
speed += "<object type=\"application/image-preview\" width=\"200\">";
speed += "<param name=\"url\" value=\"" + urls.at(i) + "\">";
speed += "<param name=\"position\" value=\"" + QString::number(i) + "\">";
speed += "</object>";
- speed += "<br />";
- speed += "<a href=\"" + urls.at(i) + "\">" + names.at(i) + "</a></div>";
+ speed += "<br /><br />";
+ speed += "<a href=\"" + urls.at(i) + "\">" + names.at(i) + "</a></div></td>";
}
- return speed;
-}
-
-
-QString HomePage::searchEngines()
-{
- QString engines = "<h2>" + i18n("Search Engines") + "</h2>";
-
- // Google search engine
- engines += "<form method=\"get\" action=\"http://www.google.com/search\">";
- engines += "<label for=\"q\">Google:</label>";
- engines += "<input type=\"text\" name=\"q\" />";
- engines += "</form>";
+ speed += "</tr><tr>";
+ for(int i=4; i<8; ++i)
+ {
+ speed += "<td><div class=\"thumbnail\">";
+ speed += "<object type=\"application/image-preview\" width=\"200\">";
+ speed += "<param name=\"url\" value=\"" + urls.at(i) + "\">";
+ speed += "<param name=\"position\" value=\"" + QString::number(i) + "\">";
+ speed += "</object>";
+ speed += "<br /><br />";
+ speed += "<a href=\"" + urls.at(i) + "\">" + names.at(i) + "</a></div></td>";
+ }
+ speed += "</tr>";
- return engines;
+ return speed;
}
@@ -126,14 +121,12 @@ QString HomePage::recentlyClosedTabs()
{
QString closed = "<h2>" + i18n("Recently closed tabs") + "</h2>";
closed += "<ul>";
-
KUrl::List links = Application::instance()->mainWindow()->mainView()->recentlyClosedTabs();
Q_FOREACH(const KUrl &url, links)
{
closed += "<li><a href=\"" + url.prettyUrl() + "\">" + url.prettyUrl() + "</a></li>";
}
-
closed += "</ul>";
return closed;
}
@@ -143,9 +136,7 @@ QString HomePage::fillRecentHistory()
{
QString history = "<h2>" + i18n("Last 20 visited sites") + "</h2>";
history += "<ul>";
-
HistoryTreeModel *model = Application::historyManager()->historyTreeModel();
-
int i = 0;
do
{
@@ -170,7 +161,17 @@ QString HomePage::fillRecentHistory()
while( i<20 || model->hasIndex( i , 0 , QModelIndex() ) );
history += "<ul>";
-
return history;
-
+}
+
+
+QString HomePage::homePageMenu()
+{
+ QString menu = "<ul>";
+ menu += "<li><a href=\"about:lastSites\">Last Visited Sites</a></li>";
+ menu += "<li><a href=\"about:history\">History</a></li>";
+ menu += "<li><a href=\"about:bookmarks\">Bookmarks</a></li>";
+ menu += "<li><a href=\"about:preferred\">Preferred</a></li>";
+ menu += "</ul>";
+ return menu;
}
diff --git a/src/homepage.h b/src/homepage.h
index 7604f0c3..90a211a9 100644
--- a/src/homepage.h
+++ b/src/homepage.h
@@ -44,10 +44,10 @@ public:
~HomePage();
QString rekonqHomePage();
+ QString homePageMenu();
private:
QString speedDial();
- QString searchEngines();
QString recentlyClosedTabs();
QString fillRecentHistory();