Skip to content

Commit

Permalink
Add support for dark theme in system graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
belkiss committed Jul 4, 2024
1 parent c4ac425 commit 30c812f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,8 @@ public void UpdateTheme()
_timeBar.UpdateTheme(Theme);
_localHost?.UpdateTheme(Theme);

_systemPerformanceGraphs.UpdateTheme(isDark);

foreach (var entry in _hosts)
{
var host = entry.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ public void OnRender(DrawingContext dc)

if (_selectedGraphPoint != null)
{
TextUtils.DrawText(dc, string.Format("{0}: {1:0.00}{2}", _description, _selectedGraphPoint._value, _unitTag), SystemPerformanceGraphsCanvas._savedHorizontalViewport.X, _selectedGraphPoint._coordinates.Y, 200, false, Brushes.Black);
TextUtils.DrawText(dc, string.Format("{0}: {1:0.00}{2}", _description, _selectedGraphPoint._value, _unitTag), SystemPerformanceGraphsCanvas._savedHorizontalViewport.X, _selectedGraphPoint._coordinates.Y, 250, false, _isDarkTheme ? Brushes.LightGray : Brushes.Black);

dc.DrawGeometry(Brushes.Gray, new Pen(Brushes.Gray, 1), _selectionLinesGeometry);
}
Expand Down Expand Up @@ -1004,6 +1004,11 @@ public void SetVisibility(bool visible)
_visible = visible;
}

public void UpdateTheme(bool isDark)
{
_isDarkTheme = isDark;
}


protected override void OnRender(DrawingContext dc)
{
Expand Down Expand Up @@ -1139,6 +1144,8 @@ public bool HandleLogEvent(Int64 eventTimeMS, string groupName, string counterNa

static public bool _hasSelectedGraphPoint = false;

static public bool _isDarkTheme = false;

Canvas _parentCanvas = null;
}
}

0 comments on commit 30c812f

Please sign in to comment.