Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs27
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs2
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs7
-rw-r--r--main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj1
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs9
5 files changed, 37 insertions, 9 deletions
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs
new file mode 100644
index 0000000000..d075c0cdbc
--- /dev/null
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFTitlebar.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using MonoDevelop.Components.Windows;
+
+namespace WindowsPlatform.MainToolbar
+{
+ public class WPFTitlebar : GtkWPFWidget
+ {
+ TitleBar titlebar;
+
+ public WPFTitlebar (TitleBar titlebar) : base (titlebar)
+ {
+ this.titlebar = titlebar;
+ HeightRequest = System.Windows.Forms.SystemInformation.CaptionHeight;
+ }
+
+ protected override void RepositionWpfWindow()
+ {
+ int scale = (int)MonoDevelop.Components.GtkWorkarounds.GetScaleFactor (this);
+
+ RepositionWpfWindow (scale, 1);
+ }
+ }
+}
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
index 89c87eac2e..186432a14e 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/MainToolbar/WPFToolbar.cs
@@ -105,7 +105,7 @@ namespace WindowsPlatform.MainToolbar
protected override void RepositionWpfWindow()
{
int scale = (int)MonoDevelop.Components.GtkWorkarounds.GetScaleFactor(this);
- RepositionWpfWindow (scale);
+ RepositionWpfWindow (scale, scale);
}
void SendKeyPress(KeyEventArgs ka)
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
index 0b15980ebd..96aabc224b 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.cs
@@ -88,10 +88,9 @@ namespace MonoDevelop.Platform
const int WM_SYSCHAR = 0x0106;
internal override void AttachMainToolbar (Gtk.VBox parent, Components.MainToolbar.IMainToolbarView toolbar)
{
- titleBar = new TitleBar ();
- var topMenu = new GtkWPFWidget (titleBar) {
- HeightRequest = System.Windows.Forms.SystemInformation.CaptionHeight,
- };
+ titleBar = new TitleBar ();
+ var topMenu = new WPFTitlebar (titleBar);
+
//commandManager.IncompleteKeyPressed += (sender, e) => {
// if (e.Key == Gdk.Key.Alt_L) {
// Keyboard.Focus(titleBar.DockTitle.Children[0]);
diff --git a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
index 13557731e3..c4ab55eb00 100644
--- a/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
+++ b/main/src/addins/WindowsPlatform/WindowsPlatform/WindowsPlatform.csproj
@@ -119,6 +119,7 @@
<Compile Include="MainToolbar\Toolbar.xaml.cs">
<DependentUpon>ToolBar.xaml</DependentUpon>
</Compile>
+ <Compile Include="MainToolbar\WPFTitlebar.cs" />
<Compile Include="MainToolbar\WPFToolbar.cs" />
<Compile Include="Win32.cs" />
<Compile Include="WindowsPlatform.cs" />
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
index cd444e3d0f..f48c95b7d1 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/Windows/GtkWPFWidget.cs
@@ -67,10 +67,11 @@ namespace MonoDevelop.Components.Windows
protected virtual void RepositionWpfWindow ()
{
- RepositionWpfWindow (1);
+ int scale = (int)MonoDevelop.Components.GtkWorkarounds.GetScaleFactor(this);
+ RepositionWpfWindow (scale, scale);
}
- protected void RepositionWpfWindow (int scale)
+ protected void RepositionWpfWindow (int hscale, int vscale)
{
int x, y;
if (TranslateCoordinates (Toplevel, 0, 0, out x, out y)) {
@@ -80,8 +81,8 @@ namespace MonoDevelop.Components.Windows
wpfWidgetHost.Left = Allocation.Left;
wpfWidgetHost.Top = Allocation.Top;
}
- wpfWidgetHost.Width = (Allocation.Width + 1) * scale;
- wpfWidgetHost.Height = (Allocation.Height + 1) * scale;
+ wpfWidgetHost.Width = (Allocation.Width + 1) * hscale;
+ wpfWidgetHost.Height = (Allocation.Height + 1) * vscale;
}
protected override void OnRealized ()