Browse Source

Debugger tooltips - added visualizer picker image.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4749 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Martin Koníček 17 years ago
parent
commit
c0a9d4c1f5
  1. 2
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  2. 19
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerPopup.cs
  3. 6
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml
  4. 103
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml.cs
  5. 5
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/Images.xaml
  6. 32
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/LazyItemsControl.cs
  7. 16
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/VirtualizingIEnumerable.cs
  8. 12
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.cs
  9. 178
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.xaml
  10. BIN
      src/Main/Base/Project/Src/Services/Debugger/Tooltips/magnifier.png

2
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -265,6 +265,7 @@ @@ -265,6 +265,7 @@
<Compile Include="Src\Services\ProjectBinding\IProjectBinding.cs" />
<Compile Include="Src\Internal\Templates\Project\ProjectCreateInformation.cs" />
<Compile Include="Src\Services\ProjectBinding\ProjectBindingService.cs" />
<None Include="Src\Services\Debugger\Tooltips\magnifier.png" />
<None Include="Src\Services\ParserService\OldParserService.cs" />
<Compile Include="Src\Services\DisplayBinding\DisplayBindingDoozer.cs" />
<Compile Include="Src\Internal\ConditionEvaluators\CombineOpenEvaluator.cs" />
@ -883,6 +884,7 @@ @@ -883,6 +884,7 @@
<Page Include="Src\Gui\Dialogs\TreeViewOptionsDialog.xaml" />
<Page Include="Src\Gui\Workbench\WpfWorkbench.xaml" />
<Page Include="Src\Services\Debugger\Tooltips\DebuggerTooltipControl.xaml" />
<Page Include="Src\Services\Debugger\Tooltips\Images.xaml" />
<Page Include="Src\Services\Debugger\Tooltips\VisualizerPicker.xaml" />
<Page Include="Src\TextEditor\Gui\Dialogs\GotoDialog.xaml" />
</ItemGroup>

19
src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerPopup.cs

