mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-30 20:20:34 +12:00
Use Invalidate as possible instead of Refresh
This commit is contained in:
parent
2dadad074b
commit
4aacfec76a
|
@ -57,7 +57,7 @@ public MyColor SelectedColor
|
|||
SetSliderMarker();
|
||||
}
|
||||
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ public DrawStyle DrawStyle
|
|||
SetSliderMarker();
|
||||
}
|
||||
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public override string Text
|
|||
{
|
||||
text = value;
|
||||
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,20 +97,23 @@ protected override void OnPaint(PaintEventArgs pe)
|
|||
protected override void OnMouseEnter(EventArgs e)
|
||||
{
|
||||
base.OnMouseEnter(e);
|
||||
|
||||
isHover = true;
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
isHover = false;
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
base.OnResize(e);
|
||||
|
||||
Prepare();
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public bool Checked
|
|||
|
||||
OnCheckedChanged(EventArgs.Empty);
|
||||
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public override string Text
|
|||
{
|
||||
text = value;
|
||||
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -134,15 +134,17 @@ protected override void OnPaint(PaintEventArgs pe)
|
|||
protected override void OnMouseEnter(EventArgs e)
|
||||
{
|
||||
base.OnMouseEnter(e);
|
||||
|
||||
isHover = true;
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnMouseLeave(EventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
isHover = false;
|
||||
Refresh();
|
||||
Invalidate();
|
||||
}
|
||||
|
||||
protected override void OnClick(EventArgs e)
|
||||
|
|
|
@ -54,8 +54,9 @@ public override string Text
|
|||
{
|
||||
text = value;
|
||||
|
||||
Invalidate();
|
||||
OnTextChanged(EventArgs.Empty);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,8 +47,10 @@ public Color Color
|
|||
set
|
||||
{
|
||||
color = value;
|
||||
Refresh();
|
||||
|
||||
OnColorChanged(color);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,8 +48,10 @@ public override string Text
|
|||
if (text != value)
|
||||
{
|
||||
text = value;
|
||||
Refresh();
|
||||
|
||||
OnTextChanged(EventArgs.Empty);
|
||||
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -274,7 +274,7 @@ private void PbThumbnail_MouseClick(object sender, MouseEventArgs e)
|
|||
pbThumbnail.Enabled = true;
|
||||
}
|
||||
}
|
||||
else if (Helpers.IsTextFile(filePath) || Helpers.IsVideoFile(filePath) || MessageBox.Show("Would you like to run this file?" + "\r\n\r\n" + filePath,
|
||||
else if (Helpers.IsTextFile(filePath) || Helpers.IsVideoFile(filePath) || MessageBox.Show("Would you like to open this file?" + "\r\n\r\n" + filePath,
|
||||
Resources.ShareXConfirmation, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||||
{
|
||||
Helpers.OpenFile(filePath);
|
||||
|
|
|
@ -56,6 +56,7 @@ private void MainForm_HandleCreated(object sender, EventArgs e)
|
|||
{
|
||||
RunPuushTasks();
|
||||
|
||||
NativeMethods.UseImmersiveDarkMode(Handle, ShareXResources.UseDarkTheme);
|
||||
UpdateControls();
|
||||
|
||||
DebugHelper.WriteLine("Startup time: {0} ms", Program.StartTimer.ElapsedMilliseconds);
|
||||
|
@ -66,8 +67,6 @@ private void MainForm_HandleCreated(object sender, EventArgs e)
|
|||
{
|
||||
TaskHelpers.OpenActionsToolbar();
|
||||
}
|
||||
|
||||
NativeMethods.UseImmersiveDarkMode(Handle, ShareXResources.UseDarkTheme);
|
||||
}
|
||||
|
||||
private void InitializeControls()
|
||||
|
@ -734,10 +733,10 @@ private void UpdateContextMenu(WorkerTask task = null)
|
|||
}
|
||||
|
||||
tsmiClearList.Visible = tssUploadInfo1.Visible = lvUploads.Items.Count > 0;
|
||||
|
||||
tsmiHideColumns.Visible = tsmiImagePreview.Visible = Program.Settings.TaskViewMode == TaskViewMode.ListView;
|
||||
|
||||
cmsTaskInfo.ResumeLayout();
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue