Browse Source

Fix #356: Search and Replace dialog window does not scale with DPI setting

pull/469/head
Daniel Grunwald 11 years ago
parent
commit
68c1cd6cf7
  1. 9
      src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchAndReplaceDialog.cs
  2. 4
      src/Main/SharpDevelop/app.template.config

9
src/AddIns/Misc/SearchAndReplace/Project/Gui/SearchAndReplaceDialog.cs

@ -64,6 +64,7 @@ namespace SearchAndReplace @@ -64,6 +64,7 @@ namespace SearchAndReplace
public SearchAndReplaceDialog(SearchAndReplaceMode searchAndReplaceMode)
{
SuspendLayout();
this.FormBorderStyle = FormBorderStyle.FixedToolWindow;
this.ShowInTaskbar = false;
this.TopMost = false;
@ -94,6 +95,10 @@ namespace SearchAndReplace @@ -94,6 +95,10 @@ namespace SearchAndReplace
Controls.Add(toolStrip);
RightToLeftConverter.ConvertRecursive(this);
this.AutoScaleMode = AutoScaleMode.Dpi;
this.AutoScaleDimensions = new SizeF(96, 96);
ResumeLayout();
SetSearchAndReplaceMode();
FormLocationHelper.Apply(this, "ICSharpCode.SharpDevelop.Gui.SearchAndReplaceDialog.Location", false);
@ -144,12 +149,16 @@ namespace SearchAndReplace @@ -144,12 +149,16 @@ namespace SearchAndReplace
void SetSearchAndReplaceMode()
{
SuspendLayout();
searchAndReplacePanel.SearchAndReplaceMode = searchButton.Checked ? SearchAndReplaceMode.Search : SearchAndReplaceMode.Replace;
this.AutoScaleMode = AutoScaleMode.Dpi;
this.AutoScaleDimensions = new SizeF(96, 96);
if (searchButton.Checked) {
this.ClientSize = new Size(430, 335);
} else {
this.ClientSize = new Size(430, 385);
}
ResumeLayout();
}
/// <summary>

4
src/Main/SharpDevelop/app.template.config

@ -85,6 +85,10 @@ @@ -85,6 +85,10 @@
<!-- Use this setting to disable the code completion cache. Code completion will still be
available, but take longer to load and use more RAM. -->
<!-- <add key="domPersistencePath" value="none" /> -->
<!-- Tell WinForms to resize some components based on system DPI.
Only has an effect with .NET 4.5.2 or higher. -->
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true" />
</appSettings>
<log4net>
<!-- Writes to the console. The console is only visible in debug builds of SharpDevelop. -->

Loading…
Cancel
Save