summaryrefslogtreecommitdiff
path: root/plugins/warp/ui/shared/constraint.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-07-16 21:53:33 -0400
committerMason Reed <mason@vector35.com>2025-07-17 06:20:21 -0400
commit750e6f6a5b6d2ce3aec636aca2eaef6def608c23 (patch)
treea8fd6f00f5a16996c6e9648f95d7f786b9f9bfc1 /plugins/warp/ui/shared/constraint.cpp
parent7aa57d92318eb39cac7b7efa3eb35577fc007313 (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/warp/ui/shared/constraint.cpp')
-rw-r--r--plugins/warp/ui/shared/constraint.cpp18
1 files changed, 15 insertions, 3 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)