mirror of https://github.com/ShareX/ShareX.git
Support closing windows with "Escape" key
This commit is contained in:
parent
f1635a44ac
commit
10c6f5e8a7
|
@ -55,7 +55,7 @@ namespace ShareX.HelpersLib
|
|||
|
||||
btnOpenLogFile.Enabled = !string.IsNullOrEmpty(Logger.LogFilePath);
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
string startupPath = AppDomain.CurrentDomain.BaseDirectory;
|
||||
llRunningFrom.Text = startupPath;
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace ShareX.HistoryLib
|
|||
public HistoryItemInfoForm(HistoryItem hi)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
pgHistoryItem.SelectedObject = hi;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace ShareX.HistoryLib
|
|||
public ImageHistorySettingsForm(ImageHistorySettings settings)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
Settings = settings;
|
||||
nudThumbnailSize.SetValue(Settings.ThumbnailSize.Width);
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace ShareX.ImageEffectsLib
|
|||
ShareXImageEffectsFolderPath = imageEffectsFolderPath;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
AssetsFolderPath = Path.Combine(ShareXImageEffectsFolderPath, ImageEffectName);
|
||||
txtAssetsFolderPath.Text = AssetsFolderPath;
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
Options = options;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
cbVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegVideoCodec>());
|
||||
cbAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions<FFmpegAudioCodec>());
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
Options = options;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
manager = new ScrollingCaptureManager(Options);
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
Options = options;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
LoadOptions();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
public ScrollingCaptureRegionForm(Rectangle regionRectangle)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, false, false);
|
||||
|
||||
borderRectangle = regionRectangle.Offset(1);
|
||||
borderRectangle0Based = new Rectangle(0, 0, borderRectangle.Width, borderRectangle.Height);
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
|
||||
InitializeComponent();
|
||||
tsMain.Renderer = new ToolStripRoundedEdgeRenderer();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
tsnudSize.NumericUpDownControl.Minimum = 16;
|
||||
tsnudSize.NumericUpDownControl.Maximum = 256;
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
Stickers = stickers;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
foreach (StickerPackInfo stickerPackInfo in Stickers)
|
||||
{
|
||||
|
|
|
@ -102,7 +102,7 @@ namespace ShareX.UploadersLib
|
|||
cbRequestMethod.Items.AddRange(Enum.GetNames(typeof(HttpMethod)));
|
||||
cbBody.Items.AddRange(Helpers.GetEnumDescriptions<CustomUploaderBody>());
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
CustomUploaderLoadTab();
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace ShareX.UploadersLib
|
|||
|
||||
rtbURLSyntax.AddContextMenu();
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
CustomUploaderSyntaxHighlight(rtbURLSyntax);
|
||||
UpdatePreview();
|
||||
|
|
|
@ -82,7 +82,7 @@ namespace ShareX.UploadersLib
|
|||
|
||||
ResumeLayout();
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
}
|
||||
|
||||
private void ParserSelectForm_Shown(object sender, EventArgs e)
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace ShareX.UploadersLib
|
|||
rtbResponseInfo.AddContextMenu();
|
||||
rtbResponseText.AddContextMenu();
|
||||
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
UpdateResult(result);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace ShareX.UploadersLib
|
|||
Config = config;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
InitializeControls();
|
||||
}
|
||||
|
|
|
@ -702,16 +702,18 @@ namespace ShareX.UploadersLib
|
|||
public UserPassBox SendSpaceRegister()
|
||||
{
|
||||
UserPassBox upb = new UserPassBox(Resources.UploadersConfigForm_SendSpaceRegister_SendSpace_Registration___, "John Doe", "john.doe@gmail.com", "JohnDoe", "");
|
||||
upb.ShowDialog();
|
||||
if (upb.DialogResult == DialogResult.OK)
|
||||
|
||||
if (upb.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
SendSpace sendSpace = new SendSpace(APIKeys.SendSpaceKey);
|
||||
upb.Success = sendSpace.AuthRegister(upb.UserName, upb.FullName, upb.Email, upb.Password);
|
||||
|
||||
if (!upb.Success && sendSpace.Errors.Count > 0)
|
||||
{
|
||||
MessageBox.Show(sendSpace.ToErrorString(), Resources.UploadersConfigForm_Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
}
|
||||
|
||||
return upb;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,25 +40,31 @@ namespace ShareX.UploadersLib
|
|||
public UserPassBox(string title, string userName, string password)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
Text = title;
|
||||
txtUserName.Text = userName;
|
||||
txtPassword.Text = password;
|
||||
}
|
||||
|
||||
public UserPassBox(string q, string fullName, string userName, string password) : this(q, userName, password)
|
||||
public UserPassBox(string title, string fullName, string userName, string password) : this(title, userName, password)
|
||||
{
|
||||
txtFullName.Text = fullName;
|
||||
txtFullName.Enabled = true;
|
||||
}
|
||||
|
||||
public UserPassBox(string q, string fullName, string email, string userName, string password) : this(q, fullName, userName, password)
|
||||
public UserPassBox(string title, string fullName, string email, string userName, string password) : this(title, fullName, userName, password)
|
||||
{
|
||||
txtEmail.Text = email;
|
||||
txtEmail.Enabled = true;
|
||||
}
|
||||
|
||||
private void InputBox_Shown(object sender, EventArgs e)
|
||||
{
|
||||
txtUserName.Focus();
|
||||
txtUserName.SelectionLength = txtUserName.Text.Length;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(txtUserName.Text))
|
||||
|
@ -67,8 +73,8 @@ namespace ShareX.UploadersLib
|
|||
Password = txtPassword.Text;
|
||||
Email = txtEmail.Text;
|
||||
FullName = txtFullName.Text;
|
||||
|
||||
DialogResult = DialogResult.OK;
|
||||
Hide();
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
@ -76,14 +82,7 @@ namespace ShareX.UploadersLib
|
|||
private void btnCancel_Click(object sender, EventArgs e)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
Hide();
|
||||
Close();
|
||||
}
|
||||
|
||||
private void InputBox_Shown(object sender, EventArgs e)
|
||||
{
|
||||
txtUserName.Focus();
|
||||
txtUserName.SelectionLength = txtUserName.Text.Length;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -38,7 +38,7 @@ namespace ShareX.UploadersLib
|
|||
public YouTubeVideoOptionsForm(string title = "", string description = "", YouTubeVideoPrivacy visibility = YouTubeVideoPrivacy.Private)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
Title = title;
|
||||
Description = description;
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace ShareX.UploadersLib
|
|||
public OAuthListenerForm(IOAuth2Loopback oauth)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
OAuth = oauth;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace ShareX
|
|||
public ActionsToolbarEditForm(List<HotkeyType> actions)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
Actions = actions;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace ShareX
|
|||
public ApplicationSettingsForm()
|
||||
{
|
||||
InitializeControls();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
}
|
||||
|
||||
private void SettingsForm_Shown(object sender, EventArgs e)
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace ShareX
|
|||
private AutoCaptureForm()
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
niTray.Icon = Resources.clock.ToIcon();
|
||||
|
||||
screenshotTimer = new System.Timers.Timer();
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace ShareX
|
|||
public TaskSettingsForm(TaskSettings hotkeySetting, bool isDefault = false)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
tsmiURLShorteners.Image = ShareXResources.IsDarkTheme ? Resources.edit_scale_white : Resources.edit_scale;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace ShareX
|
|||
public BorderlessWindowSettingsForm(BorderlessWindowSettings settings)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
Settings = settings;
|
||||
cbRememberWindowTitle.Checked = Settings.RememberWindowTitle;
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace ShareX
|
|||
public ServiceLinksForm(List<ServiceLink> serviceLinks)
|
||||
{
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
ServiceLinks = serviceLinks;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace ShareX
|
|||
Options = options;
|
||||
|
||||
InitializeComponent();
|
||||
ShareXResources.ApplyTheme(this);
|
||||
ShareXResources.ApplyTheme(this, true);
|
||||
|
||||
InitOptions();
|
||||
LoadOptions();
|
||||
|
|
Loading…
Reference in New Issue