[sailfish] added option for white background on icons, this is the default -- closes #65
This commit is contained in:
parent
3f3585d6f1
commit
e8532407d7
5 changed files with 34 additions and 0 deletions
|
|
@ -37,6 +37,12 @@ ListItem {
|
|||
}
|
||||
|
||||
visible: settings.displayIcons && model.icon != ''
|
||||
Rectangle {
|
||||
color: "white"
|
||||
anchors.fill: parent
|
||||
visible: settings.whiteBackgroundOnIcons && parent.status == Image.Ready
|
||||
z: parent.z - 1
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@ ListItem {
|
|||
source: feed.isCat ? model.icon : ''
|
||||
|
||||
visible: settings.displayIcons && model.icon != '' && feed.isCat && status == Image.Ready
|
||||
Rectangle {
|
||||
color: "white"
|
||||
anchors.fill: parent
|
||||
visible: settings.whiteBackgroundOnIcons && parent.status == Image.Ready
|
||||
z: parent.z - 1
|
||||
}
|
||||
}
|
||||
|
||||
Column {
|
||||
|
|
|
|||
|
|
@ -58,6 +58,11 @@ Page {
|
|||
checked: settings.displayIcons
|
||||
onCheckedChanged: settings.displayIcons = checked
|
||||
}
|
||||
TextSwitch {
|
||||
text: qsTr('Show a White Background on Icons')
|
||||
checked: settings.whiteBackgroundOnIcons
|
||||
onCheckedChanged: settings.whiteBackgroundOnIcons = checked
|
||||
}
|
||||
|
||||
TextSwitch {
|
||||
text: qsTr('Use All Feeds on Startup')
|
||||
|
|
|
|||
|
|
@ -126,6 +126,14 @@ void Settings::setUseAllFeedsOnStartup(bool useAllFeedsOnStartup) {
|
|||
}
|
||||
}
|
||||
|
||||
void Settings::setWhiteBackgroundOnIcons(bool whiteBackgroundOnIcons()) {
|
||||
if (_whiteBackgroundOnIcons != whiteBackgroundOnIcons) {
|
||||
_whiteBackgroundOnIcons = whiteBackgroundOnIcons;
|
||||
m_settings->setValue("whiteBackgroundOnIcons", _whiteBackgroundOnIcons);
|
||||
emit whiteBackgroundOnIconsChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Settings::Settings(QObject *parent) : QObject(parent), m_settings(new QSettings(this)) {
|
||||
_servername = m_settings->value("servername", "http://").toString();
|
||||
_username = m_settings->value("username", "").toString();
|
||||
|
|
@ -142,4 +150,5 @@ Settings::Settings(QObject *parent) : QObject(parent), m_settings(new QSettings(
|
|||
_webviewFontSize = m_settings->value("webviewFontSize", 22).toInt();
|
||||
_autoMarkRead = m_settings->value("autoMarkRead", true).toBool();
|
||||
_useAllFeedsOnStartup = m_settings->value("useAllFeedsOnStartup", false).toBool();
|
||||
_whiteBackgroundOnIcons = m_settings->value("whiteBackgroundOnIcons", true).toBool();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ class Settings : public QObject
|
|||
Q_PROPERTY(int webviewFontSize READ webviewFontSize WRITE setWebviewFontSize NOTIFY webviewFontSizeChanged)
|
||||
Q_PROPERTY(bool autoMarkRead READ autoMarkRead WRITE setAutoMarkRead NOTIFY autoMarkReadChanged)
|
||||
Q_PROPERTY(bool useAllFeedsOnStartup READ useAllFeedsOnStartup WRITE setUseAllFeedsOnStartup NOTIFY useAllFeedsOnStartupChanged)
|
||||
Q_PROPERTY(bool whiteBackgroundOnIcons READ whiteBackgroundOnIcons WRITE setWhiteBackgroundOnIcons NOTIFY whiteBackgroundOnIconsChanged)
|
||||
public:
|
||||
static Settings *instance();
|
||||
|
||||
|
|
@ -94,6 +95,11 @@ public:
|
|||
}
|
||||
void setUseAllFeedsOnStartup(bool useAllFeedsOnStartup);
|
||||
|
||||
bool whiteBackgroundOnIcons() const {
|
||||
return this->_whiteBackgroundOnIcons;
|
||||
}
|
||||
void setWhiteBackgroundOnIcons(bool whiteBackgroundOnIcons);
|
||||
|
||||
signals:
|
||||
void servernameChanged();
|
||||
void usernameChanged();
|
||||
|
|
@ -110,6 +116,7 @@ signals:
|
|||
void webviewFontSizeChanged();
|
||||
void autoMarkReadChanged();
|
||||
void useAllFeedsOnStartupChanged();
|
||||
void whiteBackgroundOnIconsChanged();
|
||||
|
||||
private:
|
||||
static QScopedPointer<Settings> m_instance;
|
||||
|
|
@ -134,5 +141,6 @@ private:
|
|||
int _webviewFontSize;
|
||||
bool _autoMarkRead;
|
||||
bool _useAllFeedsOnStartup;
|
||||
bool _whiteBackgroundOnIcons;
|
||||
};
|
||||
#endif // SETTINGS_HH
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue