mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Projects] Editor: brining the highlighted app's icon into the foreground. + minor UI fixes
This commit is contained in:
@@ -30,6 +30,7 @@ namespace ProjectsEditor
|
|||||||
|
|
||||||
private void EditButtonClicked(object sender, RoutedEventArgs e)
|
private void EditButtonClicked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
_mainViewModel.CloseAllPopups();
|
||||||
Button button = sender as Button;
|
Button button = sender as Button;
|
||||||
Project selectedProject = button.DataContext as Project;
|
Project selectedProject = button.DataContext as Project;
|
||||||
_mainViewModel.EditProject(selectedProject);
|
_mainViewModel.EditProject(selectedProject);
|
||||||
|
|||||||
@@ -123,16 +123,7 @@
|
|||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal">
|
<TextBlock Text="{Binding EditorWindowTitle}" FontSize="24" FontWeight="SemiBold" Margin="0,20,0,20" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
|
||||||
<TextBlock Text="{x:Static props:Resources.Projects}" FontSize="24" FontWeight="Normal" Margin="0,20,0,20" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
|
|
||||||
<TextBlock
|
|
||||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
|
||||||
Foreground="{DynamicResource PrimaryForegroundBrush}"
|
|
||||||
FontSize="16"
|
|
||||||
Margin="10,30,0,20"
|
|
||||||
Text="" />
|
|
||||||
<TextBlock Text="{Binding EditorWindowTitle}" FontSize="24" FontWeight="SemiBold" Margin="10,20,0,20" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Grid.Row="1" Orientation="Vertical">
|
<StackPanel Grid.Row="1" Orientation="Vertical">
|
||||||
<TextBlock Text="{x:Static props:Resources.ProjectName}" FontSize="14" FontWeight="Normal" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
|
<TextBlock Text="{x:Static props:Resources.ProjectName}" FontSize="14" FontWeight="Normal" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
|
||||||
<TextBox
|
<TextBox
|
||||||
|
|||||||
@@ -72,12 +72,23 @@ namespace ProjectsEditor.Utils
|
|||||||
|
|
||||||
g.Clear(Color.FromArgb(0, 0, 0, 0));
|
g.Clear(Color.FromArgb(0, 0, 0, 0));
|
||||||
Brush brush = new SolidBrush(Common.ThemeManager.GetCurrentTheme() == Common.Theme.Dark ? Color.FromArgb(10, 255, 255, 255) : Color.FromArgb(10, 0, 0, 0));
|
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))
|
|
||||||
|
var appsToDraw = project.Applications.Where(x => x.IsSelected && !x.Minimized);
|
||||||
|
|
||||||
|
// draw the highlighted app at the end to have its icon in the foreground for the case there are overlappping icons
|
||||||
|
foreach (Application app in appsToDraw.Where(x => !x.IsHighlighted))
|
||||||
{
|
{
|
||||||
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));
|
||||||
DrawWindow(g, brush, rect, app);
|
DrawWindow(g, brush, rect, app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (Application app in appsToDraw.Where(x => x.IsHighlighted))
|
||||||
|
{
|
||||||
|
Rectangle rect = new Rectangle(Scaled(app.ScaledPosition.X - bounds.Left), Scaled(app.ScaledPosition.Y - bounds.Top), Scaled(app.ScaledPosition.Width), Scaled(app.ScaledPosition.Height));
|
||||||
|
DrawWindow(g, brush, rect, app);
|
||||||
|
}
|
||||||
|
|
||||||
|
// draw the minimized windows
|
||||||
Rectangle rectMinimized = new Rectangle(0, Scaled(bounds.Height), Scaled(bounds.Width), Scaled(bounds.Height * 0.2));
|
Rectangle rectMinimized = new Rectangle(0, Scaled(bounds.Height), Scaled(bounds.Width), Scaled(bounds.Height * 0.2));
|
||||||
DrawWindow(g, brush, rectMinimized, project.Applications.Where(x => x.IsSelected && x.Minimized));
|
DrawWindow(g, brush, rectMinimized, project.Applications.Where(x => x.IsSelected && x.Minimized));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -314,5 +314,13 @@ namespace ProjectsEditor.ViewModels
|
|||||||
{
|
{
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal void CloseAllPopups()
|
||||||
|
{
|
||||||
|
foreach (Project project in Projects)
|
||||||
|
{
|
||||||
|
project.IsPopupVisible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user