Fix error background color for URLs

This commit is contained in:
Jonathan White
2020-07-19 09:59:40 -04:00
parent a88fe61a7b
commit c511cb518c
3 changed files with 7 additions and 6 deletions

View File

@@ -21,6 +21,7 @@
#include "core/Entry.h"
#include "core/Resources.h"
#include "core/Tools.h"
#include "gui/styles/StateColorPalette.h"
#include <algorithm>
@@ -70,7 +71,8 @@ QVariant EntryURLModel::data(const QModelIndex& index, int role) const
const auto urlValid = Tools::checkUrlValid(value);
if (role == Qt::BackgroundRole && !urlValid) {
return QColor(255, 125, 125);
StateColorPalette statePalette;
return statePalette.color(StateColorPalette::ColorRole::Error);
} else if (role == Qt::DecorationRole && !urlValid) {
return m_errorIcon;
} else if (role == Qt::DisplayRole || role == Qt::EditRole) {