mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Improve DPI support (#254)
* Improving the DPI handling for most forms, there are still issues with: * the AboutForm.Designer.cs where the title with the version scales differently. * the destination picker doesn't seem to scale the font correctly. Some parts are not tested yet... * Solved the issue with the destination picker font, and some other small issues. There still is an issue when using Powertoys (the feature which is experimental), that the capture is somehow skipping.
This commit is contained in:
parent
d8aeab5514
commit
94c778d82c
37 changed files with 216 additions and 216 deletions
|
@ -155,10 +155,16 @@ namespace GreenshotPlugin.Core {
|
|||
TopLevel = true
|
||||
};
|
||||
|
||||
menu.Opened += (sender, args) =>
|
||||
{
|
||||
var scaledIconSize = DpiHelper.ScaleWithDpi(CoreConfig.IconSize, DpiHelper.GetDpi(menu.Handle));
|
||||
menu.ImageScalingSize = scaledIconSize;
|
||||
menu.Opening += (sender, args) =>
|
||||
{
|
||||
// find the DPI settings for the screen where this is going to land
|
||||
var screenDpi = DpiHelper.GetDpi(menu.Location);
|
||||
var scaledIconSize = DpiHelper.ScaleWithDpi(CoreConfig.IconSize, screenDpi);
|
||||
menu.SuspendLayout();
|
||||
var fontSize = DpiHelper.ScaleWithDpi(12f, screenDpi);
|
||||
menu.Font = new Font(FontFamily.GenericSansSerif, fontSize, FontStyle.Regular, GraphicsUnit.Pixel);
|
||||
menu.ImageScalingSize = scaledIconSize;
|
||||
menu.ResumeLayout();
|
||||
};
|
||||
|
||||
menu.Closing += delegate(object source, ToolStripDropDownClosingEventArgs eventArgs) {
|
||||
|
@ -191,7 +197,10 @@ namespace GreenshotPlugin.Core {
|
|||
menu.MouseEnter += delegate
|
||||
{
|
||||
// in case the menu has been unfocused, focus again so that dropdown menus will still open on mouseenter
|
||||
if(!menu.ContainsFocus) menu.Focus();
|
||||
if (!menu.ContainsFocus)
|
||||
{
|
||||
menu.Focus();
|
||||
}
|
||||
};
|
||||
foreach (IDestination destination in destinations) {
|
||||
// Fix foreach loop variable for the delegate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue