FEATURE-758: Changes to test a solution for this feature request.

This commit is contained in:
RKrom 2014-10-30 12:18:07 +01:00
parent ca87bca0d1
commit be934cb91c
2 changed files with 19 additions and 0 deletions

View file

@ -54,6 +54,8 @@ namespace Greenshot.Configuration {
public bool ReuseEditor; public bool ReuseEditor;
[IniProperty("FreehandSensitivity", Description = "The smaller this number, the less smoothing is used. Decrease for detailed drawing, e.g. when using a pen. Increase for smoother lines. e.g. when you want to draw a smooth line.", DefaultValue = "3")] [IniProperty("FreehandSensitivity", Description = "The smaller this number, the less smoothing is used. Decrease for detailed drawing, e.g. when using a pen. Increase for smoother lines. e.g. when you want to draw a smooth line.", DefaultValue = "3")]
public int FreehandSensitivity; public int FreehandSensitivity;
[IniProperty("EnableButtonScaling", Description = "Experimental DPI scaling for the buttons", DefaultValue = "false")]
public bool EnableButtonScaling;
[IniProperty("SuppressSaveDialogAtClose", Description="Suppressed the 'do you want to save' dialog when closing the editor.", DefaultValue="False")] [IniProperty("SuppressSaveDialogAtClose", Description="Suppressed the 'do you want to save' dialog when closing the editor.", DefaultValue="False")]
public bool SuppressSaveDialogAtClose; public bool SuppressSaveDialogAtClose;

View file

@ -202,6 +202,8 @@ namespace Greenshot {
// //
// toolStripContainer1 // toolStripContainer1
// //
this.toolStripContainer1.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.toolStripContainer1.AutoScaleMode = System.Windows.Forms.AutoScaleMode.DPI;
// //
// toolStripContainer1.BottomToolStripPanel // toolStripContainer1.BottomToolStripPanel
// //
@ -1712,6 +1714,21 @@ namespace Greenshot {
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(785, 485); this.ClientSize = new System.Drawing.Size(785, 485);
if (editorConfiguration.EnableButtonScaling) {
using (var g = this.CreateGraphics()) {
var scale = System.Math.Max(g.DpiX, g.DpiY) / 96.0;
if (scale > 1) {
var newWidth = (int)(toolStrip1.ImageScalingSize.Width * scale);
var newHeight = (int)(toolStrip1.ImageScalingSize.Height * scale);
toolStrip1.ImageScalingSize = new System.Drawing.Size(newWidth, newHeight);
toolStrip1.AutoSize = false; //because sometime it is needed
newWidth = (int)(toolStrip2.ImageScalingSize.Width * scale);
newHeight = (int)(toolStrip2.ImageScalingSize.Height * scale);
toolStrip2.ImageScalingSize = new System.Drawing.Size(newWidth, newHeight);
toolStrip2.AutoSize = false; //because sometime it is needed
}
}
}
this.Controls.Add(this.toolStripContainer1); this.Controls.Add(this.toolStripContainer1);
this.KeyPreview = true; this.KeyPreview = true;
this.LanguageKey = "editor_title"; this.LanguageKey = "editor_title";