From kde-pim Sat Aug 16 20:24:34 2008 From: Kolja Date: Sat, 16 Aug 2008 20:24:34 +0000 To: kde-pim Subject: [Kde-pim] [PATCH] Nice headers for akregator Message-Id: <200808162224.34552.nikj () gmx ! de> X-MARC-Message: https://marc.info/?l=kde-pim&m=121891832525274 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--Boundary-00=_CezpIeyKgNQbmhG" --Boundary-00=_CezpIeyKgNQbmhG Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello! I'm new to kde development and this is my first post to this mailing list. The attached patch changes the appearance of the headers in akregator. For a preview take a look at: http://datenschreck.net/kde/akregator_freshedHeaders_beforeAfter.jpg http://datenschreck.net/kde/akregator_freshedHeaders_beforeAfter_combinedView.jpg What's wrong with the old ones? - they look old - they do _not_ fit into the fresh oxygen environment What about the new ones? + they look more modern + they fit better into the environment + the title of an article is blue (QPalette::Link), so more users would recognice this as a link. With this the user can go to the complete article by "Complete Story" in the end and also by clicking the title. + if you select a feed in the tree view, the presented title (in the article viewer part/header) is now clickable (home page) + Colors (grey) from the color palette were used (http://wiki.kde.org/tiki-index.php?page=Colors) - they need more space The attached patch applies to the directory akregator/src, but only articleformatter.cpp is affected. It's meant for trunk. Comments and suggestions?! :) Best regards, Kolja --Boundary-00=_CezpIeyKgNQbmhG Content-Type: text/x-diff; charset="iso 8859-15"; name="niceheaderspatch.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="niceheaderspatch.diff" Index: articleformatter.cpp =================================================================== --- articleformatter.cpp (revision 848062) +++ articleformatter.cpp (working copy) @@ -81,11 +81,15 @@ class DefaultNormalViewFormatter::Summar text = QString("
\n").arg(QApplication::isRightToLeft() ? "rtl" : "ltr"); text += QString("\n"; // headertitle text += "
\n"; // /headerbox @@ -102,16 +106,16 @@ class DefaultNormalViewFormatter::Summar if( !node->description().isEmpty() ) { - text += QString("
").arg(Utils::stripTags(Utils::directionOf(node->description()))); - text += i18n("Description: %1

