diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-01 12:17:44 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-01 12:17:44 +0300 |
| commit | b2ecc74067ad29c0bb4d267fb966ceb7cb8cbbdb (patch) | |
| tree | bb06ad367fdcbaac6b7428d6daedeb03e30e24e4 /Software/Visual_Studio | |
| parent | 125af20c03bcf1904166e9858a3a54ef4fcb1f05 (diff) | |
| download | Tango-b2ecc74067ad29c0bb4d267fb966ceb7cb8cbbdb.tar.gz Tango-b2ecc74067ad29c0bb4d267fb966ceb7cb8cbbdb.zip | |
Working on PPC.
Diffstat (limited to 'Software/Visual_Studio')
7 files changed, 148 insertions, 83 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml index ccbcc8394..4033c8af1 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml @@ -8,17 +8,21 @@ xmlns:pmr="clr-namespace:Tango.PMR.ColorLab;assembly=Tango.PMR" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" MinWidth="560" Height="555" d:DataContext="{d:DesignInstance Type=local:BasicColorCorrectionViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" MinWidth="560" Height="570" d:DataContext="{d:DesignInstance Type=local:BasicColorCorrectionViewVM, IsDesignTimeCreatable=False}"> <Grid> <Grid Margin="20"> <Grid.RowDefinitions> - <RowDefinition Height="40"/> + <RowDefinition Height="60"/> <RowDefinition Height="100"/> <RowDefinition Height="1*"/> - <RowDefinition Height="101"/> + <RowDefinition Height="80"/> </Grid.RowDefinitions> - <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoErrorBrush}">Color is out of gamut</TextBlock> + <Grid> + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoMessageBoxTitleFontSize}" Foreground="{StaticResource TangoErrorBrush}">Color is out of gamut</TextBlock> + + <touch:TouchIconButton HorizontalAlignment="Right" Icon="Close" CornerRadius="50" Foreground="{StaticResource TangoDarkForegroundBrush}" Padding="20" /> + </Grid> <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center"> <Image Source="../Images/JobView/error.png" Stretch="None" /> @@ -33,65 +37,73 @@ <DockPanel Grid.Row="2" Margin="0 0 0 0"> <TextBlock DockPanel.Dock="Top" Margin="40 0 0 0">Please select an alternative</TextBlock> - <!--<Grid>--> - <touch:TouchListBox SelectionMode="Single" Style="{StaticResource TangoBasicListBox}" ItemsSource="{Binding Results}" Margin="0 20 0 0"> - <touch:TouchListBox.ItemContainerStyle> - <Style TargetType="touch:TouchListBoxItem"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="Margin" Value="0 10"></Setter> - </Style> - </touch:TouchListBox.ItemContainerStyle> - <touch:TouchListBox.ItemTemplate> - <DataTemplate DataType="{x:Type models:ColorConversionResult}"> - <StackPanel Orientation="Horizontal"> - <Ellipse Width="60" Height="60" Margin="40 0 0 0" Fill="{Binding Brush}" RenderTransformOrigin="0.5,0.5"> - <Ellipse.Style> - <Style TargetType="Ellipse"> - <Setter Property="RenderTransform"> - <Setter.Value> - <ScaleTransform ScaleX="1" ScaleY="1" /> - </Setter.Value> - </Setter> - <Setter Property="Effect"> - <Setter.Value> - <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" /> - </Setter.Value> - </Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected}" Value="True"> - <DataTrigger.EnterActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.EnterActions> - <DataTrigger.ExitActions> - <BeginStoryboard> - <Storyboard> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> - <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> - </Storyboard> - </BeginStoryboard> - </DataTrigger.ExitActions> - </DataTrigger> - </Style.Triggers> - </Style> - </Ellipse.Style> - </Ellipse> - <TextBlock VerticalAlignment="Center" Margin="20 0 0 0"> + <touch:TouchListBox SelectionMode="Single" Style="{StaticResource TangoNoRippleListBox}" ItemsSource="{Binding Results}" Margin="0 20 0 0"> + <touch:TouchListBox.ItemContainerStyle> + <Style TargetType="touch:TouchListBoxItem"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Margin" Value="0 10"></Setter> + </Style> + </touch:TouchListBox.ItemContainerStyle> + <touch:TouchListBox.ItemTemplate> + <DataTemplate DataType="{x:Type models:ColorConversionResult}"> + <StackPanel Orientation="Horizontal"> + <Ellipse Width="60" Height="60" Margin="40 0 0 0" Fill="{Binding Brush}" RenderTransformOrigin="0.5,0.5"> + <Ellipse.Style> + <Style TargetType="Ellipse"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Setter Property="Effect"> + <Setter.Value> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.EnterActions> + <DataTrigger.ExitActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0"> <Run Text="{Binding Color.R}"></Run><Run>,</Run> <Run Text="{Binding Color.G}"></Run><Run>,</Run> <Run Text="{Binding Color.B}"></Run> - </TextBlock> - </StackPanel> - </DataTemplate> - </touch:TouchListBox.ItemTemplate> - </touch:TouchListBox> - <!--</Grid>--> + </TextBlock> + </StackPanel> + </DataTemplate> + </touch:TouchListBox.ItemTemplate> + </touch:TouchListBox> + </DockPanel> + + <DockPanel Grid.Row="3" Margin="40 10 20 0" LastChildFill="False"> + <touch:TouchButton VerticalAlignment="Top" Style="{StaticResource TangoLinkButton}" DockPanel.Dock="Left" Foreground="{StaticResource TangoPrimaryAccentBrush}"> + More Options + </touch:TouchButton> + + <touch:TouchButton Command="{Binding OKCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" DockPanel.Dock="Right" Width="170" Height="50" VerticalAlignment="Bottom"> + OK + </touch:TouchButton> </DockPanel> </Grid> </Grid> diff --git a/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs b/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs index 84452408f..1854b410a 100644 --- a/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs +++ b/Software/Visual_Studio/Tango.SharedUI/DialogViewVM.cs @@ -38,6 +38,11 @@ namespace Tango.SharedUI } /// <summary> + /// Gets a value indicating whether the dialog has been confirmed. + /// </summary> + public bool DialogResult { get; private set; } + + /// <summary> /// Gets or sets the close command. /// </summary> public RelayCommand CloseCommand { get; set; } @@ -60,6 +65,7 @@ namespace Tango.SharedUI /// </summary> protected virtual void Accept() { + DialogResult = true; Accepted?.Invoke(); } diff --git a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs index cc696aa99..8d1504f48 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/LightTouchScrollViewer.cs @@ -156,6 +156,15 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty BottomArcSizeProperty = DependencyProperty.Register("BottomArcSize", typeof(Size), typeof(LightTouchScrollViewer), new PropertyMetadata(default(Size))); + public bool DisableScrolling + { + get { return (bool)GetValue(DisableScrollingProperty); } + set { SetValue(DisableScrollingProperty, value); } + } + public static readonly DependencyProperty DisableScrollingProperty = + DependencyProperty.Register("DisableScrolling", typeof(bool), typeof(LightTouchScrollViewer), new PropertyMetadata(false)); + + #endregion #region Constructors @@ -356,6 +365,8 @@ namespace Tango.Touch.Controls /// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param> protected virtual void OnMouseTouchDown(object sender, MouseOrTouchEventArgs e) { + if (DisableScrolling) return; + IsAfterScrolling = false; if (_move_timer != null) @@ -398,6 +409,8 @@ namespace Tango.Touch.Controls /// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param> protected virtual void OnMouseTouchMove(object sender, MouseOrTouchEventArgs e) { + if (DisableScrolling) return; + if (_down_element is DragThumb) { if (e.Location.Y > ActualHeight - 100) @@ -496,6 +509,8 @@ namespace Tango.Touch.Controls /// <param name="e">The <see cref="MouseOrTouchEventArgs"/> instance containing the event data.</param> protected virtual void OnMouseTouchUp(object sender, MouseOrTouchEventArgs e) { + if (DisableScrolling) return; + if (_is_dragging_off_view) { _is_dragging_off_view = false; diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs index 2cefd411e..55a1118fd 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.cs @@ -113,6 +113,23 @@ namespace Tango.Touch.Controls public static readonly DependencyProperty ListBoxItemLoadedCommandProperty = DependencyProperty.Register("ListBoxItemLoadedCommand", typeof(RelayCommand<TouchListBoxItem>), typeof(TouchListBox), new PropertyMetadata(null)); + public bool DisableScrolling + { + get { return (bool)GetValue(DisableScrollingProperty); } + set { SetValue(DisableScrollingProperty, value); } + } + public static readonly DependencyProperty DisableScrollingProperty = + DependencyProperty.Register("DisableScrolling", typeof(bool), typeof(TouchListBox), new PropertyMetadata(false)); + + public bool DisableRipple + { + get { return (bool)GetValue(DisableRippleProperty); } + set { SetValue(DisableRippleProperty, value); } + } + public static readonly DependencyProperty DisableRippleProperty = + DependencyProperty.Register("DisableRipple", typeof(bool), typeof(TouchListBox), new PropertyMetadata(false)); + + public TouchListBox() { diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml index f57f6b32f..be03f498c 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchListBox.xaml @@ -14,29 +14,30 @@ </ResourceDictionary> </ResourceDictionary.MergedDictionaries> - <Style TargetType="local:TouchListBoxItem"> - <Setter Property="Background" Value="Transparent"></Setter> - <Setter Property="IsManipulationEnabled" Value="True"></Setter> - <Style.Triggers> - <MultiDataTrigger> - <MultiDataTrigger.Conditions> - <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True" /> - <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=SelectionMode,Converter={StaticResource SelectionModesToBooleanConverter},ConverterParameter='Single,Multiple'}" Value="True" /> - </MultiDataTrigger.Conditions> - <Setter Property="Background" Value="{StaticResource TangoLightSelectedBrush}"></Setter> - </MultiDataTrigger> - </Style.Triggers> - </Style> - <Style TargetType="{x:Type local:TouchListBox}"> - <Setter Property="IsManipulationEnabled" Value="True"></Setter> <Setter Property="local:TouchPanel.PreventFocusSteal" Value="True"></Setter> + <Setter Property="ItemContainerStyle"> + <Setter.Value> + <Style TargetType="local:TouchListBoxItem"> + <Setter Property="Background" Value="Transparent"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True" /> + <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=SelectionMode,Converter={StaticResource SelectionModesToBooleanConverter},ConverterParameter='Single,Multiple'}" Value="True" /> + </MultiDataTrigger.Conditions> + <Setter Property="Background" Value="{StaticResource TangoLightSelectedBrush}"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Setter.Value> + </Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:TouchListBox}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> - <local:LightTouchScrollViewer x:Name="PART_ScrollViewer"> - <ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" ItemContainerStyle="{TemplateBinding ItemContainerStyle}" VerticalAlignment="Top" ClipToBounds="True"> + <local:LightTouchScrollViewer x:Name="PART_ScrollViewer" DisableScrolling="{TemplateBinding DisableScrolling}"> + <ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" VerticalAlignment="Top" ClipToBounds="True"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel VirtualizingPanel.IsVirtualizing="False" Orientation="Vertical" VerticalAlignment="Top" /> @@ -44,7 +45,7 @@ </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> - <local:TouchListBoxItem> + <local:TouchListBoxItem Style="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ItemContainerStyle}"> <i:Interaction.Triggers> <i:EventTrigger EventName="Loaded"> <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ListBoxItemLoadedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBoxItem}}" /> @@ -61,6 +62,9 @@ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=IsMultiSelecting}" Value="True"> <Setter Property="Disabled" Value="True"></Setter> </DataTrigger> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=DisableRipple}" Value="True"> + <Setter Property="Disabled" Value="True"></Setter> + </DataTrigger> </Style.Triggers> </Style> </components:Ripple.Style> diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml index e62404309..fea5c541c 100644 --- a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml @@ -26,13 +26,24 @@ <Setter Property="RippleFactor" Value="10"></Setter> </Style> - <Style x:Key="TangoHollowButton" TargetType="{x:Type controls:TouchButton}"> + <Style x:Key="TangoLinkButton" TargetType="{x:Type controls:TouchButton}"> <Setter Property="Background" Value="Transparent"></Setter> <Setter Property="CornerRadius" Value="20"></Setter> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="EnableDropShadow" Value="False"></Setter> + <Setter Property="Padding" Value="10 5"></Setter> + <Setter Property="RippleBrush" Value="{StaticResource TangoRippleDarkBrush}"></Setter> + <Setter Property="FontSize" Value="{StaticResource TangoDefaultFontSize}"></Setter> + </Style> + + <Style x:Key="TangoHollowButton" TargetType="{x:Type controls:TouchButton}"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="CornerRadius" Value="30"></Setter> <Setter Property="TextElement.Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> - <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="BorderThickness" Value="2"></Setter> <Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> <Setter Property="RippleBrush" Value="{StaticResource TangoRippleDarkBrush}"></Setter> + <Setter Property="EnableDropShadow" Value="False"></Setter> </Style> </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml index dece0f8ba..ccfbc6feb 100644 --- a/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml @@ -11,14 +11,14 @@ <localConverters:SelectionModesToBooleanConverter x:Key="SelectionModesToBooleanConverter" /> - <Style x:Key="TangoBasicListBox" TargetType="{x:Type local:TouchListBox}"> - <Setter Property="IsManipulationEnabled" Value="True"></Setter> + <Style x:Key="TangoNoRippleListBox" TargetType="{x:Type local:TouchListBox}"> <Setter Property="local:TouchPanel.PreventFocusSteal" Value="True"></Setter> + <Setter Property="DisableScrolling" Value="True"></Setter> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type local:TouchListBox}"> <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> - <local:LightTouchScrollViewer x:Name="PART_ScrollViewer"> + <local:LightTouchScrollViewer x:Name="PART_ScrollViewer" DisableScrolling="{TemplateBinding DisableScrolling}"> <ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" VerticalAlignment="Top" ClipToBounds="True"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> |
