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:
baldurk
2016-08-05 12:46:56 +02:00
parent 12e0c301af
commit 610b22f600
25 changed files with 265 additions and 122 deletions
+22
View File
@@ -28,6 +28,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
@@ -69,6 +70,27 @@ namespace renderdocui.Code
return w;
}
static public DockPanelSkin MakeHighContrastDockPanelSkin()
{
DockPanelSkin ret = new DockPanelSkin();
ret.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.StartColor = SystemColors.ActiveCaption;
ret.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.EndColor = SystemColors.ActiveCaption;
ret.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor = SystemColors.ActiveCaptionText;
ret.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.StartColor = SystemColors.InactiveCaption;
ret.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.EndColor = SystemColors.InactiveCaption;
ret.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor = SystemColors.InactiveCaptionText;
ret.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient = ret.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient;
ret.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient = ret.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient;
ret.DockPaneStripSkin.DocumentGradient.ActiveTabGradient = ret.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient;
ret.DockPaneStripSkin.DocumentGradient.InactiveTabGradient = ret.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient;
return ret;
}
public static T Clamp<T>(this T val, T min, T max) where T : IComparable<T>
{
if (val.CompareTo(min) < 0) return min;