Some changes...

This commit is contained in:
Martin Rotter 2014-03-22 18:29:01 +01:00
parent 4139243b0c
commit 17b9e67200
9 changed files with 34 additions and 17 deletions

View File

@ -4,10 +4,12 @@
Fixed:
<ul>
<li>Informative buttons now do not accept focus.</li>
<li>Button for resetting keyboard shortcut now works.</li>
</ul>
Added:
<ul>
<li>"Defragment database" button shortcut is now changeable.</li>
<li>Added option to clear keyboard shortcuts.</li>
<li>Added "progress bar" to web browser.</li>
<li>Added blue color to feeds/categories which contain unread msgs.</li>

View File

@ -25,6 +25,7 @@
FeedsModelRootItem::FeedsModelRootItem(FeedsModelRootItem *parent_item)
: m_kind(FeedsModelRootItem::RootItem),
m_parentItem(parent_item) {
setupFonts();
}
FeedsModelRootItem::~FeedsModelRootItem() {
@ -33,7 +34,11 @@ FeedsModelRootItem::~FeedsModelRootItem() {
qDeleteAll(m_childItems);
}
void FeedsModelRootItem::setupFonts() {
m_normalFont = QtSingleApplication::font("FeedsView");
m_boldFont = m_normalFont;
m_boldFont.setBold(true);
}
int FeedsModelRootItem::row() const {
if (m_parentItem) {

View File

@ -21,6 +21,7 @@
#include <QIcon>
#include <QDateTime>
#include <QFont>
// Represents ROOT item of FeedsModel.
@ -91,7 +92,7 @@ class FeedsModelRootItem {
// Checks whether THIS object is child (direct or indirect)
// of the given root.
bool isChildOf(FeedsModelRootItem *root) {
bool isChildOf(FeedsModelRootItem *root) {
FeedsModelRootItem *this_item = this;
while (this_item->kind() != FeedsModelRootItem::RootItem) {
@ -169,6 +170,8 @@ class FeedsModelRootItem {
static bool lessThan(FeedsModelRootItem *lhs, FeedsModelRootItem *rhs);
protected:
void setupFonts();
Kind m_kind;
int m_id;
QString m_title;
@ -176,6 +179,9 @@ class FeedsModelRootItem {
QIcon m_icon;
QDateTime m_creationDate;
QFont m_normalFont;
QFont m_boldFont;
QList<FeedsModelRootItem*> m_childItems;
FeedsModelRootItem *m_parentItem;
};

View File

@ -68,8 +68,8 @@ QVariant FeedsModelStandardCategory::data(int column, int role) const {
return QVariant();
}
case Qt::ForegroundRole:
return countOfUnreadMessages() > 0 ? QColor(0, 64, 255) : QVariant();
case Qt::FontRole:
return countOfUnreadMessages() > 0 ? m_boldFont : m_normalFont;
case Qt::DisplayRole:
if (column == FDS_MODEL_TITLE_INDEX) {

View File

@ -274,8 +274,8 @@ QVariant FeedsModelStandardFeed::data(int column, int role) const {
return QVariant();
}
case Qt::ForegroundRole:
return countOfUnreadMessages() > 0 ? QColor(0, 64, 255) : QVariant();
case Qt::FontRole:
return countOfUnreadMessages() > 0 ? m_boldFont : m_normalFont;
default:
return QVariant();

View File

@ -65,7 +65,7 @@ void DynamicShortcutsWidget::updateShortcuts() {
}
}
void DynamicShortcutsWidget::populate(const QList<QAction *> actions) {
void DynamicShortcutsWidget::populate(const QList<QAction*> actions) {
m_actionBindings.clear();
int row_id = 0;
@ -73,7 +73,7 @@ void DynamicShortcutsWidget::populate(const QList<QAction *> actions) {
foreach (QAction *action, actions) {
// Create shortcut catcher for this action and set default shortcut.
ShortcutCatcher *catcher = new ShortcutCatcher(this);
catcher->setShortcut(action->shortcut());
catcher->setDefaultShortcut(action->shortcut());
// Store information for re-initialization of shortcuts
// of actions when widget gets "confirmed".

View File

@ -120,7 +120,8 @@ QList<QAction*> FormMain::allActions() {
m_ui->m_actionSelectNextFeedCategory <<
m_ui->m_actionSelectPreviousFeedCategory <<
m_ui->m_actionSelectNextMessage <<
m_ui->m_actionSelectPreviousMessage;
m_ui->m_actionSelectPreviousMessage <<
m_ui->m_actionDefragmentDatabase;
return actions;
}

View File

@ -133,5 +133,3 @@ void ShortcutCatcher::updateDisplayShortcut() {
m_btnChange->setText(str);
}

View File

@ -54,14 +54,15 @@ class ShortcutCatcher : public QWidget {
return m_currentSequence;
}
inline void setShortcut(const QKeySequence &key) {
m_currentSequence = m_defaultSequence = key;
doneRecording();
inline void setDefaultShortcut(const QKeySequence &key) {
m_defaultSequence = key;
setShortcut(key);
}
protected slots:
void startRecording();
void doneRecording();
inline void setShortcut(const QKeySequence &key) {
m_currentSequence = key;
doneRecording();
}
public slots:
inline void resetShortcut() {
@ -72,6 +73,10 @@ class ShortcutCatcher : public QWidget {
setShortcut(QKeySequence());
}
protected slots:
void startRecording();
void doneRecording();
signals:
void shortcutChanged(const QKeySequence &seguence);