Skip to content

Commit

Permalink
Added preview icon
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Apr 27, 2019
1 parent 63b4efb commit b8ee8a5
Show file tree
Hide file tree
Showing 2 changed files with 120 additions and 104 deletions.
218 changes: 114 additions & 104 deletions src/BuildVision.UI/Components/ControlView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,110 +39,120 @@
<converters:InProgressToBoolConverter x:Key="InProgressToBoolConverter" />
</ResourceDictionary>
</UserControl.Resources>
<Grid Margin="10,6,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0" Height="auto">
<Grid Background="{DynamicResource ToolWindowBackgroundKey}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentControl Template="{Binding BuildInformationModel.StateIconKey, Converter={StaticResource StateIconKeyToIconConverter}}" />
<TextBlock Margin="2,0" Grid.Column="1" FontSize="18" Foreground="{DynamicResource ToolWindowTextKey}" Text="{Binding BuildInformationModel.StateMessage}" TextTrimming="WordEllipsis" extensions:TextBlockUtils.AutoTooltip="True" VerticalAlignment="Center" />
</Grid>
<controls:BuildVisionProgressBar DataContext="{Binding BuildInformationModel}" />
<Grid Visibility="{Binding ControlSettings.GeneralSettings.IndicatorsPanelVisible, Converter={StaticResource BoolToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,0,0" Orientation="Horizontal">
<StackPanel Orientation="Horizontal" IsEnabled="true" Visibility="{Binding BuildInformationModel.CurrentBuildState, Converter={StaticResource InProgressToCollapsedConverter}}">
<customButtons:BuildActionButton Command="{Binding BuildSolutionAction}" ToolTip="{x:Static res:Resources.BuildSolutionButtonTooltip}">
<ContentControl Template="{StaticResource BuildSolutionIcon}" />
<Grid>
<Border ClipToBounds="True" SnapsToDevicePixels="True" Panel.ZIndex="1000" Height="Auto" VerticalAlignment="Top" Margin="0,0" Padding="5,0,5,1" Background="#D63F26" CornerRadius="2" Visibility="{Binding PreviewVersion, Converter={StaticResource BoolToVisibilityConverter}}" HorizontalAlignment="Left">
<Border.LayoutTransform>
<RotateTransform Angle="-50"/>
</Border.LayoutTransform>
<TextBlock FontSize="10">Preview</TextBlock>
</Border>
<Grid Margin="10,6,10,10">

<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Vertical" Grid.Row="0" Height="auto">
<Grid Background="{DynamicResource ToolWindowBackgroundKey}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ContentControl Template="{Binding BuildInformationModel.StateIconKey, Converter={StaticResource StateIconKeyToIconConverter}}" />
<TextBlock Margin="2,0" Grid.Column="1" FontSize="18" Foreground="{DynamicResource ToolWindowTextKey}" Text="{Binding BuildInformationModel.StateMessage}" TextTrimming="WordEllipsis" extensions:TextBlockUtils.AutoTooltip="True" VerticalAlignment="Center" />
</Grid>

<controls:BuildVisionProgressBar DataContext="{Binding BuildInformationModel}" />
<Grid Visibility="{Binding ControlSettings.GeneralSettings.IndicatorsPanelVisible, Converter={StaticResource BoolToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<WrapPanel Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,0,0" Orientation="Horizontal">
<StackPanel Orientation="Horizontal" IsEnabled="true" Visibility="{Binding BuildInformationModel.CurrentBuildState, Converter={StaticResource InProgressToCollapsedConverter}}">
<customButtons:BuildActionButton Command="{Binding BuildSolutionAction}" ToolTip="{x:Static res:Resources.BuildSolutionButtonTooltip}">
<ContentControl Template="{StaticResource BuildSolutionIcon}" />
</customButtons:BuildActionButton>
<customButtons:BuildActionButton Command="{Binding RebuildSolutionAction}" ToolTip="{x:Static res:Resources.RebuildSolutionButtonTooltip}">
<ContentControl Template="{StaticResource RebuildSolutionIcon}" />
</customButtons:BuildActionButton>
<customButtons:BuildActionButton Command="{Binding CleanSolutionAction}" ToolTip="{x:Static res:Resources.CleanSolutionButtonTooltip}">
<ContentControl Template="{StaticResource CleanSolutionIcon}" />
</customButtons:BuildActionButton>
</StackPanel>
<customButtons:BuildActionButton Command="{Binding CancelBuildSolutionAction}" HorizontalAlignment="Stretch" MinWidth="66" ToolTip="{x:Static res:Resources.CancelBuildSolutionButtonTooltip}" IsEnabled="{Binding BuildInformationModel.CurrentBuildState, Converter={StaticResource InProgressToBoolConverter}}" Visibility="{Binding BuildInformationModel.CurrentBuildState, Converter={StaticResource InProgressToVisibleConverter}}">
<customButtons:BuildActionButton.Content>
<StackPanel Orientation="Horizontal">
<ContentControl Template="{StaticResource CancelBuildSolutionIcon}" />
<TextBlock Margin="2,0,0,0" Text="{x:Static res:Resources.CancelBuildSolutionButtonCaption}" />
</StackPanel>
</customButtons:BuildActionButton.Content>
</customButtons:BuildActionButton>
<customButtons:BuildActionButton Command="{Binding RebuildSolutionAction}" ToolTip="{x:Static res:Resources.RebuildSolutionButtonTooltip}">
<ContentControl Template="{StaticResource RebuildSolutionIcon}" />
</customButtons:BuildActionButton>
<customButtons:BuildActionButton Command="{Binding CleanSolutionAction}" ToolTip="{x:Static res:Resources.CleanSolutionButtonTooltip}">
<ContentControl Template="{StaticResource CleanSolutionIcon}" />
</customButtons:BuildActionButton>
</StackPanel>
<customButtons:BuildActionButton Command="{Binding CancelBuildSolutionAction}" HorizontalAlignment="Stretch" MinWidth="66" ToolTip="{x:Static res:Resources.CancelBuildSolutionButtonTooltip}" IsEnabled="{Binding BuildInformationModel.CurrentBuildState, Converter={StaticResource InProgressToBoolConverter}}" Visibility="{Binding BuildInformationModel.CurrentBuildState, Converter={StaticResource InProgressToVisibleConverter}}">
<customButtons:BuildActionButton.Content>
<StackPanel Orientation="Horizontal">
<ContentControl Template="{StaticResource CancelBuildSolutionIcon}" />
<TextBlock Margin="2,0,0,0" Text="{x:Static res:Resources.CancelBuildSolutionButtonCaption}" />
</StackPanel>
</customButtons:BuildActionButton.Content>
</customButtons:BuildActionButton>
</WrapPanel>
<Border Grid.Column="1" Width="2" BorderThickness="2" BorderBrush="{DynamicResource CommandBarMenuSeparatorBrushKey}" Margin="10,2,10,2" />
<ListBox Grid.Column="2" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" UseLayoutRounding="False">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="IsEnabled" Value="false" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="Border.BorderBrush" Value="Transparent" />
<Setter Property="Border.BorderThickness" Value="0" />
<Setter Property="Border.Background" Value="Transparent" />
<Setter Property="Border.Padding" Value="0" />
</Style>
</ListBox.Resources>
<indicators:ErrorsIndicator Value="{Binding BuildInformationModel.ErrorCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.ErrorCount, UpdateSourceTrigger=PropertyChanged}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:WarningsIndicator Value="{Binding BuildInformationModel.WarningsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.WarningsCount, UpdateSourceTrigger=PropertyChanged}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:MessagesIndicator Value="{Binding BuildInformationModel.MessagesCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.MessagesCount, UpdateSourceTrigger=PropertyChanged}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
</ListBox>
<Border Grid.Column="3" Width="2" BorderThickness="2" BorderBrush="{DynamicResource CommandBarMenuSeparatorBrushKey}" Margin="10,2,10,2" />
<ListBox Grid.Column="4" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" UseLayoutRounding="False">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="IsEnabled" Value="false" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="Border.BorderBrush" Value="Transparent" />
<Setter Property="Border.BorderThickness" Value="0" />
<Setter Property="Border.Background" Value="Transparent" />
<Setter Property="Border.Padding" Value="0" />
</Style>
</ListBox.Resources>
<indicators:SuccessProjectsIndicator Value="{Binding BuildInformationModel.SucceededProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-8,0,0,0" Content="{Binding BuildInformationModel.SucceededProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:UpToDateProjectsIndicator Value="{Binding BuildInformationModel.UpToDateProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.UpToDateProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:WarningProjectsIndicator Value="{Binding BuildInformationModel.WarnedProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.WarnedProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:ErrorProjectsIndicator Value="{Binding BuildInformationModel.FailedProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.FailedProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
</ListBox>
</Grid>
</StackPanel>
<components:ProjectGrid DataContext="{Binding}" Grid.Row="1" />
</WrapPanel>
<Border Grid.Column="1" Width="2" BorderThickness="2" BorderBrush="{DynamicResource CommandBarMenuSeparatorBrushKey}" Margin="10,2,10,2" />
<ListBox Grid.Column="2" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" UseLayoutRounding="False">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="IsEnabled" Value="false" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="Border.BorderBrush" Value="Transparent" />
<Setter Property="Border.BorderThickness" Value="0" />
<Setter Property="Border.Background" Value="Transparent" />
<Setter Property="Border.Padding" Value="0" />
</Style>
</ListBox.Resources>
<indicators:ErrorsIndicator Value="{Binding BuildInformationModel.ErrorCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.ErrorCount, UpdateSourceTrigger=PropertyChanged}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:WarningsIndicator Value="{Binding BuildInformationModel.WarningsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.WarningsCount, UpdateSourceTrigger=PropertyChanged}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:MessagesIndicator Value="{Binding BuildInformationModel.MessagesCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.MessagesCount, UpdateSourceTrigger=PropertyChanged}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
</ListBox>
<Border Grid.Column="3" Width="2" BorderThickness="2" BorderBrush="{DynamicResource CommandBarMenuSeparatorBrushKey}" Margin="10,2,10,2" />
<ListBox Grid.Column="4" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" UseLayoutRounding="False">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.Resources>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="IsEnabled" Value="false" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0,0,5,0" />
<Setter Property="Border.BorderBrush" Value="Transparent" />
<Setter Property="Border.BorderThickness" Value="0" />
<Setter Property="Border.Background" Value="Transparent" />
<Setter Property="Border.Padding" Value="0" />
</Style>
</ListBox.Resources>
<indicators:SuccessProjectsIndicator Value="{Binding BuildInformationModel.SucceededProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-8,0,0,0" Content="{Binding BuildInformationModel.SucceededProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:UpToDateProjectsIndicator Value="{Binding BuildInformationModel.UpToDateProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.UpToDateProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:WarningProjectsIndicator Value="{Binding BuildInformationModel.WarnedProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.WarnedProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
<indicators:ErrorProjectsIndicator Value="{Binding BuildInformationModel.FailedProjectsCount, UpdateSourceTrigger=PropertyChanged}" />
<Label Margin="-6,0,0,0" Content="{Binding BuildInformationModel.FailedProjectsCount}" Foreground="{DynamicResource ToolWindowTextKey}" Opacity="0.4" />
</ListBox>
</Grid>
</StackPanel>
<components:ProjectGrid DataContext="{Binding}" Grid.Row="1" />
</Grid>
</Grid>
</UserControl>
Loading

0 comments on commit b8ee8a5

Please sign in to comment.