mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-19 05:57:09 +00:00
Use the palette's lightness for highlighting matching input binds
This commit is contained in:
@@ -2118,7 +2118,8 @@ void D3D11PipelineStateViewer::highlightIABind(int slot)
|
||||
|
||||
const D3D11Pipe::IA &IA = m_Ctx.CurD3D11PipelineState().m_IA;
|
||||
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f);
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f,
|
||||
qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95));
|
||||
|
||||
ui->iaLayouts->beginUpdate();
|
||||
ui->iaBuffers->beginUpdate();
|
||||
@@ -2128,7 +2129,7 @@ void D3D11PipelineStateViewer::highlightIABind(int slot)
|
||||
RDTreeWidgetItem *item = m_VBNodes[(int)slot];
|
||||
|
||||
item->setBackgroundColor(col);
|
||||
item->setForegroundColor(QColor(0, 0, 0));
|
||||
item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
|
||||
for(int i = 0; i < ui->iaLayouts->topLevelItemCount(); i++)
|
||||
@@ -2143,7 +2144,7 @@ void D3D11PipelineStateViewer::highlightIABind(int slot)
|
||||
else
|
||||
{
|
||||
item->setBackgroundColor(col);
|
||||
item->setForegroundColor(QColor(0, 0, 0));
|
||||
item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2020,7 +2020,8 @@ void D3D12PipelineStateViewer::highlightIABind(int slot)
|
||||
|
||||
const D3D12Pipe::IA &IA = m_Ctx.CurD3D12PipelineState().m_IA;
|
||||
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f);
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f,
|
||||
qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95));
|
||||
|
||||
ui->iaLayouts->beginUpdate();
|
||||
ui->iaBuffers->beginUpdate();
|
||||
@@ -2028,7 +2029,7 @@ void D3D12PipelineStateViewer::highlightIABind(int slot)
|
||||
if(slot < m_VBNodes.count())
|
||||
{
|
||||
m_VBNodes[slot]->setBackgroundColor(col);
|
||||
m_VBNodes[slot]->setForegroundColor(QColor(0, 0, 0));
|
||||
m_VBNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
|
||||
for(int i = 0; i < ui->iaLayouts->topLevelItemCount(); i++)
|
||||
@@ -2043,7 +2044,7 @@ void D3D12PipelineStateViewer::highlightIABind(int slot)
|
||||
else
|
||||
{
|
||||
item->setBackgroundColor(col);
|
||||
item->setForegroundColor(QColor(0, 0, 0));
|
||||
item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2149,7 +2149,8 @@ void GLPipelineStateViewer::highlightIABind(int slot)
|
||||
|
||||
const GLPipe::VertexInput &VI = m_Ctx.CurGLPipelineState().m_VtxIn;
|
||||
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f);
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f,
|
||||
qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95));
|
||||
|
||||
ui->viAttrs->beginUpdate();
|
||||
ui->viBuffers->beginUpdate();
|
||||
@@ -2157,7 +2158,7 @@ void GLPipelineStateViewer::highlightIABind(int slot)
|
||||
if(slot < m_VBNodes.count())
|
||||
{
|
||||
m_VBNodes[slot]->setBackgroundColor(col);
|
||||
m_VBNodes[slot]->setForegroundColor(QColor(0, 0, 0));
|
||||
m_VBNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
|
||||
for(int i = 0; i < ui->viAttrs->topLevelItemCount(); i++)
|
||||
@@ -2172,7 +2173,7 @@ void GLPipelineStateViewer::highlightIABind(int slot)
|
||||
else
|
||||
{
|
||||
item->setBackgroundColor(col);
|
||||
item->setForegroundColor(QColor(0, 0, 0));
|
||||
item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2163,7 +2163,8 @@ void VulkanPipelineStateViewer::highlightIABind(int slot)
|
||||
|
||||
const VKPipe::VertexInput &VI = m_Ctx.CurVulkanPipelineState().VI;
|
||||
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f, 0.95f);
|
||||
QColor col = QColor::fromHslF(float(idx) / 32.0f, 1.0f,
|
||||
qBound(0.05, palette().color(QPalette::Base).lightnessF(), 0.95));
|
||||
|
||||
ui->viAttrs->beginUpdate();
|
||||
ui->viBuffers->beginUpdate();
|
||||
@@ -2171,13 +2172,13 @@ void VulkanPipelineStateViewer::highlightIABind(int slot)
|
||||
if(slot < m_VBNodes.count())
|
||||
{
|
||||
m_VBNodes[slot]->setBackgroundColor(col);
|
||||
m_VBNodes[slot]->setForegroundColor(QColor(0, 0, 0));
|
||||
m_VBNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
|
||||
if(slot < m_BindNodes.count())
|
||||
{
|
||||
m_BindNodes[slot]->setBackgroundColor(col);
|
||||
m_BindNodes[slot]->setForegroundColor(QColor(0, 0, 0));
|
||||
m_BindNodes[slot]->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
|
||||
for(int i = 0; i < ui->viAttrs->topLevelItemCount(); i++)
|
||||
@@ -2192,7 +2193,7 @@ void VulkanPipelineStateViewer::highlightIABind(int slot)
|
||||
else
|
||||
{
|
||||
item->setBackgroundColor(col);
|
||||
item->setForegroundColor(QColor(0, 0, 0));
|
||||
item->setForegroundColor(contrastingColor(col, QColor(0, 0, 0)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user