Browse Source

Fix a couple of high-DPI problems.

pull/469/head
Daniel Grunwald 11 years ago
parent
commit
8666180860
  1. 5
      src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs
  2. 2
      src/Main/Base/Project/Resources/CommonAboutDialog.xfrm
  3. 2
      src/Main/Base/Project/Resources/NewFileDialog.xfrm
  4. 2
      src/Main/Base/Project/Resources/NewFileWithNameDialog.xfrm
  5. 2
      src/Main/ICSharpCode.Core.WinForms/MessageService/CustomDialog.cs
  6. 3
      src/Main/SharpDevelop/Logging/ExceptionBox.cs
  7. 6
      src/Main/SharpDevelop/Startup/SplashScreen.cs

5
src/AddIns/DisplayBindings/HexEditor/Project/Src/Editor.cs

@ -115,7 +115,10 @@ namespace HexEditor @@ -115,7 +115,10 @@ namespace HexEditor
selection = new SelectionManager(ref buffer);
undoStack = new UndoManager();
insertmode = true;
underscorewidth = MeasureStringWidth(this.CreateGraphics(), "_", Settings.DataFont);
using (var g = this.CreateGraphics()) {
VScrollBar.Width = (int)(VScrollBar.Width * (g.DpiX / 96f));
underscorewidth = MeasureStringWidth(g, "_", Settings.DataFont);
}
underscorewidth3 = underscorewidth * 3;
fontheight = GetFontHeight(Settings.DataFont);
selregion = new Rectangle[] {};

2
src/Main/Base/Project/Resources/CommonAboutDialog.xfrm

@ -11,6 +11,8 @@ @@ -11,6 +11,8 @@
<StartPosition value = "CenterScreen"/>
<AcceptButton value = "okButton"/>
<CancelButton value = "okButton"/>
<AutoScaleMode value = "Dpi"/>
<AutoScaleDimensions value = "{Width=96, Height=96}"/>
<Controls>

2
src/Main/Base/Project/Resources/NewFileDialog.xfrm

@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
<MinimizeBox value="False" />
<MinimumSize value="350, 190" />
<MaximizeBox value="False" />
<AutoScaleMode value="Dpi" />
<AutoScaleDimensions value="{Width=96, Height=96}" />
<ShowInTaskbar value="False" />
<Text value="${res:Dialog.NewFile.DialogName}" />
<ClientSize value="{Width=510, Height=366}" />

2
src/Main/Base/Project/Resources/NewFileWithNameDialog.xfrm

@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
<MinimumSize value="350, 200" />
<MinimizeBox value="False" />
<MaximizeBox value="False" />
<AutoScaleMode value="Dpi" />
<AutoScaleDimensions value="{Width=96, Height=96}" />
<ShowInTaskbar value="False" />
<Text value="${res:Dialog.NewFile.DialogName}" />
<ClientSize value="{Width=542, Height=372}" />

2
src/Main/ICSharpCode.Core.WinForms/MessageService/CustomDialog.cs

@ -155,6 +155,8 @@ namespace ICSharpCode.Core.WinForms @@ -155,6 +155,8 @@ namespace ICSharpCode.Core.WinForms
this.KeyPreview = true;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "CustomDialog";
this.AutoScaleMode = AutoScaleMode.Dpi;
this.AutoScaleDimensions = new SizeF(96, 96);
}
}
}

3
src/Main/SharpDevelop/Logging/ExceptionBox.cs

@ -333,11 +333,14 @@ namespace ICSharpCode.SharpDevelop.Logging @@ -333,11 +333,14 @@ namespace ICSharpCode.SharpDevelop.Logging
this.pictureBox.Location = new System.Drawing.Point(0, 0);
this.pictureBox.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(224, 464);
this.pictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox.TabIndex = 0;
this.pictureBox.TabStop = false;
//
// ExceptionBox
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(688, 453);
this.Controls.Add(this.closeButton);
this.Controls.Add(this.label3);

6
src/Main/SharpDevelop/Startup/SplashScreen.cs

@ -104,8 +104,10 @@ namespace ICSharpCode.SharpDevelop.Startup @@ -104,8 +104,10 @@ namespace ICSharpCode.SharpDevelop.Startup
}
string param = arg.Substring(markerLength);
// work around .NET "feature" that causes trouble with /addindir:"c:\temp\"
// http://www.mobzystems.com/code/bugingetcommandlineargs.aspx
// The SharpDevelop AddIn project template uses /addindir:"c:\temp\"
// but that actually means the last quote is escaped.
// This HACK makes this work anyways by replacing the trailing quote
// with a backslash:
if (param.EndsWith("\"", StringComparison.Ordinal))
param = param.Substring(0, param.Length - 1) + "\\";
parameterList.Add(param);

Loading…
Cancel
Save