@ -19,26 +19,26 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -19,26 +19,26 @@ namespace ICSharpCode.SharpDevelop.Debugging
public class DebuggerPopup : Popup
{
private DebuggerTooltipControl contentControl;
public DebuggerPopup(DebuggerTooltipControl parentControl)
{
this.contentControl = new DebuggerTooltipControl(parentControl);
this.contentControl.containingPopup = this;
this.Child = this.contentControl;
this.IsLeaf = false;
//this.contentControl.Focusable = true;
//Keyboard.Focus(this.contentControl);
//this.AllowsTransparency = true;
//this.PopupAnimation = PopupAnimation.Slide;
}
public IEnumerable<ITreeNode> ItemsSource
{
get { return this.contentControl.ItemsSource; }
set { this.contentControl.ItemsSource = value; }
set { this.contentControl.ItemsSource = value; }
}
private bool isLeaf;
public bool IsLeaf
{
@ -50,21 +50,20 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -50,21 +50,20 @@ namespace ICSharpCode.SharpDevelop.Debugging
this.StaysOpen = !isLeaf;
}
}
protected override void OnClosed(EventArgs e)
{
base.OnClosed(e);
if (isLeaf)
{
if (isLeaf) {
this.contentControl.CloseOnLostFocus();
}
}
public void Open()
{
this.IsOpen = true;
}
public void CloseSelfAndChildren()
{
this.contentControl.CloseChildPopups();

6
src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml

@ -4,11 +4,7 @@ @@ -4,11 +4,7 @@
xmlns:debugging="clr-namespace:ICSharpCode.SharpDevelop.Debugging">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="VisualizerPicker.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<ResourceDictionary Source="VisualizerPicker.xaml" />
<!-- TODO move styles to ResourceDictionary -->
<Style x:Key="ExpandCollapseToggleStyle"

103
src/Main/Base/Project/Src/Services/Debugger/Tooltips/DebuggerTooltipControl.xaml.cs

@ -27,140 +27,130 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -27,140 +27,130 @@ namespace ICSharpCode.SharpDevelop.Debugging
private readonly double ChildPopupOpenYOffet = 15;
private readonly int InitialItemsCount = 12;
private readonly int VisibleItemsCount = 11;
public DebuggerTooltipControl()
{
InitializeComponent();
}
public DebuggerTooltipControl(ITreeNode node)
: this(new ITreeNode[] { node })
{
}
public DebuggerTooltipControl(IEnumerable<ITreeNode> nodes)
: this()
{
this.ItemsSource = nodes;
}
public DebuggerTooltipControl(DebuggerTooltipControl parentControl)
: this()
{
this.parentControl = parentControl;
}
public event RoutedEventHandler Closed;
protected void OnClosed()
{
if (this.Closed != null)
{
if (this.Closed != null) {
this.Closed(this, new RoutedEventArgs());
}
}
private LazyItemsControl<ITreeNode> lazyGrid;
private IEnumerable<ITreeNode> itemsSource;
public IEnumerable<ITreeNode> ItemsSource
{
get { return this.itemsSource; }
set
{
this.itemsSource = value;
this.lazyGrid = new LazyItemsControl<ITreeNode>(this.dataGrid, InitialItemsCount);
lazyGrid.ItemsSource = new VirtualizingIEnumerable<ITreeNode>(value);
this.dataGrid.AddHandler(ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(handleScroll));
if (this.lazyGrid.ItemsSourceTotalCount != null)
{
if (this.lazyGrid.ItemsSourceTotalCount != null) {
// hide up/down buttons if too few items
btnUp.Visibility = btnDown.Visibility =
this.lazyGrid.ItemsSourceTotalCount.Value <= VisibleItemsCount ? Visibility.Collapsed : Visibility.Visible;
}
}
get
{
return this.itemsSource;
}
}
/// <inheritdoc/>
public bool ShowAsPopup {
get {
public bool ShowAsPopup
{
get
{
return true;
}
}
/// <inheritdoc/>
public bool Close(bool mouseClick)
{
if (mouseClick || (!mouseClick && !isChildExpanded))
{
if (mouseClick || (!mouseClick && !isChildExpanded)) {
CloseChildPopups();
return true;
}
else
{
} else {
return false;
}
}
DebuggerPopup childPopup { get; set; }
DebuggerTooltipControl parentControl { get; set; }
internal DebuggerPopup containingPopup { get; set; }
bool isChildExpanded
{
get {
get
{
return this.childPopup != null && this.childPopup.IsOpen;
}
}
private ToggleButton expandedButton;
/// <summary>
/// Closes the child popup of this control, if it exists.
/// </summary>
public void CloseChildPopups()
{
if (this.expandedButton != null)
{
if (this.expandedButton != null) {
this.expandedButton.IsChecked = false;
this.expandedButton = null;
// nice simple example of indirect recursion
this.childPopup.CloseSelfAndChildren();
}
}
public void CloseOnLostFocus()
{
// when leaf below us closes, we become the leaf
if (this.containingPopup != null)
if (this.containingPopup != null) {
this.containingPopup.IsLeaf = true;
if (!this.IsMouseOver)
{
if (this.containingPopup != null)
{
}
if (!this.IsMouseOver) {
if (this.containingPopup != null) {
this.containingPopup.IsOpen = false;
this.containingPopup.IsLeaf = false;
}
if (this.parentControl != null)
{
if (this.parentControl != null) {
this.parentControl.CloseOnLostFocus();
}
OnClosed();
}
else
{
} else {
// leaf closed because of click inside this control - stop the closing chain
if (this.expandedButton != null && !this.expandedButton.IsMouseOver)
{
if (this.expandedButton != null && !this.expandedButton.IsMouseOver) {
this.expandedButton.IsChecked = false;
this.expandedButton = null;
}
}
}
private void btnExpander_Click(object sender, RoutedEventArgs e)
{
var clickedButton = (ToggleButton)e.OriginalSource;
@ -168,19 +158,16 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -168,19 +158,16 @@ namespace ICSharpCode.SharpDevelop.Debugging
// use device independent units, because child popup Left/Top are in independent units
Point buttonPos = clickedButton.PointToScreen(new Point(0, 0)).TransformFromDevice(clickedButton);
if (clickedButton.IsChecked.GetValueOrDefault(false))
{
if (clickedButton.IsChecked.GetValueOrDefault(false)) {
CloseChildPopups();
this.expandedButton = clickedButton;
// open child Popup
if (this.childPopup == null)
{
if (this.childPopup == null) {
this.childPopup = new DebuggerPopup(this);
this.childPopup.Placement = PlacementMode.Absolute;
}
if (this.containingPopup != null)
{
if (this.containingPopup != null) {
this.containingPopup.IsLeaf = false;
}
this.childPopup.IsLeaf = true;
@ -188,24 +175,22 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -188,24 +175,22 @@ namespace ICSharpCode.SharpDevelop.Debugging
this.childPopup.VerticalOffset = buttonPos.Y + ChildPopupOpenYOffet;
this.childPopup.ItemsSource = clickedNode.ChildNodes;
this.childPopup.Open();
}
else
{
} else {
CloseChildPopups();
}
}
private void handleScroll(object sender, ScrollChangedEventArgs e)
{
btnUp.IsEnabled = !this.lazyGrid.IsScrolledToStart;
btnDown.IsEnabled = !this.lazyGrid.IsScrolledToEnd;
}
void BtnUp_Click(object sender, RoutedEventArgs e)
{
this.lazyGrid.ScrollViewer.ScrollUp(1);
}
void BtnDown_Click(object sender, RoutedEventArgs e)
{
this.lazyGrid.ScrollViewer.ScrollDown(1);

5
src/Main/Base/Project/Src/Services/Debugger/Tooltips/Images.xaml

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<BitmapImage x:Key="MagnifierImage" UriSource="magnifier.png" />
</ResourceDictionary>

32
src/Main/Base/Project/Src/Services/Debugger/Tooltips/LazyItemsControl.cs

@ -18,7 +18,7 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -18,7 +18,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
{
private ItemsControl itemsControl;
private int initialItemsCount;
/// <summary>
/// Creates new instance of LazyItemsControl.
/// </summary>
@ -28,12 +28,12 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -28,12 +28,12 @@ namespace ICSharpCode.SharpDevelop.Debugging
{
if (wrappedItemsControl == null)
throw new ArgumentNullException("wrappedItemsControl");
this.initialItemsCount = initialItemsCount;
this.itemsControl = wrappedItemsControl;
this.itemsControl.AddHandler(ScrollViewer.ScrollChangedEvent, new ScrollChangedEventHandler(handleScroll));
}
private ScrollViewer scrollViewerCached;
public ScrollViewer ScrollViewer
{
@ -44,7 +44,7 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -44,7 +44,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return this.scrollViewerCached;
}
}
public bool IsScrolledToStart
{
get
@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -54,7 +54,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return ScrollViewer.VerticalOffset == 0;
}
}
public bool IsScrolledToEnd
{
get
@ -68,7 +68,7 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -68,7 +68,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
return (ScrollViewer.VerticalOffset >= totalItems - ScrollViewer.ViewportHeight);
}
}
private int? itemsSourceTotalCount = null;
/// <summary> Items count of underlying IEnumerable. Null until scrolled to the end of IEnumerable. </summary>
public int? ItemsSourceTotalCount
@ -78,15 +78,12 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -78,15 +78,12 @@ namespace ICSharpCode.SharpDevelop.Debugging
return this.itemsSourceTotalCount;
}
}
private VirtualizingIEnumerable<T> itemsSource;
/// <summary> The collection that underlying ItemsControl sees. </summary>
public VirtualizingIEnumerable<T> ItemsSource
{
get
{
return itemsSource;
}
get { return itemsSource; }
set
{
this.itemsSource = value;
@ -94,24 +91,21 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -94,24 +91,21 @@ namespace ICSharpCode.SharpDevelop.Debugging
this.itemsControl.ItemsSource = value;
}
}
private void addNextItems(VirtualizingIEnumerable<T> sourceToAdd, int nItems)
{
sourceToAdd.AddNextItems(nItems);
if (!sourceToAdd.HasNext)
{
if (!sourceToAdd.HasNext) {
// all items from IEnumerable have been added
this.itemsSourceTotalCount = sourceToAdd.Count;
}
}
private void handleScroll(object sender, ScrollChangedEventArgs e)
{
if (e.VerticalChange > 0)
{
if (e.VerticalChange > 0) {
// scrolled to bottom
if (e.VerticalOffset >= this.itemsSource.Count - e.ViewportHeight)
{
if (e.VerticalOffset >= this.itemsSource.Count - e.ViewportHeight) {
addNextItems(this.itemsSource, (int)e.VerticalChange);
}
}

16
src/Main/Base/Project/Src/Services/Debugger/Tooltips/VirtualizingIEnumerable.cs

@ -18,36 +18,34 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -18,36 +18,34 @@ namespace ICSharpCode.SharpDevelop.Debugging
public class VirtualizingIEnumerable<T> : ObservableCollection<T>
{
private IEnumerator<T> originalSourceEnumerator;
public VirtualizingIEnumerable(IEnumerable<T> originalSource)
{
if (originalSource == null)
throw new ArgumentNullException("originalSource");
this.originalSourceEnumerator = originalSource.GetEnumerator();
}
private bool hasNext = true;
/// <summary>
/// False if all items from underlying IEnumerable have already been added.
/// </summary>
public bool HasNext
{
get
get
{
return this.hasNext;
}
}
/// <summary>
/// Requests next <paramref name="count"/> items from underlying IEnumerable source and adds them to the collection.
/// </summary>
public void AddNextItems(int count)
{
for (int i = 0; i < count; i++)
{
if (!originalSourceEnumerator.MoveNext())
{
for (int i = 0; i < count; i++) {
if (!originalSourceEnumerator.MoveNext()) {
this.hasNext = false;
break;
}

12
src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.cs

@ -31,15 +31,15 @@ namespace ICSharpCode.SharpDevelop.Debugging @@ -31,15 +31,15 @@ namespace ICSharpCode.SharpDevelop.Debugging
if (clickedCommand == null) {
throw new InvalidOperationException(
string.Format("{0} clicked, only instances of {1} must be present in {2}.",
this.SelectedItem.GetType().ToString(), typeof(IVisualizerCommand).Name, typeof(VisualizerPicker).Name));
}
this.SelectedItem.GetType().ToString(), typeof(IVisualizerCommand).Name, typeof(VisualizerPicker).Name));
}
clickedCommand.Execute();
// make no item selected, so that multiple selections of the same item always execute the command
// this triggers VisualizerPicker_SelectionChanged again, which returns immediately
// Make no item selected, so that multiple selections of the same item always execute the command.
// This triggers VisualizerPicker_SelectionChanged again, which returns immediately.
this.SelectedIndex = -1;
}
public new IEnumerable<IVisualizerCommand> ItemsSource
{
get { return (IEnumerable<IVisualizerCommand>)base.ItemsSource; }

178
src/Main/Base/Project/Src/Services/Debugger/Tooltips/VisualizerPicker.xaml

@ -2,6 +2,10 @@ @@ -2,6 +2,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
xmlns:debugging="clr-namespace:ICSharpCode.SharpDevelop.Debugging">
<!--
<BitmapImage x:Key="MagnifierImage" UriSource="magnifier.png" /> -->
<Style x:Key="ComboBoxFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
@ -20,66 +24,72 @@ @@ -20,66 +24,72 @@
<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
<Geometry x:Key="DownArrowGeometry">M 0 0 L 2 3 L 4 0 Z</Geometry>
<Style x:Key="ComboBoxReadonlyToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="ClickMode" Value="Press"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<!-- Button face - changed from original ButtonChrome to Border -->
<Border Name="FaceBorder" Background="White" CornerRadius="2" BorderBrush="Gray" BorderThickness="1" Padding="1" >
<Grid HorizontalAlignment="Right" Width="5">
<Path x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="FaceBorder" Property="Background" Value="#FFE0EDFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
<GradientStop Color="#ABADB3" Offset="0.05"/>
<GradientStop Color="#E2E3EA" Offset="0.07"/>
<GradientStop Color="#E3E9EF" Offset="1"/>
</LinearGradientBrush>
<Style TargetType="{x:Type debugging:VisualizerPicker}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Padding" Value="4,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type debugging:VisualizerPicker}">
<!-- ComboBox face -->
<Grid x:Name="MainGrid" SnapsToDevicePixels="true" Width="18" Height="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<Popup x:Name="PART_Popup" Margin="1" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}" Color="Transparent">
<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer CanContentScroll="true">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Border>
</Microsoft_Windows_Themes:SystemDropShadowChrome>
</Popup>
<ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="IsTabStop" Value="false"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="ClickMode" Value="Press"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<!-- Content of ComboBox face -->
<ContentPresenter
<!-- Button face - changed from original ButtonChrome to Border -->
<Border Name="FaceBorder" Background="White" CornerRadius="2" BorderBrush="#FFD9D9E9" BorderThickness="1" Padding="1" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<!--
<Image Grid.Column="0" Width="10" Height="10" Stretch="Fill" Source="{StaticResource MagnifierImage}" /> -->
<Path Grid.Column="1" x:Name="Arrow" Fill="Black" HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Data="{StaticResource DownArrowGeometry}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="FaceBorder" Property="Background" Value="#FFE0EDFF"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<LinearGradientBrush x:Key="TextBoxBorder" EndPoint="0,20" StartPoint="0,0" MappingMode="Absolute">
<GradientStop Color="#ABADB3" Offset="0.05"/>
<GradientStop Color="#E2E3EA" Offset="0.07"/>
<GradientStop Color="#E3E9EF" Offset="1"/>
</LinearGradientBrush>
<Style TargetType="{x:Type debugging:VisualizerPicker}">
<Setter Property="FocusVisualStyle" Value="{StaticResource ComboBoxFocusVisual}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="Padding" Value="4,3"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type debugging:VisualizerPicker}">
<!-- ComboBox face -->
<Grid x:Name="MainGrid" SnapsToDevicePixels="true" Width="18" Height="16">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="5"/>
</Grid.ColumnDefinitions>
<Popup x:Name="PART_Popup" Margin="1" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Grid.ColumnSpan="2">
<Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=MainGrid}" Color="Transparent">
<Border x:Name="DropDownBorder" Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}" BorderThickness="1">
<ScrollViewer CanContentScroll="true">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Border>
</Microsoft_Windows_Themes:SystemDropShadowChrome>
</Popup>
<ToggleButton Style="{StaticResource ComboBoxReadonlyToggleButton}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" Grid.ColumnSpan="2" IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"/>
<!-- Content of ComboBox face -->
<ContentPresenter
HorizontalAlignment="Left"
Margin="0"
VerticalAlignment="Center"
@ -90,29 +100,29 @@ @@ -90,29 +100,29 @@
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
<Setter Property="Background" Value="#FFF4F4F4"/>
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEditable" Value="true">
</Trigger>
</Style.Triggers>
</Style>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
<Setter Property="Margin" TargetName="Shdw" Value="0,0,5,5"/>
<Setter Property="Color" TargetName="Shdw" Value="#71000000"/>
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter Property="Height" TargetName="DropDownBorder" Value="95"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
<Setter Property="Background" Value="#FFF4F4F4"/>
</Trigger>
<Trigger Property="IsGrouping" Value="true">
<Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsEditable" Value="true">
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

BIN
src/Main/Base/Project/Src/Services/Debugger/Tooltips/magnifier.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Loading…
Cancel
Save