From 76b684e938b3e55f418810b9bd53086e46a18596 Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 30 Apr 2021 06:20:19 +0300 Subject: [PATCH 1/3] Move ScreenRecordForm to ScreenCaptureLib --- ShareX.HelpersLib/Helpers/Helpers.cs | 34 ++++ ShareX.ScreenCaptureLib/Enums.cs | 5 + .../Forms/ScreenRecordForm.Designer.cs | 6 +- .../Forms/ScreenRecordForm.cs | 43 +++-- .../Forms/ScreenRecordForm.de.resx | 0 .../Forms/ScreenRecordForm.es-MX.resx | 0 .../Forms/ScreenRecordForm.es.resx | 0 .../Forms/ScreenRecordForm.fa-IR.resx | 0 .../Forms/ScreenRecordForm.fr.resx | 0 .../Forms/ScreenRecordForm.hu.resx | 0 .../Forms/ScreenRecordForm.id-ID.resx | 0 .../Forms/ScreenRecordForm.it-IT.resx | 0 .../Forms/ScreenRecordForm.ja-JP.resx | 0 .../Forms/ScreenRecordForm.ko-KR.resx | 0 .../Forms/ScreenRecordForm.nl-NL.resx | 0 .../Forms/ScreenRecordForm.pt-BR.resx | 0 .../Forms/ScreenRecordForm.pt-PT.resx | 0 .../Forms/ScreenRecordForm.resx | 0 .../Forms/ScreenRecordForm.ru.resx | 0 .../Forms/ScreenRecordForm.tr.resx | 0 .../Forms/ScreenRecordForm.uk.resx | 0 .../Forms/ScreenRecordForm.vi-VN.resx | 0 .../Forms/ScreenRecordForm.zh-CN.resx | 0 .../Forms/ScreenRecordForm.zh-TW.resx | 0 .../Properties/Resources.Designer.cs | 93 +++++++++++ .../Properties/Resources.resx | 34 ++++ .../Resources/camcorder--pencil.png | Bin 0 -> 723 bytes .../Resources/control-record-yellow.png | Bin 0 -> 522 bytes .../Resources/control-record.png | Bin 0 -> 484 bytes .../ShareX.ScreenCaptureLib.csproj | 69 ++++++++ ShareX/Enums.cs | 5 - ShareX/Properties/Resources.Designer.cs | 158 +++++++----------- ShareX/Properties/Resources.resx | 59 +++---- ShareX/ScreenRecordManager.cs | 12 +- ShareX/ShareX.csproj | 66 -------- ShareX/TaskHelpers.cs | 42 +---- ShareX/TaskManager.cs | 2 +- 37 files changed, 348 insertions(+), 280 deletions(-) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.Designer.cs (95%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.cs (88%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.de.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.es-MX.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.es.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.fa-IR.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.fr.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.hu.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.id-ID.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.it-IT.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.ja-JP.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.ko-KR.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.nl-NL.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.pt-BR.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.pt-PT.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.ru.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.tr.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.uk.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.vi-VN.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.zh-CN.resx (100%) rename {ShareX => ShareX.ScreenCaptureLib}/Forms/ScreenRecordForm.zh-TW.resx (100%) create mode 100644 ShareX.ScreenCaptureLib/Resources/camcorder--pencil.png create mode 100644 ShareX.ScreenCaptureLib/Resources/control-record-yellow.png create mode 100644 ShareX.ScreenCaptureLib/Resources/control-record.png diff --git a/ShareX.HelpersLib/Helpers/Helpers.cs b/ShareX.HelpersLib/Helpers/Helpers.cs index 808247640..45f57d97f 100644 --- a/ShareX.HelpersLib/Helpers/Helpers.cs +++ b/ShareX.HelpersLib/Helpers/Helpers.cs @@ -1612,5 +1612,39 @@ public static IEnumerable GetFilesByExtensions(DirectoryInfo directoryIn HashSet allowedExtensions = new HashSet(extensions, StringComparer.OrdinalIgnoreCase); return directoryInfo.EnumerateFiles().Where(f => allowedExtensions.Contains(f.Extension)).Select(x => x.FullName); } + + public static Icon GetProgressIcon(int percentage) + { + return GetProgressIcon(percentage, Color.FromArgb(16, 116, 193)); + } + + public static Icon GetProgressIcon(int percentage, Color color) + { + percentage = percentage.Clamp(0, 99); + + Size size = SystemInformation.SmallIconSize; + using (Bitmap bmp = new Bitmap(size.Width, size.Height)) + using (Graphics g = Graphics.FromImage(bmp)) + { + int y = (int)(size.Height * (percentage / 100f)); + + if (y > 0) + { + using (Brush brush = new SolidBrush(color)) + { + g.FillRectangle(brush, 0, size.Height - 1 - y, size.Width, y); + } + } + + using (Font font = new Font("Arial", 10)) + using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }) + { + g.DrawString(percentage.ToString(), font, Brushes.Black, size.Width / 2f, size.Height / 2f, sf); + g.DrawString(percentage.ToString(), font, Brushes.White, size.Width / 2f, (size.Height / 2f) - 1, sf); + } + + return Icon.FromHandle(bmp.GetHicon()); + } + } } } \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Enums.cs b/ShareX.ScreenCaptureLib/Enums.cs index 032d5ab86..dda6c155f 100644 --- a/ShareX.ScreenCaptureLib/Enums.cs +++ b/ShareX.ScreenCaptureLib/Enums.cs @@ -333,4 +333,9 @@ public enum BorderStyle DashDot, DashDotDot } + + public enum ScreenRecordState + { + Waiting, BeforeStart, AfterStart, AfterRecordingStart, Encoding + } } \ No newline at end of file diff --git a/ShareX/Forms/ScreenRecordForm.Designer.cs b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs similarity index 95% rename from ShareX/Forms/ScreenRecordForm.Designer.cs rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs index 71a509d06..7f9f927c0 100644 --- a/ShareX/Forms/ScreenRecordForm.Designer.cs +++ b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.Designer.cs @@ -1,4 +1,4 @@ -namespace ShareX +namespace ShareX.ScreenCaptureLib { partial class ScreenRecordForm { @@ -75,14 +75,14 @@ private void InitializeComponent() // // tsmiStart // - this.tsmiStart.Image = global::ShareX.Properties.Resources.control_record; + this.tsmiStart.Image = global::ShareX.ScreenCaptureLib.Properties.Resources.control_record; this.tsmiStart.Name = "tsmiStart"; resources.ApplyResources(this.tsmiStart, "tsmiStart"); this.tsmiStart.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnStart_MouseClick); // // tsmiAbort // - this.tsmiAbort.Image = global::ShareX.Properties.Resources.cross; + this.tsmiAbort.Image = global::ShareX.ScreenCaptureLib.Properties.Resources.cross; this.tsmiAbort.Name = "tsmiAbort"; resources.ApplyResources(this.tsmiAbort, "tsmiAbort"); this.tsmiAbort.MouseUp += new System.Windows.Forms.MouseEventHandler(this.btnAbort_MouseClick); diff --git a/ShareX/Forms/ScreenRecordForm.cs b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs similarity index 88% rename from ShareX/Forms/ScreenRecordForm.cs rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs index 0c671f22d..894eb82cc 100644 --- a/ShareX/Forms/ScreenRecordForm.cs +++ b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.cs @@ -24,14 +24,14 @@ You should have received a copy of the GNU General Public License #endregion License Information (GPL v3) using ShareX.HelpersLib; -using ShareX.Properties; +using ShareX.ScreenCaptureLib.Properties; using System; using System.Diagnostics; using System.Drawing; using System.Threading; using System.Windows.Forms; -namespace ShareX +namespace ShareX.ScreenCaptureLib { public partial class ScreenRecordForm : Form { @@ -46,24 +46,21 @@ public partial class ScreenRecordForm : Form public bool IsStopRequested { get; private set; } public bool IsAbortRequested { get; private set; } - private TaskSettings taskSettings; + public bool ActivateWindow { get; set; } = true; + public float Duration { get; set; } = 0; + public bool AskConfirmationOnAbort { get; set; } = false; + private Color borderColor = Color.Red; private Rectangle borderRectangle; private Rectangle borderRectangle0Based; - private bool activateWindow; - private float duration; private static int lastIconStatus = -1; - public ScreenRecordForm(Rectangle regionRectangle, TaskSettings taskSettings, bool activateWindow = true, float duration = 0) + public ScreenRecordForm(Rectangle regionRectangle) { InitializeComponent(); Icon = ShareXResources.Icon; niTray.Icon = ShareXResources.Icon; - this.taskSettings = taskSettings; - this.activateWindow = activateWindow; - this.duration = duration; - borderRectangle = regionRectangle.Offset(1); borderRectangle0Based = new Rectangle(0, 0, borderRectangle.Width, borderRectangle.Height); @@ -97,7 +94,7 @@ protected override bool ShowWithoutActivation { get { - return !activateWindow; + return !ActivateWindow; } } @@ -131,7 +128,7 @@ protected override void Dispose(bool disposing) private void ScreenRegionForm_Shown(object sender, EventArgs e) { - if (activateWindow) + if (ActivateWindow) { this.ForceActivate(); } @@ -167,8 +164,8 @@ public void StartCountdown(int milliseconds) public void StartRecordingTimer() { - IsCountdown = duration > 0; - Countdown = TimeSpan.FromSeconds(duration); + IsCountdown = Duration > 0; + Countdown = TimeSpan.FromSeconds(Duration); lblTimer.ForeColor = Color.White; borderColor = Color.FromArgb(0, 255, 0); @@ -229,8 +226,8 @@ private void btnAbort_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { - if (!taskSettings.CaptureSettings.ScreenRecordAskConfirmationOnAbort || - MessageBox.Show(Resources.ScreenRecord_ConfirmCancel, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) + if (!AskConfirmationOnAbort || MessageBox.Show(Resources.ScreenRecordForm_ConfirmCancel, "ShareX", MessageBoxButtons.YesNo, + MessageBoxIcon.Warning) == DialogResult.Yes) { AbortRecording(); } @@ -278,7 +275,7 @@ public void ChangeState(ScreenRecordState state) case ScreenRecordState.BeforeStart: string trayTextBeforeStart = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_; niTray.Text = trayTextBeforeStart.Truncate(63); - tsmiStart.Text = Resources.AutoCaptureForm_Execute_Start; + tsmiStart.Text = Resources.ScreenRecordForm_Start; cmsMain.Enabled = true; break; case ScreenRecordState.AfterStart: @@ -286,8 +283,8 @@ public void ChangeState(ScreenRecordState state) string trayTextAfterStart = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Click_tray_icon_to_stop_recording_; niTray.Text = trayTextAfterStart.Truncate(63); niTray.Icon = Resources.control_record.ToIcon(); - tsmiStart.Text = Resources.AutoCaptureForm_Execute_Stop; - btnStart.Text = Resources.AutoCaptureForm_Execute_Stop; + tsmiStart.Text = Resources.ScreenRecordForm_Stop; + btnStart.Text = Resources.ScreenRecordForm_Stop; break; case ScreenRecordState.AfterRecordingStart: IsRecording = true; @@ -297,7 +294,7 @@ public void ChangeState(ScreenRecordState state) Hide(); string trayTextAfterStop = "ShareX - " + Resources.ScreenRecordForm_StartRecording_Encoding___; niTray.Text = trayTextAfterStop.Truncate(63); - niTray.Icon = Resources.camcorder_pencil.ToIcon(); + niTray.Icon = Resources.camcorder__pencil.ToIcon(); cmsMain.Enabled = false; break; } @@ -316,19 +313,19 @@ public void ChangeStateProgress(int progress) { try { - icon = TaskHelpers.GetProgressIcon(progress, Color.FromArgb(140, 0, 36)); + icon = Helpers.GetProgressIcon(progress, Color.FromArgb(140, 0, 36)); } catch (Exception e) { DebugHelper.WriteException(e); progress = -1; if (lastIconStatus == progress) return; - icon = Resources.camcorder_pencil.ToIcon(); + icon = Resources.camcorder__pencil.ToIcon(); } } else { - icon = Resources.camcorder_pencil.ToIcon(); + icon = Resources.camcorder__pencil.ToIcon(); } using (Icon oldIcon = niTray.Icon) diff --git a/ShareX/Forms/ScreenRecordForm.de.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.de.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.de.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.de.resx diff --git a/ShareX/Forms/ScreenRecordForm.es-MX.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.es-MX.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.es-MX.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.es-MX.resx diff --git a/ShareX/Forms/ScreenRecordForm.es.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.es.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.es.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.es.resx diff --git a/ShareX/Forms/ScreenRecordForm.fa-IR.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.fa-IR.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.fa-IR.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.fa-IR.resx diff --git a/ShareX/Forms/ScreenRecordForm.fr.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.fr.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.fr.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.fr.resx diff --git a/ShareX/Forms/ScreenRecordForm.hu.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.hu.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.hu.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.hu.resx diff --git a/ShareX/Forms/ScreenRecordForm.id-ID.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.id-ID.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.id-ID.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.id-ID.resx diff --git a/ShareX/Forms/ScreenRecordForm.it-IT.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.it-IT.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.it-IT.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.it-IT.resx diff --git a/ShareX/Forms/ScreenRecordForm.ja-JP.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.ja-JP.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.ja-JP.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.ja-JP.resx diff --git a/ShareX/Forms/ScreenRecordForm.ko-KR.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.ko-KR.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.ko-KR.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.ko-KR.resx diff --git a/ShareX/Forms/ScreenRecordForm.nl-NL.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.nl-NL.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.nl-NL.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.nl-NL.resx diff --git a/ShareX/Forms/ScreenRecordForm.pt-BR.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.pt-BR.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.pt-BR.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.pt-BR.resx diff --git a/ShareX/Forms/ScreenRecordForm.pt-PT.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.pt-PT.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.pt-PT.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.pt-PT.resx diff --git a/ShareX/Forms/ScreenRecordForm.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.resx diff --git a/ShareX/Forms/ScreenRecordForm.ru.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.ru.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.ru.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.ru.resx diff --git a/ShareX/Forms/ScreenRecordForm.tr.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.tr.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.tr.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.tr.resx diff --git a/ShareX/Forms/ScreenRecordForm.uk.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.uk.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.uk.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.uk.resx diff --git a/ShareX/Forms/ScreenRecordForm.vi-VN.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.vi-VN.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.vi-VN.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.vi-VN.resx diff --git a/ShareX/Forms/ScreenRecordForm.zh-CN.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.zh-CN.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.zh-CN.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.zh-CN.resx diff --git a/ShareX/Forms/ScreenRecordForm.zh-TW.resx b/ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.zh-TW.resx similarity index 100% rename from ShareX/Forms/ScreenRecordForm.zh-TW.resx rename to ShareX.ScreenCaptureLib/Forms/ScreenRecordForm.zh-TW.resx diff --git a/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs b/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs index e153eccd1..652051384 100644 --- a/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs +++ b/ShareX.ScreenCaptureLib/Properties/Resources.Designer.cs @@ -119,6 +119,16 @@ internal static string BaseRegionForm_InitializeComponent_Region_capture { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap camcorder__pencil { + get { + object obj = ResourceManager.GetObject("camcorder__pencil", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -178,6 +188,26 @@ internal static System.Drawing.Bitmap control { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap control_record { + get { + object obj = ResourceManager.GetObject("control_record", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap control_record_yellow { + get { + object obj = ResourceManager.GetObject("control_record_yellow", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -1254,6 +1284,69 @@ internal static string RegionCaptureForm_TipYouCanPanImageByHoldingMouseMiddleBu } } + /// + /// Looks up a localized string similar to Are you sure you want to abort this recording?. + /// + internal static string ScreenRecordForm_ConfirmCancel { + get { + return ResourceManager.GetString("ScreenRecordForm_ConfirmCancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + internal static string ScreenRecordForm_Start { + get { + return ResourceManager.GetString("ScreenRecordForm_Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Click to start recording.. + /// + internal static string ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_ { + get { + return ResourceManager.GetString("ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Click to stop recording.. + /// + internal static string ScreenRecordForm_StartRecording_Click_tray_icon_to_stop_recording_ { + get { + return ResourceManager.GetString("ScreenRecordForm_StartRecording_Click_tray_icon_to_stop_recording_", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Encoding.... + /// + internal static string ScreenRecordForm_StartRecording_Encoding___ { + get { + return ResourceManager.GetString("ScreenRecordForm_StartRecording_Encoding___", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Waiting.... + /// + internal static string ScreenRecordForm_StartRecording_Waiting___ { + get { + return ResourceManager.GetString("ScreenRecordForm_StartRecording_Waiting___", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + internal static string ScreenRecordForm_Stop { + get { + return ResourceManager.GetString("ScreenRecordForm_Stop", resourceCulture); + } + } + /// /// Looks up a localized string similar to Stop capture. /// diff --git a/ShareX.ScreenCaptureLib/Properties/Resources.resx b/ShareX.ScreenCaptureLib/Properties/Resources.resx index bc7419f85..742d5e4da 100644 --- a/ShareX.ScreenCaptureLib/Properties/Resources.resx +++ b/ShareX.ScreenCaptureLib/Properties/Resources.resx @@ -740,4 +740,38 @@ X: {4} Y: {5} Step type: + + ..\Resources\camcorder--pencil.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\control-record.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\control-record-yellow.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Are you sure you want to abort this recording? + + + Click to start recording. + Text must be equal to or lower than 54 characters because of tray icon text length limit. + + + Click to stop recording. + Text must be equal to or lower than 54 characters because of tray icon text length limit. + + + Encoding... + Text must be equal to or lower than 54 characters because of tray icon text length limit. + + + Waiting... + Text must be equal to or lower than 54 characters because of tray icon text length limit. + + + Start + + + Stop + \ No newline at end of file diff --git a/ShareX.ScreenCaptureLib/Resources/camcorder--pencil.png b/ShareX.ScreenCaptureLib/Resources/camcorder--pencil.png new file mode 100644 index 0000000000000000000000000000000000000000..ce59eb4304d3676bf130aa85598e8ed177fe1da2 GIT binary patch literal 723 zcmV;^0xbQBP)>#6>p6LN_JQEK3_xNEg*2b!QO~TG0N2+S06AT{JZm zjY-5jOou#X(kA0MmrOS)=z(v}+;h+O-E+>|kt9jN)YKGYS@r<1;~y3Zg>IAkO1LUK z34}<%ABjZf46^O*ZKKg>w7`rnEiD#`M6AycPdpRVtfW>aN_vdms9334&(=@o|P%d=Q4B9Ye~k4JdZ%s98n9Kv0p z#7HKS-%_a*j*pK;A}5tfC8(;3Y&MHbCL`jU(-e^3(qpqJ@Fg4$FHnyQG-Z*fswET( zht!rvqJ}t-pRZq~~-VUp^L(Jf8 zclUXx&*$Eqp6*gyE|*Z}YG@1?9v-E6=tOFOD`N0_M~4m2cSUQf`}-H~^!2@XVi@a+ z)9EyaCCPFdY&I*Q^$uw27ILZAcr`PGo}Qj02`@hac9eKLZsuG|Boc7BuC$P=ho6!E zv51k8AW;}Z!y_+19Zk_2oJ>jna0{|vgd%58xGHw6>002ovPDHLk FV1nsRM|S`K literal 0 HcmV?d00001 diff --git a/ShareX.ScreenCaptureLib/Resources/control-record-yellow.png b/ShareX.ScreenCaptureLib/Resources/control-record-yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..82eade0591770313f53d20e6e2c7231bd92e92c8 GIT binary patch literal 522 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0gN_s>q|Kw~RCT^vI!{FhGLsP7yo((b>-SE9sZMw}CmPL2@I){d6en+YHE1v>XQ zDjmG$!XulNv2>N|UPl4l^~~#|a<}p--Ev#>{;0wc;dM`C->div-{~@{vHbq;oc?`T zJ%va6AGB=^uspJdA>FRwixtOAg$}hzok8=Io^Dxw&!5TNjKk=3X=a2>Vuf{DLgAFX zsn({aGXGC@Fo>UMXulviQKI)x0;>*>;=M1gHSJGadCavaPeA^$?5od}@^&h__J5r6 z>foe1i-P*KId(f#o&2&XX^Cv->%Cz<`KFIIUhi{%S7lQWX(*YK1k_nJ-O(`Ka9tUT z58Im+6>BRVZLCoe%`jPUTr|hpQOouA4c8N0(-&Il?evviEEoPD-eiB?V#mGqTNa41 z=`CNq0BFaDGmRUzF>Dgs`0{7%&*g** zORRw&j0(qilT2CC@WYTH-=Jn0Y zD+z)C);Sxn=1DD*8$!O>B!ChDILEY(QNVb^&`@WK0}KS-oGz(Otq>lk6-C`|H1>AO z<(#Z2vP&r&_xp`|O*`R~s)*?<7m&pat_dk+6y@ru**px=>8$VjKOjkxfX`-@)^2y* z+3eyh2nI0)9?Cwb)hecKXFbo0^@=3fVzpY)d%du|%NPNEub#=}@)N^|2pI!PDNx%6 zhIyzckMI3xHjt#C;0qz6M6gX094uV4mzqc5IIaAgPb;lVCA>1ug9bO+@cYJ4A-47wu5SQ4(oTM`q;^~Fbm=h7$%B>XtGSa{OOluQ- a2`~Uk>%{1npeZ*10000 ImageSizeForm.cs + + Form + + + ScreenRecordForm.cs + Form @@ -332,6 +338,9 @@ + + + @@ -579,6 +588,66 @@ NewImageForm.cs + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + + + ScreenRecordForm.cs + ScrollingCaptureForm.cs diff --git a/ShareX/Enums.cs b/ShareX/Enums.cs index a70d6e649..9afdd518c 100644 --- a/ShareX/Enums.cs +++ b/ShareX/Enums.cs @@ -286,11 +286,6 @@ public enum ThumbnailTitleLocation Top, Bottom } - public enum ScreenRecordState - { - Waiting, BeforeStart, AfterStart, AfterRecordingStart, Encoding - } - public enum RegionCaptureType { Default, Light, Transparent diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index f2a7121b4..762e68b7b 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -1340,6 +1340,62 @@ public static string FailedToSaveSettings { } } + /// + /// Looks up a localized string similar to {0} does not exist. + /// + ///Would you like to automatically download it?. + /// + public static string FFmpeg_does_not_exist { + get { + return ResourceManager.GetString("FFmpeg_does_not_exist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Download of FFmpeg failed.. + /// + public static string FFmpeg_Download_of_FFmpeg_failed { + get { + return ResourceManager.GetString("FFmpeg_Download_of_FFmpeg_failed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FFmpeg error. + /// + public static string FFmpeg_FFmpeg_error { + get { + return ResourceManager.GetString("FFmpeg_FFmpeg_error", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FFmpeg successfully downloaded.. + /// + public static string FFmpeg_FFmpeg_successfully_downloaded { + get { + return ResourceManager.GetString("FFmpeg_FFmpeg_successfully_downloaded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to FFmpeg video and audio source can't both be "None".. + /// + public static string FFmpeg_FFmpeg_video_and_audio_source_both_can_t_be__None__ { + get { + return ResourceManager.GetString("FFmpeg_FFmpeg_video_and_audio_source_both_can_t_be__None__", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Missing. + /// + public static string FFmpeg_Missing { + get { + return ResourceManager.GetString("FFmpeg_Missing", resourceCulture); + } + } + /// /// Looks up a localized string similar to Use new name: . /// @@ -2309,108 +2365,6 @@ public static string ScreenColorPicker { } } - /// - /// Looks up a localized string similar to Are you sure you want to abort this recording?. - /// - public static string ScreenRecord_ConfirmCancel { - get { - return ResourceManager.GetString("ScreenRecord_ConfirmCancel", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Download of FFmpeg failed.. - /// - public static string ScreenRecordForm_DownloaderForm_InstallRequested_Download_of_FFmpeg_failed_ { - get { - return ResourceManager.GetString("ScreenRecordForm_DownloaderForm_InstallRequested_Download_of_FFmpeg_failed_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FFmpeg successfully downloaded.. - /// - public static string ScreenRecordForm_DownloaderForm_InstallRequested_FFmpeg_successfully_downloaded_ { - get { - return ResourceManager.GetString("ScreenRecordForm_DownloaderForm_InstallRequested_FFmpeg_successfully_downloaded_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Click to start recording.. - /// - public static string ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_ { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_Click_tray_icon_to_start_recording_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Click to stop recording.. - /// - public static string ScreenRecordForm_StartRecording_Click_tray_icon_to_stop_recording_ { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_Click_tray_icon_to_stop_recording_", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} does not exist. - /// - ///Would you like to automatically download it?. - /// - public static string ScreenRecordForm_StartRecording_does_not_exist { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_does_not_exist", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Encoding.... - /// - public static string ScreenRecordForm_StartRecording_Encoding___ { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_Encoding___", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FFmpeg error. - /// - public static string ScreenRecordForm_StartRecording_FFmpeg_error { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_FFmpeg_error", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to FFmpeg video and audio source can't both be "None".. - /// - public static string ScreenRecordForm_StartRecording_FFmpeg_video_and_audio_source_both_can_t_be__None__ { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_FFmpeg_video_and_audio_source_both_can_t_be__None" + - "__", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Missing. - /// - public static string ScreenRecordForm_StartRecording_Missing { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_Missing", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Waiting.... - /// - public static string ScreenRecordForm_StartRecording_Waiting___ { - get { - return ResourceManager.GetString("ScreenRecordForm_StartRecording_Waiting___", resourceCulture); - } - } - /// /// Looks up a localized string similar to Screenshot delay: {0}s. /// diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index 5aa39d07e..e338ede8f 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -297,9 +297,6 @@ Would you like to restart ShareX? Disable hotkeys - - FFmpeg video and audio source can't both be "None". - Reset all quick tasks to defaults? @@ -367,9 +364,6 @@ Press 'No' to cancel the current upload and disable screenshot auto uploading. ..\Resources\layer-transparent.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Download of FFmpeg failed. - Input text to encode @@ -492,10 +486,6 @@ Are you sure you want to continue? ..\Resources\application-home.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Encoding... - Text must be equal to or lower than 54 characters because of tray icon text length limit. - ..\Resources\drive-globe.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -520,9 +510,6 @@ Are you sure you want to continue? Shorten URL ({0}) - - FFmpeg error - Separator @@ -585,10 +572,6 @@ You can later disable it from "After capture tasks" menu. Edit with ShareX - - Click to start recording. - Text must be equal to or lower than 54 characters because of tray icon text length limit. - Error @@ -610,9 +593,6 @@ You can later disable it from "After capture tasks" menu. ..\Resources\keyboard--plus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - FFmpeg successfully downloaded. - After capture: {0} @@ -676,9 +656,6 @@ You can later disable it from "After capture tasks" menu. Continue - - Missing - ..\Resources\arrow-270.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -795,9 +772,6 @@ Would you like to restart ShareX? ..\Resources\traffic-cone.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Are you sure you want to abort this recording? - You can add workflows from hotkey settings... @@ -890,10 +864,6 @@ Please run ShareX as administrator to change personal folder path. ..\Resources\disk.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Waiting... - Text must be equal to or lower than 54 characters because of tray icon text length limit. - ..\Resources\uac.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -924,11 +894,6 @@ Please run ShareX as administrator to change personal folder path. Failed to save settings - - {0} does not exist. - -Would you like to automatically download it? - ..\Resources\Twitter-32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -1039,10 +1004,6 @@ Middle click to close ..\Resources\drive-upload.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - Click to stop recording. - Text must be equal to or lower than 54 characters because of tray icon text length limit. - ..\Resources\cross.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -1101,4 +1062,24 @@ Middle click to close ..\Resources\Twitter-16x16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + {0} does not exist. + +Would you like to automatically download it? + + + Download of FFmpeg failed. + + + FFmpeg error + + + FFmpeg successfully downloaded. + + + FFmpeg video and audio source can't both be "None". + + + Missing + \ No newline at end of file diff --git a/ShareX/ScreenRecordManager.cs b/ShareX/ScreenRecordManager.cs index ad6f43aae..be9a91b8e 100644 --- a/ShareX/ScreenRecordManager.cs +++ b/ShareX/ScreenRecordManager.cs @@ -105,8 +105,8 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t if (!taskSettings.CaptureSettings.FFmpegOptions.IsSourceSelected) { - MessageBox.Show(Resources.ScreenRecordForm_StartRecording_FFmpeg_video_and_audio_source_both_can_t_be__None__, - "ShareX - " + Resources.ScreenRecordForm_StartRecording_FFmpeg_error, MessageBoxButtons.OK, MessageBoxIcon.Warning); + MessageBox.Show(Resources.FFmpeg_FFmpeg_video_and_audio_source_both_can_t_be__None__, + "ShareX - " + Resources.FFmpeg_FFmpeg_error, MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } @@ -164,7 +164,13 @@ private static void StartRecording(ScreenRecordOutput outputType, TaskSettings t float duration = taskSettings.CaptureSettings.ScreenRecordFixedDuration ? taskSettings.CaptureSettings.ScreenRecordDuration : 0; - recordForm = new ScreenRecordForm(captureRectangle, taskSettings, startMethod == ScreenRecordStartMethod.Region, duration); + recordForm = new ScreenRecordForm(captureRectangle) + { + ActivateWindow = startMethod == ScreenRecordStartMethod.Region, + Duration = duration, + AskConfirmationOnAbort = taskSettings.CaptureSettings.ScreenRecordAskConfirmationOnAbort + }; + recordForm.StopRequested += StopRecording; recordForm.Show(); diff --git a/ShareX/ShareX.csproj b/ShareX/ShareX.csproj index 2e3cbbf1b..5121879e4 100644 --- a/ShareX/ShareX.csproj +++ b/ShareX/ShareX.csproj @@ -296,12 +296,6 @@ - - Form - - - ScreenRecordForm.cs - Form @@ -1427,78 +1421,18 @@ QuickTaskMenuEditorForm.cs - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - ApplicationSettingsForm.cs MainForm.cs - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - - - ScreenRecordForm.cs - FirstTimeConfigForm.cs ActionsToolbarEditForm.cs - - ScreenRecordForm.cs - TaskSettingsForm.cs Designer diff --git a/ShareX/TaskHelpers.cs b/ShareX/TaskHelpers.cs index 3c8a62f9f..eb0e2942a 100644 --- a/ShareX/TaskHelpers.cs +++ b/ShareX/TaskHelpers.cs @@ -651,40 +651,6 @@ private static void AddExternalProgramFromRegistry(TaskSettings taskSettings, st } } - public static Icon GetProgressIcon(int percentage) - { - return GetProgressIcon(percentage, Color.FromArgb(16, 116, 193)); - } - - public static Icon GetProgressIcon(int percentage, Color color) - { - percentage = percentage.Clamp(0, 99); - - Size size = SystemInformation.SmallIconSize; - using (Bitmap bmp = new Bitmap(size.Width, size.Height)) - using (Graphics g = Graphics.FromImage(bmp)) - { - int y = (int)(size.Height * (percentage / 100f)); - - if (y > 0) - { - using (Brush brush = new SolidBrush(color)) - { - g.FillRectangle(brush, 0, size.Height - 1 - y, size.Width, y); - } - } - - using (Font font = new Font("Arial", 10)) - using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center }) - { - g.DrawString(percentage.ToString(), font, Brushes.Black, size.Width / 2f, size.Height / 2f, sf); - g.DrawString(percentage.ToString(), font, Brushes.White, size.Width / 2f, (size.Height / 2f) - 1, sf); - } - - return Icon.FromHandle(bmp.GetHicon()); - } - } - public static string HandleExistsFile(string folder, string filename, TaskSettings taskSettings) { string filepath = Path.Combine(folder, filename); @@ -1375,8 +1341,8 @@ public static bool CheckFFmpeg(TaskSettings taskSettings) if (!File.Exists(ffmpegPath)) { - if (MessageBox.Show(string.Format(Resources.ScreenRecordForm_StartRecording_does_not_exist, ffmpegPath), - "ShareX - " + Resources.ScreenRecordForm_StartRecording_Missing + " ffmpeg.exe", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) + if (MessageBox.Show(string.Format(Resources.FFmpeg_does_not_exist, ffmpegPath), + "ShareX - " + Resources.FFmpeg_Missing + " ffmpeg.exe", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes) { DialogResult downloadDialogResult = FFmpegGitHubDownloader.DownloadFFmpeg(false, DownloaderForm_InstallRequested); @@ -1410,11 +1376,11 @@ private static void DownloaderForm_InstallRequested(string filePath) if (result) { - MessageBox.Show(Resources.ScreenRecordForm_DownloaderForm_InstallRequested_FFmpeg_successfully_downloaded_, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information); + MessageBox.Show(Resources.FFmpeg_FFmpeg_successfully_downloaded, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { - MessageBox.Show(Resources.ScreenRecordForm_DownloaderForm_InstallRequested_Download_of_FFmpeg_failed_, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error); + MessageBox.Show(Resources.FFmpeg_Download_of_FFmpeg_failed, "ShareX", MessageBoxButtons.OK, MessageBoxIcon.Error); } } diff --git a/ShareX/TaskManager.cs b/ShareX/TaskManager.cs index f2f128a6a..3dce7d05a 100644 --- a/ShareX/TaskManager.cs +++ b/ShareX/TaskManager.cs @@ -483,7 +483,7 @@ public static void UpdateTrayIcon(int progress = -1) { try { - icon = TaskHelpers.GetProgressIcon(progress); + icon = Helpers.GetProgressIcon(progress); } catch (Exception e) { From 0b36be303722da3c74f1cc6e0b72b7d9e1ea97fb Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 30 Apr 2021 06:23:30 +0300 Subject: [PATCH 2/3] Remove unused images --- ShareX/Properties/Resources.Designer.cs | 20 -------------------- ShareX/Properties/Resources.resx | 6 ------ ShareX/Resources/control-record-yellow.png | Bin 522 -> 0 bytes ShareX/Resources/control-record.png | Bin 484 -> 0 bytes ShareX/ShareX.csproj | 2 -- 5 files changed, 28 deletions(-) delete mode 100644 ShareX/Resources/control-record-yellow.png delete mode 100644 ShareX/Resources/control-record.png diff --git a/ShareX/Properties/Resources.Designer.cs b/ShareX/Properties/Resources.Designer.cs index 762e68b7b..953f011d3 100644 --- a/ShareX/Properties/Resources.Designer.cs +++ b/ShareX/Properties/Resources.Designer.cs @@ -1033,26 +1033,6 @@ public static System.Drawing.Bitmap control { } } - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap control_record { - get { - object obj = ResourceManager.GetObject("control_record", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Drawing.Bitmap. - /// - public static System.Drawing.Bitmap control_record_yellow { - get { - object obj = ResourceManager.GetObject("control_record_yellow", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/ShareX/Properties/Resources.resx b/ShareX/Properties/Resources.resx index e338ede8f..1d4226b31 100644 --- a/ShareX/Properties/Resources.resx +++ b/ShareX/Properties/Resources.resx @@ -438,9 +438,6 @@ Are you sure you want to continue? File uploader: {0} - - ..\Resources\control-record.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\application-list.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a @@ -578,9 +575,6 @@ You can later disable it from "After capture tasks" menu. ..\Resources\disk-rename.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - ..\Resources\control-record-yellow.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\image-export.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/ShareX/Resources/control-record-yellow.png b/ShareX/Resources/control-record-yellow.png deleted file mode 100644 index 82eade0591770313f53d20e6e2c7231bd92e92c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 522 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1qucL8%hgh?3y^w370~qEv=}#LT=BJwMkFg)(D3 zQ$0gN_s>q|Kw~RCT^vI!{FhGLsP7yo((b>-SE9sZMw}CmPL2@I){d6en+YHE1v>XQ zDjmG$!XulNv2>N|UPl4l^~~#|a<}p--Ev#>{;0wc;dM`C->div-{~@{vHbq;oc?`T zJ%va6AGB=^uspJdA>FRwixtOAg$}hzok8=Io^Dxw&!5TNjKk=3X=a2>Vuf{DLgAFX zsn({aGXGC@Fo>UMXulviQKI)x0;>*>;=M1gHSJGadCavaPeA^$?5od}@^&h__J5r6 z>foe1i-P*KId(f#o&2&XX^Cv->%Cz<`KFIIUhi{%S7lQWX(*YK1k_nJ-O(`Ka9tUT z58Im+6>BRVZLCoe%`jPUTr|hpQOouA4c8N0(-&Il?evviEEoPD-eiB?V#mGqTNa41 z=`CNq0BFaDGmRUzF>Dgs`0{7%&*g** zORRw&j0(qilT2CC@WYTH-=Jn0Y zD+z)C);Sxn=1DD*8$!O>B!ChDILEY(QNVb^&`@WK0}KS-oGz(Otq>lk6-C`|H1>AO z<(#Z2vP&r&_xp`|O*`R~s)*?<7m&pat_dk+6y@ru**px=>8$VjKOjkxfX`-@)^2y* z+3eyh2nI0)9?Cwb)hecKXFbo0^@=3fVzpY)d%du|%NPNEub#=}@)N^|2pI!PDNx%6 zhIyzckMI3xHjt#C;0qz6M6gX094uV4mzqc5IIaAgPb;lVCA>1ug9bO+@cYJ4A-47wu5SQ4(oTM`q;^~Fbm=h7$%B>XtGSa{OOluQ- a2`~Uk>%{1npeZ*10000 - @@ -1797,7 +1796,6 @@ - From c8f0eb80fa78f35f2364bd64bd500c9a03e6157a Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 30 Apr 2021 06:34:23 +0300 Subject: [PATCH 3/3] Revert "Merge pull request #5540 from Craftplacer/master" This reverts commit e607cc481e3ace130bda06e990fa1d3539ec98c2, reversing changes made to 7f88c8c75f6b1ff1e103bea10493f15a338a18de. --- ShareX/Forms/NotificationForm.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ShareX/Forms/NotificationForm.cs b/ShareX/Forms/NotificationForm.cs index 3fcd6fca5..60298c4f5 100644 --- a/ShareX/Forms/NotificationForm.cs +++ b/ShareX/Forms/NotificationForm.cs @@ -26,7 +26,6 @@ You should have received a copy of the GNU General Public License using ShareX.HelpersLib; using System; using System.Drawing; -using System.IO; using System.Windows.Forms; namespace ShareX @@ -362,15 +361,6 @@ private void NotificationForm_MouseLeave(object sender, EventArgs e) } } - private void NotificationForm_MouseDown(object sender, MouseEventArgs e) - { - if (!string.IsNullOrEmpty(Config.FilePath) && File.Exists(Config.FilePath)) - { - IDataObject dataObject = new DataObject(DataFormats.FileDrop, new string[] { Config.FilePath }); - DoDragDrop(dataObject, DragDropEffects.Copy | DragDropEffects.Move); - } - } - #region Windows Form Designer generated code private Timer tDuration; @@ -422,7 +412,6 @@ private void InitializeComponent() MouseClick += new MouseEventHandler(NotificationForm_MouseClick); MouseEnter += new EventHandler(NotificationForm_MouseEnter); MouseLeave += new EventHandler(NotificationForm_MouseLeave); - MouseDown += new MouseEventHandler(NotificationForm_MouseDown); ResumeLayout(false); }