From 2e68daf1a6c8da0a2c49bcdae9a97588ced95444 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 2 Oct 2009 00:31:32 +0200 Subject: Changing page layout (more to come..) --- data/home.html | 12 ++++++------ src/homepage.cpp | 56 +++++++++++++++++++++----------------------------------- 2 files changed, 27 insertions(+), 41 deletions(-) diff --git a/data/home.html b/data/home.html index c0d71f21..1c9cf733 100644 --- a/data/home.html +++ b/data/home.html @@ -32,24 +32,24 @@ color: #3F7AB7; /* page sections */ #container { -width: 85%; +width: 90%; margin: auto; } #header{ -width: 95%; +/* width: 95%; */ text-align:right; } #navigation { -width: 95%; -background: #3F7AB7; +/* width: 95%; */ +/* background: #3F7AB7; */ margin: 2em 0; } #content { -width: 100%; +/* width: 100%; */ text-align: left; } @@ -70,7 +70,7 @@ padding: 0 1em; } div#navigation a{ -color:#FFF; +/* color:#FFF; */ font: normal bold 1.2em/2.5em arial,sans-serif; } diff --git a/src/homepage.cpp b/src/homepage.cpp index 9a3c8ca9..58e1e849 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -99,27 +99,22 @@ QString HomePage::fillPreferred() QStringList names = ReKonfig::previewNames(); QStringList urls = ReKonfig::previewUrls(); - QString speed = ""; - for(int i=0; i<4; ++i) + QString speed = ""; + for(int i=0; i<8; ++i) { - speed += ""; - } - speed += ""; - for(int i=4; i<8; ++i) - { - speed += ""; + speed += "" + text + ""; } - speed += "
"; - speed += ""; - speed += ""; - speed += "

"; - speed += "" + names.at(i) + "
"; + QString text = names.at(i); + if(text.length() > 20) + { + text.truncate(17); + text += "..."; + } + speed += "
"; speed += ""; speed += ""; speed += "

"; - speed += "" + names.at(i) + "
"; return speed; } @@ -129,37 +124,29 @@ QString HomePage::lastVisitedSites() { HistoryTreeModel *model = Application::historyManager()->historyTreeModel(); - QString last = ""; + QString last = ""; int i = 0; do { QModelIndex index = model->index(i, 0, QModelIndex() ); if(model->hasChildren(index)) { - for(int j=0; j< model->rowCount(index) && j<4; ++j) + for(int j=0; j< model->rowCount(index) && j<8; ++j) { QModelIndex son = model->index(j, 0, index ); - - last += ""; - - i++; - } - last += ""; - for(int j=4; j< model->rowCount(index) && j<8; ++j) - { - QModelIndex son = model->index(j, 0, index ); - - last += ""; + last += "" + text + ""; i++; } @@ -168,7 +155,6 @@ QString HomePage::lastVisitedSites() } while( i<8 || model->hasIndex( i , 0 , QModelIndex() ) ); - last += "
"; + + QString text = son.data().toString(); + if(text.length() > 20) + { + text.truncate(17); + text += "..."; + } + last += "
"; last += ""; last += ""; last += "

"; - last += "" + son.data().toString() + "
"; - last += ""; - last += ""; - last += "

"; - last += "" + son.data().toString() + "
"; return last; } -- cgit v1.2.1