1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-01-24 21:46:03 +01:00

Tweak JS prompt dialog layout on high DPI

This commit is contained in:
chylex 2017-08-01 15:06:09 +02:00
parent a673957bd0
commit 77e656d8e4

View File

@ -4,6 +4,7 @@
using CefSharp.WinForms;
using TweetDuck.Core.Controls;
using TweetDuck.Core.Other;
using TweetDuck.Core.Utils;
namespace TweetDuck.Core.Handling.General{
class JavaScriptDialogHandler : IJsDialogHandler{
@ -26,10 +27,12 @@ bool IJsDialogHandler.OnJSDialog(IWebBrowser browserControl, IBrowser browser, s
form.AddButton(FormMessage.Cancel, DialogResult.Cancel, ControlType.Cancel);
form.AddButton(FormMessage.OK, ControlType.Accept | ControlType.Focused);
float dpiScale = form.GetDPIScale();
input = new TextBox{
Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Bottom,
Location = new Point(22, form.ActionPanelY-46),
Size = new Size(form.ClientSize.Width-44, 20)
Location = new Point(BrowserUtils.Scale(22, dpiScale), form.ActionPanelY-BrowserUtils.Scale(46, dpiScale)),
Size = new Size(form.ClientSize.Width-BrowserUtils.Scale(44, dpiScale), 20)
};
form.Controls.Add(input);