Merge branch 'dev/feature/projects' of https://github.com/microsoft/PowerToys into dev/feature/projects

This commit is contained in:
seraphima
2024-06-05 16:30:37 +02:00
2 changed files with 7 additions and 11 deletions

View File

@@ -20,7 +20,7 @@ namespace ProjectsEditor.Common
private const string HighContrastBlackTheme = "HighContrast.Accent4"; private const string HighContrastBlackTheme = "HighContrast.Accent4";
private const string HighContrastWhiteTheme = "HighContrast.Accent5"; private const string HighContrastWhiteTheme = "HighContrast.Accent5";
private Theme _currentTheme; private static Theme _currentTheme;
private Theme _settingsTheme; private Theme _settingsTheme;
private bool _disposed; private bool _disposed;
@@ -76,7 +76,7 @@ namespace ProjectsEditor.Common
} }
} }
public Theme GetCurrentTheme() public static Theme GetCurrentTheme()
{ {
return _currentTheme; return _currentTheme;
} }

View File

@@ -11,11 +11,7 @@ using System.Drawing.Imaging;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Media.Media3D;
using ModernWpf.Media.Animation;
using ProjectsEditor.Models; using ProjectsEditor.Models;
namespace ProjectsEditor.Utils namespace ProjectsEditor.Utils
@@ -101,7 +97,7 @@ namespace ProjectsEditor.Utils
g.PixelOffsetMode = PixelOffsetMode.HighQuality; g.PixelOffsetMode = PixelOffsetMode.HighQuality;
g.Clear(Color.FromArgb(0, 0, 0, 0)); g.Clear(Color.FromArgb(0, 0, 0, 0));
Brush brush = new SolidBrush(Color.FromArgb(10, 255, 255, 255)); // TODO: set theme-related colors Brush brush = new SolidBrush(Common.ThemeManager.GetCurrentTheme() == Common.Theme.Dark ? Color.FromArgb(10, 255, 255, 255) : Color.FromArgb(10, 0, 0, 0));
foreach (Application app in project.Applications.Where(x => x.IsSelected && !x.Minimized)) foreach (Application app in project.Applications.Where(x => x.IsSelected && !x.Minimized))
{ {
Rectangle rect = new Rectangle(Scaled(app.ScaledPosition.X - bounds.Left), Scaled(app.ScaledPosition.Y - bounds.Top), Scaled(app.ScaledPosition.Width), Scaled(app.ScaledPosition.Height)); Rectangle rect = new Rectangle(Scaled(app.ScaledPosition.X - bounds.Left), Scaled(app.ScaledPosition.Y - bounds.Top), Scaled(app.ScaledPosition.Width), Scaled(app.ScaledPosition.Height));
@@ -144,11 +140,11 @@ namespace ProjectsEditor.Utils
{ {
if (app.IsHighlighted) if (app.IsHighlighted)
{ {
graphics.DrawPath(new Pen(Color.White, graphics.VisibleClipBounds.Height / 25), path); // TODO: set theme-related colors graphics.DrawPath(new Pen(Common.ThemeManager.GetCurrentTheme() == Common.Theme.Dark ? Color.White : Color.DarkGray, graphics.VisibleClipBounds.Height / 25), path);
} }
else else
{ {
graphics.DrawPath(new Pen(Color.FromArgb(128, 82, 82, 82), graphics.VisibleClipBounds.Height / 100), path); // TODO: set theme-related colors graphics.DrawPath(new Pen(Common.ThemeManager.GetCurrentTheme() == Common.Theme.Dark ? Color.FromArgb(128, 82, 82, 82) : Color.FromArgb(128, 160, 160, 160), graphics.VisibleClipBounds.Height / 100), path);
} }
graphics.FillPath(brush, path); graphics.FillPath(brush, path);
@@ -202,11 +198,11 @@ namespace ProjectsEditor.Utils
{ {
if (apps.Where(x => x.IsHighlighted).Any()) if (apps.Where(x => x.IsHighlighted).Any())
{ {
graphics.DrawPath(new Pen(Color.White, graphics.VisibleClipBounds.Height / 25), path); graphics.DrawPath(new Pen(Common.ThemeManager.GetCurrentTheme() == Common.Theme.Dark ? Color.White : Color.DarkGray, graphics.VisibleClipBounds.Height / 25), path);
} }
else else
{ {
graphics.DrawPath(new Pen(Color.FromArgb(128, 82, 82, 82), graphics.VisibleClipBounds.Height / 100), path); graphics.DrawPath(new Pen(Common.ThemeManager.GetCurrentTheme() == Common.Theme.Dark ? Color.FromArgb(128, 82, 82, 82) : Color.FromArgb(128, 160, 160, 160), graphics.VisibleClipBounds.Height / 100), path);
} }
graphics.FillPath(brush, path); graphics.FillPath(brush, path);