", node->description()); - text += "
\n"; // /description + text += QString("").arg(Utils::stripTags(Utils::directionOf(node->description()))); + text += QString ("%1:").arg(i18n("Description")) + ""; + text += "" + node->description() + "
\n"; } if ( !node->htmlUrl().isEmpty() ) { - text += QString("
").arg(Utils::directionOf(node->htmlUrl())); - text += i18n("Homepage: %2", node->htmlUrl(), node->htmlUrl()); - text += "
\n"; // / link + text += QString("").arg(Utils::directionOf(node->htmlUrl())); + text += QString ("%1:").arg(i18n("Homepage")) + ""; + text += QString("%2").arg(node->htmlUrl(),node->htmlUrl()) + "\n"; } //text += i18n("Unread articles: %1").arg(node->unread()); @@ -235,7 +239,7 @@ QString DefaultNormalViewFormatter::form //text += QString("
%2 (%3, %4)
").arg(url).arg(url).arg(lengthStr).arg(type); // } - //kDebug() << text; + kDebug() << text; return text; } @@ -263,48 +267,52 @@ QString DefaultNormalViewFormatter::getC + QString(!Settings::underlineLinks() ? " text-decoration: none ! important;\n" : "") + "}\n\n" +".headerbox {\n" - +" background: %2 ! important;\n" - +" color: %3 ! important;\n" - +" border:1px solid #000;\n" - +" margin-bottom: 10pt;\n" + +" color: %2 ! important;\n" + "}\n\n") .arg( pal.color( QPalette::Link ).name(), - pal.color( QPalette::Background ).name(), pal.color( QPalette::Text ).name() ); css += QString(".headertitle a:link { color: %1 ! important;\n text-decoration: none ! important;\n }\n" ".headertitle a:visited { color: %1 ! important;\n text-decoration: none ! important;\n }\n" ".headertitle a:hover{ color: %1 ! important;\n text-decoration: none ! important;\n }\n" ".headertitle a:active { color: %1 ! important;\n text-decoration: none ! important;\n }\n" ) - .arg( pal.color( QPalette::HighlightedText ).name() ); + .arg( pal.color( QPalette::Link ).name() ); css += QString( ".headertitle {\n" - " background: %1 ! important;\n" - " padding:2px;\n" - " color: %2 ! important;\n" + " background: #EBECED ! important;\n" + " padding:10px;\n" + " color: %1 ! important;\n" + " border-bottom: 1px solid #BBBFC3;\n" " font-weight: bold;\n" + " font-size: large;\n" " text-decoration: none ! important;\n" + " margin-bottom: 10px ! important;\n" "}\n\n" ".header {\n" " font-weight: bold;\n" " padding:2px;\n" + " color: #6D7179;\n" + " padding-left:20px;\n" " margin-right: 5px;\n" " text-decoration: none ! important;\n" "}\n\n" + ".headertext {\n" + " text-decoration: none ! important;\n" + " color:#6D7179;\n" + "}\n\n" ".headertext a {\n" " text-decoration: none ! important;\n" + " color: #6D7179;\n" "}\n\n" ".headimage {\n" " float: right;\n" " margin-left: 5px;\n" - "}\n\n").arg( - pal.color( QPalette::Highlight ).name(), - pal.color( QPalette::HighlightedText ).name() ); + "}\n\n").arg( pal.color( QPalette::Highlight ).name() ); css += QString( "body { clear: none; }\n\n" ".content {\n" " display: block;\n" - " margin-bottom: 6px;\n" + " padding: 10px 15px 0px 15px;\n" "}\n\n" // these rules make sure that there is no leading space between the header and the first of the text ".content > P:first-child {\n margin-top: 1px; }\n" @@ -316,6 +324,7 @@ QString DefaultNormalViewFormatter::getC //"@media screen { body { overflow: auto; } }\n" "\n\n"); + //kDebug() << css; return css; } @@ -443,49 +452,52 @@ QString DefaultCombinedViewFormatter::ge + QString(!Settings::underlineLinks() ? " text-decoration: none ! important;\n" : "") + "}\n\n" +".headerbox {\n" - +" background: %2 ! important;\n" - +" color: %3 ! important;\n" - +" border:1px solid #000;\n" - +" margin-bottom: 10pt;\n" + +" color: %2 ! important;\n" // +" width: 99%;\n" + "}\n\n") .arg( pal.color( QPalette::Link ).name(), - pal.color( QPalette::Background ).name(), pal.color( QPalette::Text ).name() ); css += QString(".headertitle a:link { color: %1 ! important; text-decoration: none ! important;\n }\n" ".headertitle a:visited { color: %1 ! important; text-decoration: none ! important;\n }\n" ".headertitle a:hover{ color: %1 ! important; text-decoration: none ! important;\n }\n" ".headertitle a:active { color: %1 ! important; text-decoration: none ! important;\n }\n") - .arg( pal.color( QPalette::HighlightedText ).name() ); + .arg( pal.color( QPalette::Link ).name() ); css += QString( ".headertitle {\n" - " background: %1 ! important;\n" - " padding:2px;\n" - " color: %2 ! important;\n" + " background: #EBECED ! important;\n" + " padding:10px;\n" + " color: %1 ! important;\n" + " border-bottom: 1px solid #BBBFC3;\n" " font-weight: bold;\n" + " font-size: large;\n" " text-decoration: none ! important;\n" + " margin-bottom: 10px ! important;\n" "}\n\n" ".header {\n" " font-weight: bold;\n" " padding:2px;\n" + " color:#6D7179;\n" + " padding-left:20px;\n" " margin-right: 5px;\n" " text-decoration: none ! important;\n" "}\n\n" ".headertext {\n" " text-decoration: none ! important;\n" + " color:#6D7179;\n" "}\n\n" ".headimage {\n" " float: right;\n" " margin-left: 5px;\n" - "}\n\n").arg( pal.color( QPalette::Highlight ).name(), - pal.color( QPalette::HighlightedText ).name() ); + "}\n\n").arg( pal.color( QPalette::Highlight ).name() ); + css += QString( "body { clear: none; }\n\n" ".content {\n" " display: block;\n" - " margin-bottom: 6px;\n" + " padding: 10px 15px 0px 15px;\n" + //" margin-bottom: 6px;\n" "}\n\n" // these rules make sure that there is no leading space between the header and the first of the text ".content > P:first-child {\n margin-top: 1px; }\n" --Boundary-00=_CezpIeyKgNQbmhG Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KDE PIM mailing list kde-pim@kde.org https://mail.kde.org/mailman/listinfo/kde-pim KDE PIM home page at http://pim.kde.org/ --Boundary-00=_CezpIeyKgNQbmhG--