diff options
| author | Mason Reed <mason@vector35.com> | 2025-07-16 21:53:33 -0400 |
|---|---|---|
| committer | Mason Reed <mason@vector35.com> | 2025-07-17 06:20:21 -0400 |
| commit | 750e6f6a5b6d2ce3aec636aca2eaef6def608c23 (patch) | |
| tree | a8fd6f00f5a16996c6e9648f95d7f786b9f9bfc1 /plugins | |
| parent | 7aa57d92318eb39cac7b7efa3eb35577fc007313 (diff) | |
[WARP] Make the sidebar highlights not blinding
It is apparently "too bright" and I need to get "my eyes checked"
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/warp/ui/shared/constraint.cpp | 18 | ||||
| -rw-r--r-- | plugins/warp/ui/shared/function.cpp | 7 |
2 files changed, 21 insertions, 4 deletions
diff --git a/plugins/warp/ui/shared/constraint.cpp b/plugins/warp/ui/shared/constraint.cpp index 1d369bcd..47bf2b33 100644 --- a/plugins/warp/ui/shared/constraint.cpp +++ b/plugins/warp/ui/shared/constraint.cpp @@ -3,6 +3,8 @@ #include <QGridLayout> #include <QHeaderView> +#include "theme.h" + WarpConstraintItem::WarpConstraintItem(const Warp::Constraint &constraint) : m_constraint(constraint) { QString guidStr = QString::fromStdString(constraint.guid.ToString()); @@ -39,11 +41,16 @@ QVariant WarpConstraintItemModel::data(const QModelIndex &index, int role) const { auto itemConstraint = item->GetConstraint(); // TODO: We really should store the guid in a hashmap or something instead of looping over it for every item. - // TODO: A less intense green? // TODO: Take into account the constraint offset. for (const auto &constraint: m_matchedConstraints) - if (constraint.guid == itemConstraint.guid) - return QBrush(Qt::green); + { + if (constraint.offset == itemConstraint.offset) + { + static QColor matchedColor = getThemeColor(GreenStandardHighlightColor); + matchedColor.setAlpha(128); + return matchedColor; + } + } } } @@ -83,6 +90,11 @@ WarpConstraintTableWidget::WarpConstraintTableWidget(QWidget *parent) m_table->horizontalHeader()->hide(); // Decrease row height to make it look nice. m_table->verticalHeader()->setDefaultSectionSize(30); + + // Make the highlight less bright. + QPalette palette = m_table->palette(); + palette.setColor(QPalette::Highlight, getThemeColor(SelectionColor)); + m_table->setPalette(palette); } void WarpConstraintTableWidget::SetConstraints(QVector<WarpConstraintItem *> constraints) diff --git a/plugins/warp/ui/shared/function.cpp b/plugins/warp/ui/shared/function.cpp index 2202fb4e..88d27cd1 100644 --- a/plugins/warp/ui/shared/function.cpp +++ b/plugins/warp/ui/shared/function.cpp @@ -120,7 +120,7 @@ QVariant WarpFunctionItemModel::data(const QModelIndex &index, int role) const if (BNWARPFunctionsEqual(itemFunction->GetFunction()->m_object, m_matchedFunction->m_object)) { // TODO: Better color? - QColor matchedColor = getThemeColor(BlueStandardHighlightColor); + static QColor matchedColor = getThemeColor(BlueStandardHighlightColor); matchedColor.setAlpha(128); return matchedColor; } @@ -202,6 +202,11 @@ WarpFunctionTableWidget::WarpFunctionTableWidget(QWidget *parent) : QWidget(pare // Decrease row height to make it look nice. m_table->verticalHeader()->setDefaultSectionSize(30); + // Make the highlight less bright. + QPalette palette = m_table->palette(); + palette.setColor(QPalette::Highlight, getThemeColor(SelectionColor)); + m_table->setPalette(palette); + TokenDataDelegate *tokenDelegate = new TokenDataDelegate(this); // NOTE: Column 0 is assumed to be the function with the token data. m_table->setItemDelegateForColumn(0, tokenDelegate); |
