added an option to not show feedicons

This commit is contained in:
Hauke Schade 2013-02-09 21:07:05 +01:00
parent 50e8ab7d3b
commit 678b0b0a24
6 changed files with 30 additions and 7 deletions

View file

@ -44,7 +44,7 @@ Item {
anchors.rightMargin: constant.listItemSpacing
source: model.icon
//visible: model.icon.length > 0
visible: settings.displayIcons
}
Label {
@ -52,7 +52,7 @@ Item {
text: model.title
anchors.right: unreadBubble.left
anchors.rightMargin: constant.listItemSpacing
anchors.left: icon.right
anchors.left: icon.visible ? icon.right : parent.left
anchors.leftMargin: constant.listItemSpacing
anchors.verticalCenter: parent.verticalCenter
font.weight: Font.Bold

View file

@ -88,7 +88,7 @@ Page {
subtitle: (feeds[feed].unread > 0 ? qsTr("Unread: %1").arg(feeds[feed].unread) : ""),
unreadcount: feeds[feed].unread,
feedId: feeds[feed].id,
icon: ttrss.getIconUrl(feeds[feed].id)
icon: settings.displayIcons ? ttrss.getIconUrl(feeds[feed].id) : ''
});
}
}

View file

@ -33,12 +33,13 @@ Page {
id: settingsColumn
anchors {
top: pageHeader.bottom
topMargin: constant.paddingMedium
topMargin: constant.paddingLarge
left: parent.left
leftMargin: constant.paddingLarge
right: parent.right
}
height: childrenRect.height
spacing: constant.paddingMedium
spacing: constant.paddingLarge
SettingsButtonRow {
text: qsTr("Theme")
@ -53,5 +54,12 @@ Page {
buttonsText: [qsTr("Newest First"), qsTr("Oldest First")]
onButtonClicked: settings.feeditemsOrder = index
}
CheckBox {
text: qsTr('Show Icons')
checked: settings.displayIcons
onClicked: settings.displayIcons = checked
anchors.margins: constant.paddingLarge
}
}
}

View file

@ -29,7 +29,6 @@ Item {
anchors {
left: parent.left
top: parent.top
leftMargin: constant.paddingMedium
}
font.pixelSize: constant.fontSizeMedium
text: root.text
@ -41,7 +40,6 @@ Item {
top: settingText.bottom
left: parent.left
right: parent.right
margins: constant.paddingMedium
}
checkedButton: buttonRepeater.itemAt(root.checkedButtonIndex)
onVisibleChanged: checkedButton = buttonRepeater.itemAt(root.checkedButtonIndex)

View file

@ -70,6 +70,14 @@ void Settings::setFeeditemsOrder(int feeditemsOrder) {
}
}
void Settings::setDisplayIcons(bool displayIcons) {
if (_displayIcons != displayIcons) {
_displayIcons = displayIcons;
m_settings->setValue("displayIcons", _displayIcons);
emit displayIconsChanged();
}
}
Settings::Settings(QObject *parent) : QObject(parent), m_settings(new QSettings(this)) {
_servername = m_settings->value("servername", "http://").toString();
_username = m_settings->value("username", "").toString();
@ -78,4 +86,5 @@ Settings::Settings(QObject *parent) : QObject(parent), m_settings(new QSettings(
_whiteTheme = m_settings->value("whiteTheme", true).toBool();
_feeditemsOrder = m_settings->value("feeditemsOrder", 0).toInt();
_displayIcons = m_settings->value("displayIcons", true).toBool();
}

View file

@ -18,6 +18,7 @@ class Settings : public QObject
Q_PROPERTY(bool whiteTheme READ isWhiteTheme WRITE setWhiteTheme NOTIFY whiteThemeChanged)
Q_PROPERTY(int feeditemsOrder READ feeditemsOrder WRITE setFeeditemsOrder NOTIFY feeditemsOrderChanged)
Q_PROPERTY(bool displayIcons READ displayIcons WRITE setDisplayIcons NOTIFY displayIconsChanged)
public:
static Settings *instance();
@ -55,6 +56,11 @@ public:
}
void setFeeditemsOrder(int feeditemsOrder);
bool displayIcons() const {
return this->_displayIcons;
}
void setDisplayIcons(bool displayIcons);
signals:
void servernameChanged();
void usernameChanged();
@ -63,6 +69,7 @@ signals:
void whiteThemeChanged();
void feeditemsOrderChanged();
void displayIconsChanged();
private:
static QScopedPointer<Settings> m_instance;
@ -79,5 +86,6 @@ private:
bool _whiteTheme;
int _feeditemsOrder;
bool _displayIcons;
};
#endif // SETTINGS_HH