[Projects] Editor: brining the highlighted app's icon into the foreground. + minor UI fixes

This commit is contained in:
donlaci
2024-06-19 11:02:41 +02:00
parent f7cab16fb6
commit 0efe6c91e8
4 changed files with 22 additions and 11 deletions

View File

@@ -30,6 +30,7 @@ namespace ProjectsEditor
private void EditButtonClicked(object sender, RoutedEventArgs e)
{
_mainViewModel.CloseAllPopups();
Button button = sender as Button;
Project selectedProject = button.DataContext as Project;
_mainViewModel.EditProject(selectedProject);

View File

@@ -123,16 +123,7 @@
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal">
<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="&#xE76C;" />
<TextBlock Text="{Binding EditorWindowTitle}" FontSize="24" FontWeight="SemiBold" Margin="10,20,0,20" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
</StackPanel>
<TextBlock Text="{Binding EditorWindowTitle}" FontSize="24" FontWeight="SemiBold" Margin="0,20,0,20" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
<StackPanel Grid.Row="1" Orientation="Vertical">
<TextBlock Text="{x:Static props:Resources.ProjectName}" FontSize="14" FontWeight="Normal" Foreground="{DynamicResource PrimaryForegroundBrush}"/>
<TextBox

View File

@@ -72,12 +72,23 @@ namespace ProjectsEditor.Utils
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));
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));
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));
DrawWindow(g, brush, rectMinimized, project.Applications.Where(x => x.IsSelected && x.Minimized));
}

View File

@@ -314,5 +314,13 @@ namespace ProjectsEditor.ViewModels
{
GC.SuppressFinalize(this);
}
internal void CloseAllPopups()
{
foreach (Project project in Projects)
{
project.IsPopupVisible = false;
}
}
}
}