Browse Source

Keep Quick Operation menu Size when zoomed...

So thats it is also usable when zoomed out very wide...
pull/52/head
jkuehner 12 years ago
parent
commit
51c6465ec8
  1. 23
      src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/QuickOperationMenu.cs

23
src/AddIns/DisplayBindings/WpfDesign/WpfDesign.Designer/Project/Controls/QuickOperationMenu.cs

@ -6,6 +6,11 @@ using System.Collections.Generic; @@ -6,6 +6,11 @@ using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using ICSharpCode.WpfDesign.Designer.Converters;
using System.Globalization;
using System.Windows.Data;
namespace ICSharpCode.WpfDesign.Designer.Controls
{
@ -19,6 +24,14 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -19,6 +24,14 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
DefaultStyleKeyProperty.OverrideMetadata(typeof (QuickOperationMenu), new FrameworkPropertyMetadata(typeof (QuickOperationMenu)));
}
public QuickOperationMenu()
{
scaleTransform = new ScaleTransform(1.0, 1.0);
this.LayoutTransform = scaleTransform;
}
private ScaleTransform scaleTransform;
private MenuItem _mainHeader;
/// <summary>
@ -69,6 +82,16 @@ namespace ICSharpCode.WpfDesign.Designer.Controls @@ -69,6 +82,16 @@ namespace ICSharpCode.WpfDesign.Designer.Controls
if (mainHeader != null) {
_mainHeader = mainHeader;
}
var surface = this.TryFindParent<DesignSurface>();
if (surface != null && surface.ZoomControl != null)
{
var bnd = new Binding("CurrentZoom") { Source = surface.ZoomControl };
bnd.Converter = InvertedZoomConverter.Instance;
BindingOperations.SetBinding(scaleTransform, ScaleTransform.ScaleXProperty, bnd);
BindingOperations.SetBinding(scaleTransform, ScaleTransform.ScaleYProperty, bnd);
}
}
/// <summary>

Loading…
Cancel
Save