Dark mode support
Centralized all colors, tweaked application paletter in darkmode to make it darker.
This commit is contained in:
parent
aac55b0ed1
commit
86a9a0d709
19 changed files with 335 additions and 73 deletions
|
|
@ -30,6 +30,13 @@ namespace {
|
|||
|
||||
}
|
||||
|
||||
ColumnTableModel::ColumnTableModel(QObject *parent)
|
||||
: BaseTableModel(parent)
|
||||
, theme(GetColorTheme())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void ColumnTableModel::setData(std::shared_ptr<const PgDatabaseCatalog> cat, const std::optional<PgClass> &table)
|
||||
{
|
||||
if (cat != m_catalog) {
|
||||
|
|
@ -285,22 +292,19 @@ QVariant ColumnTableModel::data(const QModelIndex &index, int role) const
|
|||
QVariant v;
|
||||
const auto &t = m_columns[index.row()];
|
||||
if (t.typid == InvalidOid)
|
||||
v = QBrush(Qt::black);
|
||||
v = QBrush(theme.defaultTextColor);
|
||||
else {
|
||||
auto c = m_catalog->types()->getByKey(t.typid);
|
||||
switch (c->category) {
|
||||
case TypCategory::Boolean:
|
||||
v = QBrush(Qt::darkGreen);
|
||||
break;
|
||||
case TypCategory::Numeric:
|
||||
v = QBrush(Qt::darkBlue);
|
||||
v = QBrush(theme.numericTypeColor);
|
||||
break;
|
||||
case TypCategory::DateTime:
|
||||
case TypCategory::Timespan:
|
||||
v = QBrush(Qt::darkMagenta);
|
||||
v = QBrush(theme.dateTimeTypeColor);
|
||||
break;
|
||||
case TypCategory::String:
|
||||
v = QBrush(Qt::darkYellow);
|
||||
v = QBrush(theme.stringTypeColor);
|
||||
break;
|
||||
case TypCategory::Array:
|
||||
case TypCategory::Composite:
|
||||
|
|
@ -313,7 +317,8 @@ QVariant ColumnTableModel::data(const QModelIndex &index, int role) const
|
|||
case TypCategory::BitString:
|
||||
case TypCategory::Unknown:
|
||||
default:
|
||||
v = QBrush(Qt::black);
|
||||
v = QBrush(theme.defaultTextColor);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return v;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue