Some skins rework, preparation for newspaper mode.
This commit is contained in:
parent
e26c54fb2f
commit
335e965581
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<skin version="0.12">
|
||||
<name>luxuous</name>
|
||||
<author>
|
||||
<name>Martin Rotter</name>
|
||||
<email>rotter.martinos@gmail.com</email>
|
||||
</author>
|
||||
<style>oxygen,fusion,plastique</style>
|
||||
<markup>PGh0bWw+DQogIDxoZWFkPg0KICAgIDxzdHlsZT4NCiAgICAgIHByZSB7IHdoaXRlLXNwYWNlOiBwcmUtd3JhcCB9DQoNCiAgICAgIC5oZWFkZXJ0ZXh0IHsNCiAgICAgICAgICBmb250LXNpemU6IDE5cHg7DQogICAgICAgICAgbWFyZ2luLWJvdHRvbTogMTBweDsNCiAgICAgIH0NCg0KICAgICAgLmhlYWRlciB7DQogICAgICAgICAgZm9udC1zaXplOiAxNXB4Ow0KICAgICAgICAgIC13ZWJraXQtdHJhbnNpdGlvbjogYmFja2dyb3VuZCAxcyBlYXNlLW91dDsNCiAgICAgICAgICBiYWNrZ3JvdW5kOiAtd2Via2l0LWdyYWRpZW50KGxpbmVhcixsZWZ0IHRvcCxsZWZ0IGJvdHRvbSxjb2xvci1zdG9wKDAlLCM0NTQ4NGQpLGNvbG9yLXN0b3AoMTAwJSwjMDAwMDAwKSk7DQogICAgICAgICAgYmFja2dyb3VuZDogLXdlYmtpdC1saW5lYXItZ3JhZGllbnQodG9wLCM0NTQ4NGQgMCwjMDAwMDAwIDEwMCUpOw0KICAgICAgICAgIC13ZWJraXQtYm9yZGVyLXJhZGl1czogM3B4Ow0KICAgICAgICAgIHRleHQtc2hhZG93OiAwIDAgMXB4ICNmZmY7DQogICAgICAgICAgZmlsdGVyOiBkcm9wc2hhZG93KGNvbG9yPSNmZmZmZmYsb2ZmeD0wLG9mZnk9MCk7DQogICAgICAgICAgcGFkZGluZzogOHB4Ow0KICAgICAgICAgIG1hcmdpbjogNXB4IGF1dG8gNXB4IGF1dG87D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CMwMDAwMDAgMTAwJSk7DQogICAgICAgICAgLXdlYmtpdC1ib3JkZXItcmFkaXVzOiAzcHg7DQogICAgICAgICAgdGV4dC1zaGFkb3c6IDAgMCAxcHggI2ZmZjsNCiAgICAgICAgICBmaWx0ZXI6IGRyb3BzaGFkb3coY29sb3I9I2ZmZmZmZixvZmZ4PTAsb2ZmeT0wKTsNCiAgICAgICAgICBwYWRkaW5nOiA4cHg7DQogICAgICAgICAgbWFyZ2luOiA1cHggYXV0byA1cHggYXV0bzsNCiAgICAgICAgICBjb2xvcjogd2hpdGU7DQogICAgICB9DQogICAgPC9zdHlsZT4NCiAgICA8dGl0bGU+JTE8L3RpdGxlPg0KICA8L2hlYWQ+DQogIDxib2R5Pg0KICAgIDxkaXYgY2xhc3M9XCJoZWFkZXJcIj4NCiAgICAgIDxkaXYgY2xhc3M9XCJoZWFkZXJ0ZXh0XCI+JTE8L2Rpdj4NCiAgICAgICUyPGJyLz4NCiAgICAgIDxhIGhyZWY9XCIlM1wiPiUzPC9hPiANCiAgICA8L2Rpdj4NCiAgICA8ZGl2IGNsYXNzPVwiY29udGVudFwiPiAlNCA8L2Rpdj4NCiAgICA8ZGl2IGNsYXNzPVwiZm9vdGVyXCI+ICU1IDwvZGl2Pg0KICA8L2JvZHk+DQo8L2h0bWw+</markup>
|
||||
<data/>
|
||||
</skin>
|
@ -6,7 +6,9 @@
|
||||
<email>rotter.martinos@gmail.com</email>
|
||||
</author>
|
||||
<style/>
|
||||
<markup> PGh0bWw+DQogIDxoZWFkPg0KICAgIDxzdHlsZT4NCiAgICAgIGJvZHkgew0KICAgICAgICBtYXJnaW46IDBweDsNCiAgICAgICAgcGFkZGluZzogMHB4Ow0KICAgICAgfQ0KICAgIA0KICAgICAgcHJlIHsNCiAgICAgICAgd2hpdGUtc3BhY2U6IHByZS13cmFwOw0KICAgICAgfQ0KDQogICAgICAuaGVhZGVydGV4dCB7DQogICAgICAgIGZvbnQtc2l6ZTogMjBweDsNCiAgICAgICAgbW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QogIDxib2R5Pg0KCSUyDQogIDwvYm9keT4NCjwvaHRtbD4=
|
||||
</markup_wrapper>
|
||||
<markup> PGRpdiBjbGFzcz0iaGVhZGVyIj4NCiAgPGRpdiBjbGFzcz0iaGVhZGVydGV4dCI+DQoJJTENCiAgPC9kaXY+DQogICUyICglNSkNCiAgPGJyPg0KICA8YSBocmVmPSIlMyI+DQogICUzDQogIDwvYT4NCjwvZGl2Pg0KPGRpdiBjbGFzcz0iY29udGVudCI+DQogICU0IA0KPC9kaXY+
|
||||
</markup>
|
||||
<data/>
|
||||
</skin>
|
@ -4,6 +4,15 @@
|
||||
#include <QTreeView>
|
||||
|
||||
|
||||
// TODO: http://soundguyrob.files.wordpress.com/2011/03/screen-shot-2011-03-01-at-7-45-23-pm.jpg
|
||||
// přepsat počet nepřečtených zpráv podle screenshotu (tedy smazat asi sloupec "unread")
|
||||
// a počet nepřečtených přes drawRow kreslit do prvního sloupce
|
||||
// taky použít ten layout pro zobrazení zprávy
|
||||
// + NEWSPAPER view -> v currentChanged MessagesView se
|
||||
// vytáhnou všechny vybrané zprávy a pro každou se vygeneruje ten HTML templejt
|
||||
// - na tohle udelat metodu v WebBrowseru, neco
|
||||
// jako navigateToMessages(const QList<Message> &messages)
|
||||
|
||||
class FeedsModel;
|
||||
class FeedsProxyModel;
|
||||
class FeedsModelFeed;
|
||||
|
@ -103,6 +103,10 @@ QString SkinFactory::getCurrentMarkup() {
|
||||
return m_currentSkin.m_layoutMarkup;
|
||||
}
|
||||
|
||||
QString SkinFactory::getCurrentMarkupLayout() {
|
||||
return m_currentSkin.m_layoutMarkupWrapper;
|
||||
}
|
||||
|
||||
Skin SkinFactory::getSkinInfo(const QString &skin_name, bool *ok) {
|
||||
Skin skin;
|
||||
QString styles;
|
||||
@ -139,6 +143,10 @@ Skin SkinFactory::getSkinInfo(const QString &skin_name, bool *ok) {
|
||||
// Obtain version.
|
||||
skin.m_version = skin_node.attributes().namedItem("version").toAttr().value();
|
||||
|
||||
// Obtain layout markup wrapper.
|
||||
skin.m_layoutMarkupWrapper = skin_node.namedItem("markup_wrapper").toElement().text();
|
||||
skin.m_layoutMarkupWrapper = QByteArray::fromBase64(skin.m_layoutMarkupWrapper.toLocal8Bit());
|
||||
|
||||
// Obtain layout markup.
|
||||
skin.m_layoutMarkup = skin_node.namedItem("markup").toElement().text();
|
||||
skin.m_layoutMarkup = QByteArray::fromBase64(skin.m_layoutMarkup.toLocal8Bit());
|
||||
|
@ -15,6 +15,7 @@ struct Skin {
|
||||
QString m_email;
|
||||
QString m_version;
|
||||
QString m_rawData;
|
||||
QString m_layoutMarkupWrapper;
|
||||
QString m_layoutMarkup;
|
||||
};
|
||||
|
||||
@ -47,6 +48,7 @@ class SkinFactory : public QObject {
|
||||
|
||||
// Returns contents of current layout markup.
|
||||
QString getCurrentMarkup();
|
||||
QString getCurrentMarkupLayout();
|
||||
|
||||
// Returns the name of the skin, that should be activated
|
||||
// after application restart.
|
||||
|
@ -166,13 +166,18 @@ void WebBrowser::clear() {
|
||||
}
|
||||
|
||||
void WebBrowser::navigateToMessage(const Message &message) {
|
||||
m_webView->setHtml(SkinFactory::getInstance()->getCurrentMarkup().arg(message.m_title,
|
||||
tr("Written by ") + (message.m_author.isEmpty() ?
|
||||
tr("uknown author") :
|
||||
message.m_author),
|
||||
message.m_url,
|
||||
message.m_contents,
|
||||
message.m_created.toString(Qt::DefaultLocaleShortDate)));
|
||||
QString message_layout = SkinFactory::getInstance()->getCurrentMarkup().arg(message.m_title,
|
||||
tr("Written by ") + (message.m_author.isEmpty() ?
|
||||
tr("uknown author") :
|
||||
message.m_author),
|
||||
message.m_url,
|
||||
message.m_contents,
|
||||
message.m_created.toString(Qt::DefaultLocaleShortDate));
|
||||
|
||||
QString layout_wrapper = SkinFactory::getInstance()->getCurrentMarkupLayout().arg(tr("Newspaper view"),
|
||||
message_layout);
|
||||
|
||||
m_webView->setHtml(layout_wrapper);
|
||||
emit iconChanged(m_index,
|
||||
IconThemeFactory::getInstance()->fromTheme("mail-mark-read"));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user