unread article dot color is now taken from custom color palette
This commit is contained in:
parent
4d74a6f4f0
commit
c68e545ea4
3 changed files with 13 additions and 6 deletions
|
@ -24,6 +24,8 @@
|
||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
#include <QSqlField>
|
#include <QSqlField>
|
||||||
|
|
||||||
|
#define RAD_COLOR 0, 180, 0
|
||||||
|
|
||||||
MessagesModel::MessagesModel(QObject* parent)
|
MessagesModel::MessagesModel(QObject* parent)
|
||||||
: QSqlQueryModel(parent), m_view(nullptr), m_cache(new MessagesModelCache(this)),
|
: QSqlQueryModel(parent), m_view(nullptr), m_cache(new MessagesModelCache(this)),
|
||||||
m_messageHighlighter(MessageHighlighter::NoHighlighting), m_customDateFormat(QString()),
|
m_messageHighlighter(MessageHighlighter::NoHighlighting), m_customDateFormat(QString()),
|
||||||
|
@ -43,8 +45,6 @@ MessagesModel::~MessagesModel() {
|
||||||
qDebugNN << LOGSEC_MESSAGEMODEL << "Destroying MessagesModel instance.";
|
qDebugNN << LOGSEC_MESSAGEMODEL << "Destroying MessagesModel instance.";
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RAD_COLOR 0, 180, 0
|
|
||||||
|
|
||||||
void MessagesModel::setupIcons() {
|
void MessagesModel::setupIcons() {
|
||||||
m_favoriteIcon = qApp->icons()->fromTheme(QSL("mail-mark-important"));
|
m_favoriteIcon = qApp->icons()->fromTheme(QSL("mail-mark-important"));
|
||||||
m_readIcon = qApp->icons()->fromTheme(QSL("mail-mark-read"));
|
m_readIcon = qApp->icons()->fromTheme(QSL("mail-mark-read"));
|
||||||
|
@ -94,10 +94,16 @@ QIcon MessagesModel::generateUnreadIcon() {
|
||||||
QPointF center(64, 64);
|
QPointF center(64, 64);
|
||||||
qreal radius = 32;
|
qreal radius = 32;
|
||||||
|
|
||||||
|
QColor custom_clr = qApp->skins()->colorForModel(SkinEnums::PaletteColors::FgNewMessages).value<QColor>();
|
||||||
|
|
||||||
|
if (!custom_clr.isValid()) {
|
||||||
|
custom_clr = QColor(RAD_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
QRadialGradient grad(center, radius);
|
QRadialGradient grad(center, radius);
|
||||||
grad.setColorAt(0.000, QColor(RAD_COLOR, 255));
|
grad.setColorAt(0.0, QColor(custom_clr.red(), custom_clr.green(), custom_clr.blue(), 255));
|
||||||
grad.setColorAt(0.8, QColor(RAD_COLOR, 0.8 * 255));
|
grad.setColorAt(0.8, QColor(custom_clr.red(), custom_clr.green(), custom_clr.blue(), 0.8 * 255));
|
||||||
grad.setColorAt(1.000, QColor(RAD_COLOR, 0.000));
|
grad.setColorAt(1.0, QColor(custom_clr.red(), custom_clr.green(), custom_clr.blue(), 0.0));
|
||||||
|
|
||||||
QPen pen;
|
QPen pen;
|
||||||
pen.setWidth(96);
|
pen.setWidth(96);
|
||||||
|
|
|
@ -58,6 +58,7 @@ class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer {
|
||||||
RootItem* loadedItem() const;
|
RootItem* loadedItem() const;
|
||||||
MessagesModelCache* cache() const;
|
MessagesModelCache* cache() const;
|
||||||
|
|
||||||
|
void setupIcons();
|
||||||
void setupFonts();
|
void setupFonts();
|
||||||
void updateDateFormat();
|
void updateDateFormat();
|
||||||
void updateFeedIconsDisplay();
|
void updateFeedIconsDisplay();
|
||||||
|
@ -97,7 +98,6 @@ class MessagesModel : public QSqlQueryModel, public MessagesModelSqlLayer {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void setupHeaderData();
|
void setupHeaderData();
|
||||||
void setupIcons();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MessagesView* m_view;
|
MessagesView* m_view;
|
||||||
|
|
|
@ -467,6 +467,7 @@ void SettingsGui::saveSettings() {
|
||||||
qApp->mainForm()->tabWidget()->feedMessageViewer()->refreshVisualProperties();
|
qApp->mainForm()->tabWidget()->feedMessageViewer()->refreshVisualProperties();
|
||||||
|
|
||||||
qApp->feedReader()->feedsModel()->reloadWholeLayout();
|
qApp->feedReader()->feedsModel()->reloadWholeLayout();
|
||||||
|
qApp->feedReader()->messagesModel()->setupIcons();
|
||||||
qApp->feedReader()->messagesModel()->reloadWholeLayout();
|
qApp->feedReader()->messagesModel()->reloadWholeLayout();
|
||||||
|
|
||||||
onEndSaveSettings();
|
onEndSaveSettings();
|
||||||
|
|
Loading…
Add table
Reference in a new issue