add plain skin as reference for docs

¨
This commit is contained in:
Martin Rotter 2022-01-20 07:26:04 +01:00
parent 01b0332a30
commit f60f3faa4e
11 changed files with 130 additions and 4 deletions

View File

@ -26,7 +26,7 @@
<url type="donation">https://github.com/sponsors/martinrotter</url>
<content_rating type="oars-1.1" />
<releases>
<release version="4.1.2" date="2022-01-19"/>
<release version="4.1.2" date="2022-01-20"/>
</releases>
<content_rating type="oars-1.0">
<content_attribute id="violence-cartoon">none</content_attribute>

View File

@ -473,13 +473,13 @@ Note that unassigning a message labels is also synchronized at regular intervals
Also, [message filters](#fltr) can assign or remove labels to/from messages.
### Skins <a id="skin"></a>
RSS Guard is a skin-able application. Its GUI can be almost completely styled with [stylesheets](https://doc.qt.io/qt-5/stylesheet.html).
RSS Guard is a skinable application. Its GUI can be almost completely styled with [Qt stylesheets](https://doc.qt.io/qt-5/stylesheet.html).
<img alt="alt-img" src="images/gui-dark.png" width="600px">
You can select style and skin in settings category `User interface`.
RSS Guard encapsulates styling capabilities via *skins* feature. Each skin is placed in its own folder and must contain several [files](https://github.com/martinrotter/rssguard/tree/master/resources/skins/vergilius). There are some [built-in](https://github.com/martinrotter/rssguard/tree/master/resources/skins) skins, but you can place your custom skins in your [user data folder](#userd). You can find exact path to your user data folder in `About` dialog. Note that there must be subfolder `skins`. Create it if it does not exist and place your custom skins inside.
RSS Guard encapsulates styling capabilities via *skins* feature. Each skin is placed in its own folder and must contain several [files](https://github.com/martinrotter/rssguard/tree/master/resources/skins/plain). There are some [built-in](https://github.com/martinrotter/rssguard/tree/master/resources/skins) skins, but you can place your custom skins in your [user data folder](#userd). You can find exact path to your user data folder in `About` dialog. Note that there must be subfolder `skins`. Create it if it does not exist and place your custom skins inside.
The base for your custom skin may serve an empty ["plain" skin](https://github.com/martinrotter/rssguard/tree/master/resources/skins/plain). Look the [README file](https://github.com/martinrotter/rssguard/tree/master/resources/skins/plain/README) there, for some commentaries to it.

37
resources/skins/plain/README Executable file
View File

@ -0,0 +1,37 @@
%1, %2, ..., %N placeholders are used through all files and are replaced
with various article's properties in run-time when needed.
Here is overview of all placeholders used throughtout the skin:
Common placeholders:
%data% - is replaced by current absolute path to user data folder.
html_wrapper.html:
%style% - Skin-wide CSS, will be replaced by custom CSS if skin provides it in file "html_style.css".
%1 - Title of the article.
%2 - Body of the preview which is composed from:
- single html_single_message.html (single article preview),
- multiple html_single_message.html (newspaper mode).
html_single_message.html:
%1 - Title of the article.
%2 - "Written by" text.
%3 - URL of the article.
%4 - Body of the article.
%5 - Date/time of the article.
%6 - Attachments (composed from html_enclosure_every.html).
%7 - Attached pictures (composed from html_enclosure_image.html).
%8 - Database ID of the message.
html_adblocked.html:
%1 - Title of the page. This page is used when the website is entirely blocked by AdBlock.
%2 - Description of what and why was blocked.
html_enclosure_every.html:
%1 - URL of the attached media file.
%2 - Attachment symbol.
%3 - MIME type of the attachment.
html_enclosure_image.html:
%1 - URL of the attached picture file.
%2 - MIME type of the picture.
%3 - height of the picture thumbnail to be displayed which is loaded from application settings.

View File

@ -0,0 +1,4 @@
<div>
<h4>%1</h4>
<div>%2</div>
</div>

View File

@ -0,0 +1 @@
<a href="%1">%2<span style="text-transform: uppercase;">%3</span></a>

View File

@ -0,0 +1 @@
<a href="%1"><img src="%1" alt="%2" style="height: %3px;" /></a>

View File

@ -0,0 +1,8 @@
<div dir="auto">
<h5>%1 <a href="%3">🔗URL</a> %6</h5>
<div>
<div style="text-align: center;">%2, %5</div>
<div>%7</div>
%4
</div>
</div>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Place your custom skin-wide CSS styles here. -->
<style>
</style>
<!-- This resets key font sizes, so that font size can be changed in RSS Guard. -->
<style>
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
font-size: 100%;
font: inherit;
}
html {
height: 100%;
}
body {
height: 100%;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>%1</title>
</head>
<body>
%2
</body>
</html>

View File

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<skin version="0.666">
<author>
<name>Martin Rotter</name>
</author>
<palette>
<!--
Keys are defined in file
"https://github.com/martinrotter/rssguard/blob/master/src/librssguard/miscellaneous/skinfactory.h"
Specifically, they are taken from enumeration "PaletteColors".
-->
<color key="FgInteresting">#3A4EE4</color>
<color key="FgSelectedInteresting">#ff66cc</color>
<color key="FgError">#4EE43A</color>
<color key="FgSelectedError">#ff99ff</color>
<color key="Allright">#00ff99</color>
</palette>
</skin>

View File

@ -0,0 +1,13 @@
/* Qt stylesheet. */
QTextEdit {
selection-background-color: #4861f0;
}
QStatusBar::item {
border: none;
}
QSplitter::handle {
background: rgba(117, 117, 117, 0.5);
}

View File

@ -271,7 +271,8 @@ Skin SkinFactory::skinInfo(const QString& skin_name, bool* ok) const {
skin.m_adblocked = loadSkinFile(skin_folder_no_sep, QSL("html_adblocked.html"), base_skin_folder);
if (ok != nullptr) {
*ok = !skin.m_author.isEmpty() && !skin.m_version.isEmpty() &&
*ok = !skin.m_author.isEmpty() &&
!skin.m_version.isEmpty() &&
!skin.m_baseName.isEmpty() &&
!skin.m_layoutMarkup.isEmpty();
}