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
diff options
context:
space:
mode:
authorCody Russell <cody@jhu.edu>2016-02-19 00:12:39 +0300
committerCody Russell <cody@jhu.edu>2016-04-19 21:32:25 +0300
commitc1d355a333865a00251da59b48724cccc14ea383 (patch)
tree14006db7c6c37715f99263374b9d019ca10d0eed /main/src/addins/WindowsPlatform
parentda696324139cfb16cdd7aee29cf931e18576ea4c (diff)
[hdpi] Add wrapper widget for WPF titlebar, only scale width
This fixes an issue where the titlebar was only half the width of the window in hdpi mode, and there was this region to the right of the titlebar that was a different color.
Diffstat (limited to 'main/src/addins/WindowsPlatform')
-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
4 files changed, 32 insertions, 5 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" />