mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-13 05:20:45 +00:00
Fix a lot of high-contrast inconsistencies or brokenness. Refs #315
* In a couple of places I had to resort to if(IsHighContrast) but mostly this is just using system brushes consistently or not assuming black text. * The default DockPanel theme doesn't work well, so make a minimal high- contrast theme for it and assign it everywhere. * The pipeline flow was using fixed colours, use system brushes for the different elements and switch based on high-contrast to ensure active and inactive stages are visible (using ActiveCaption looks bad on normal themes because it's a big block of colour). * For some reason the flat toolstrip renderer doesn't handle white-on- black themes, but the system one does. It's a little clunkier but it shows up correctly without writing tons of custom painting code. * Range histogram uses a properly contrasting colour for the border. * Treelist views use a better system colour for selected rows when inactive and hovered rows (when high contrast). * Mesh view grids have a system background instead of white * Various things (pipeline state, mesh viewe) set text colour when colourising backgrounds of things instead of assuming black.
This commit is contained in:
@@ -256,7 +256,7 @@ namespace renderdocui.Controls
|
||||
|
||||
float arrowY = TotalAreaRect.Y + TotalAreaRect.Height / 2;
|
||||
|
||||
using (var pen = new Pen(Brushes.Black, BoxBorderWidth))
|
||||
using (var pen = new Pen(SystemBrushes.WindowFrame, BoxBorderWidth))
|
||||
using (var selectedpen = new Pen(Brushes.Red, BoxBorderWidth))
|
||||
{
|
||||
for (int i = 0; i < NumGaps; i++)
|
||||
@@ -267,26 +267,33 @@ namespace renderdocui.Controls
|
||||
float right = TotalAreaRect.X + (i + 1) * (BoxSize.Width + BoxMargin);
|
||||
float left = right - BoxMargin;
|
||||
|
||||
DrawArrow(dc, Brushes.Black, pen, ArrowHeadSize, arrowY, left, right);
|
||||
DrawArrow(dc, SystemBrushes.WindowFrame, pen, ArrowHeadSize, arrowY, left, right);
|
||||
}
|
||||
|
||||
for (int i = 0; i < NumItems; i++)
|
||||
{
|
||||
RectangleF boxrect = GetBoxRect(i);
|
||||
|
||||
var backBrush = Brushes.Gainsboro;
|
||||
var textBrush = Brushes.Black;
|
||||
var backBrush = SystemBrushes.Window;
|
||||
var textBrush = SystemBrushes.WindowText;
|
||||
var outlinePen = pen;
|
||||
|
||||
if (SystemInformation.HighContrast)
|
||||
{
|
||||
backBrush = SystemBrushes.ActiveCaption;
|
||||
textBrush = SystemBrushes.ActiveCaptionText;
|
||||
}
|
||||
|
||||
if (!IsStageEnabled(i))
|
||||
{
|
||||
backBrush = Brushes.DarkGray;
|
||||
//textBrush = Brushes.Gainsboro;
|
||||
backBrush = SystemBrushes.InactiveCaption;
|
||||
textBrush = SystemBrushes.InactiveCaptionText;
|
||||
}
|
||||
|
||||
if (i == m_HoverStage)
|
||||
{
|
||||
backBrush = Brushes.LightYellow;
|
||||
backBrush = SystemBrushes.Info;
|
||||
textBrush = SystemBrushes.InfoText;
|
||||
}
|
||||
|
||||
if (i == SelectedStage)
|
||||
|
||||
@@ -416,7 +416,7 @@ namespace renderdocui.Controls
|
||||
|
||||
rect.Inflate(-m_Margin, -m_Margin);
|
||||
|
||||
e.Graphics.FillRectangle(Brushes.Black, rect);
|
||||
e.Graphics.FillRectangle(SystemBrushes.ControlText, rect);
|
||||
|
||||
rect.Inflate(-m_Border, -m_Border);
|
||||
|
||||
|
||||
+4
-4
@@ -59,9 +59,9 @@
|
||||
this.slotLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.slotLabel.AutoSize = true;
|
||||
this.slotLabel.BackColor = System.Drawing.SystemColors.InactiveCaption;
|
||||
this.slotLabel.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.slotLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.slotLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
this.slotLabel.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.slotLabel.Location = new System.Drawing.Point(0, 60);
|
||||
this.slotLabel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.slotLabel.Name = "slotLabel";
|
||||
@@ -77,8 +77,8 @@
|
||||
this.descriptionLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.descriptionLabel.AutoEllipsis = true;
|
||||
this.descriptionLabel.BackColor = System.Drawing.SystemColors.InactiveCaption;
|
||||
this.descriptionLabel.ForeColor = System.Drawing.SystemColors.ActiveCaptionText;
|
||||
this.descriptionLabel.BackColor = System.Drawing.SystemColors.ButtonShadow;
|
||||
this.descriptionLabel.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
this.descriptionLabel.Location = new System.Drawing.Point(19, 60);
|
||||
this.descriptionLabel.Margin = new System.Windows.Forms.Padding(0);
|
||||
this.descriptionLabel.Name = "descriptionLabel";
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace TreelistView
|
||||
|
||||
if (m_owner.NodesSelection.Contains(node) || m_owner.FocusedNode == node)
|
||||
{
|
||||
Color col = m_owner.Focused ? SystemColors.Highlight : SystemColors.ControlLight;
|
||||
Color col = m_owner.Focused ? SystemColors.Highlight : SystemColors.Control;
|
||||
|
||||
if (!Application.RenderWithVisualStyles)
|
||||
{
|
||||
@@ -161,6 +161,11 @@ namespace TreelistView
|
||||
{
|
||||
Color col = SystemColors.ControlLight;
|
||||
|
||||
if (SystemInformation.HighContrast)
|
||||
{
|
||||
col = SystemColors.ButtonHighlight;
|
||||
}
|
||||
|
||||
if (!Application.RenderWithVisualStyles)
|
||||
{
|
||||
// have to fill the solid background only before the node is painted
|
||||
|
||||
Reference in New Issue
Block a user