mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-28 19:20:27 +12:00
Merge branch 'master' of https://github.com/pourmand1376/ShareX
This commit is contained in:
commit
8fc871f418
|
@ -63,6 +63,7 @@ public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Actio
|
|||
ilvImages.Colors.BorderColor = ShareXResources.DarkBorderColor;
|
||||
ilvImages.Colors.ForeColor = ShareXResources.DarkTextColor;
|
||||
ilvImages.Colors.SelectedForeColor = ShareXResources.DarkTextColor;
|
||||
ilvImages.Colors.UnFocusedForeColor = ShareXResources.DarkTextColor;
|
||||
}
|
||||
|
||||
him = new HistoryItemManager(uploadFile, editImage);
|
||||
|
|
|
@ -32,6 +32,7 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public class RegionCaptureOptions
|
||||
{
|
||||
public const int DefaultMinimumSize = 5;
|
||||
public const int MagnifierPixelCountMinimum = 3;
|
||||
public const int MagnifierPixelCountMaximum = 35;
|
||||
public const int MagnifierPixelSizeMinimum = 3;
|
||||
|
@ -41,6 +42,7 @@ public class RegionCaptureOptions
|
|||
public const int MoveSpeedMaximum = 10;
|
||||
|
||||
public bool QuickCrop = true;
|
||||
public int MinimumSize = DefaultMinimumSize;
|
||||
public RegionCaptureAction RegionCaptureActionRightClick = RegionCaptureAction.RemoveShapeCancelCapture;
|
||||
public RegionCaptureAction RegionCaptureActionMiddleClick = RegionCaptureAction.SwapToolType;
|
||||
public RegionCaptureAction RegionCaptureActionX1Click = RegionCaptureAction.CaptureFullscreen;
|
||||
|
|
|
@ -101,39 +101,13 @@ public bool EncodeVideo(string input, string output)
|
|||
return Run(Options.FFmpeg.FFmpegPath, Options.GetFFmpegCommands());
|
||||
}
|
||||
|
||||
public bool EncodeGIF(string input, string output, string tempFolder)
|
||||
public bool EncodeGIF(string input, string output)
|
||||
{
|
||||
bool result;
|
||||
|
||||
string palettePath = Path.Combine(tempFolder, "FFmpeg-palette.png");
|
||||
|
||||
try
|
||||
{
|
||||
// https://ffmpeg.org/ffmpeg-filters.html#palettegen-1
|
||||
result = Run(Options.FFmpeg.FFmpegPath, string.Format("-y -i \"{0}\" -vf \"palettegen=stats_mode={2}\" \"{1}\"", input, palettePath, Options.FFmpeg.GIFStatsMode));
|
||||
|
||||
if (result)
|
||||
{
|
||||
if (File.Exists(palettePath))
|
||||
{
|
||||
// https://ffmpeg.org/ffmpeg-filters.html#paletteuse
|
||||
result = Run(Options.FFmpeg.FFmpegPath, string.Format("-y -i \"{0}\" -i \"{1}\" -lavfi \"paletteuse=dither={3}\" \"{2}\"", input, palettePath, output, Options.FFmpeg.GIFDither));
|
||||
}
|
||||
else
|
||||
{
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (File.Exists(palettePath))
|
||||
{
|
||||
File.Delete(palettePath);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
// https://ffmpeg.org/ffmpeg-filters.html#palettegen-1
|
||||
// https://ffmpeg.org/ffmpeg-filters.html#paletteuse
|
||||
return Run(Options.FFmpeg.FFmpegPath,
|
||||
$"-y -i \"{input}\" -lavfi \"palettegen=stats_mode={Options.FFmpeg.GIFStatsMode}[palette]," +
|
||||
$"[0:v][palette]paletteuse=dither={Options.FFmpeg.GIFDither}\" \"{output}\"");
|
||||
}
|
||||
|
||||
private bool Run(string path, string args = null)
|
||||
|
|
|
@ -233,16 +233,13 @@ public void SaveAsGIF(string path, GIFQuality quality)
|
|||
public bool FFmpegEncodeVideo(string input, string output)
|
||||
{
|
||||
Helpers.CreateDirectoryFromFilePath(output);
|
||||
bool result = ffmpegCli.EncodeVideo(input, output);
|
||||
//DebugHelper.WriteLine("Video encoding result:\nInput file size: {0}\nOutput file size: {1}", new FileInfo(input).Length.ToSizeString(), new FileInfo(output).Length.ToSizeString());
|
||||
return result;
|
||||
return ffmpegCli.EncodeVideo(input, output);
|
||||
}
|
||||
|
||||
public bool FFmpegEncodeAsGIF(string sourceFilePath, string targetFilePath, string tempFolder)
|
||||
public bool FFmpegEncodeAsGIF(string input, string output)
|
||||
{
|
||||
Helpers.CreateDirectoryFromFilePath(targetFilePath);
|
||||
Helpers.CreateDirectoryFromDirectoryPath(tempFolder);
|
||||
return ffmpegCli.EncodeGIF(sourceFilePath, targetFilePath, tempFolder);
|
||||
Helpers.CreateDirectoryFromFilePath(output);
|
||||
return ffmpegCli.EncodeGIF(input, output);
|
||||
}
|
||||
|
||||
protected void OnRecordingStarted()
|
||||
|
|
|
@ -33,8 +33,6 @@ namespace ShareX.ScreenCaptureLib
|
|||
{
|
||||
public abstract class BaseShape : IDisposable
|
||||
{
|
||||
protected const int MinimumSize = 3;
|
||||
|
||||
public abstract ShapeCategory ShapeCategory { get; }
|
||||
|
||||
public abstract ShapeType ShapeType { get; }
|
||||
|
@ -93,7 +91,7 @@ private set
|
|||
|
||||
public Size InitialSize { get; set; }
|
||||
|
||||
public virtual bool IsValidShape => !Rectangle.IsEmpty && Rectangle.Width >= MinimumSize && Rectangle.Height >= MinimumSize;
|
||||
public virtual bool IsValidShape => !Rectangle.IsEmpty && Rectangle.Width >= Options.MinimumSize && Rectangle.Height >= Options.MinimumSize;
|
||||
|
||||
public virtual bool IsSelectable => Manager.CurrentTool == ShapeType || Manager.CurrentTool == ShapeType.ToolSelect;
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class LineDrawingShape : BaseDrawingShape
|
|||
public bool CenterNodeActive { get; private set; }
|
||||
public int CenterPointCount { get; private set; }
|
||||
|
||||
public override bool IsValidShape => Rectangle.Width > 1 || Rectangle.Height > 1;
|
||||
public override bool IsValidShape => Rectangle.Width >= Options.MinimumSize || Rectangle.Height >= Options.MinimumSize;
|
||||
|
||||
protected override void UseLightResizeNodes()
|
||||
{
|
||||
|
|
|
@ -591,10 +591,6 @@ private void form_KeyDown(object sender, KeyEventArgs e)
|
|||
case Keys.PageDown:
|
||||
MoveCurrentShapeDown();
|
||||
break;
|
||||
case Keys.Q:
|
||||
Options.QuickCrop = !Options.QuickCrop;
|
||||
tsmiQuickCrop.Checked = !Options.QuickCrop;
|
||||
break;
|
||||
case Keys.M:
|
||||
CurrentTool = ShapeType.ToolSelect;
|
||||
break;
|
||||
|
@ -625,6 +621,16 @@ private void form_KeyDown(object sender, KeyEventArgs e)
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (e.KeyData)
|
||||
{
|
||||
case Keys.Q:
|
||||
Options.QuickCrop = !Options.QuickCrop;
|
||||
tsmiQuickCrop.Checked = !Options.QuickCrop;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int speed;
|
||||
|
@ -1179,10 +1185,10 @@ private BaseShape CheckHover()
|
|||
{
|
||||
Point location = InputManager.ClientMousePosition;
|
||||
|
||||
return new RectangleRegionShape()
|
||||
{
|
||||
Rectangle = new Rectangle(new Point(location.X - (Options.FixedSize.Width / 2), location.Y - (Options.FixedSize.Height / 2)), Options.FixedSize)
|
||||
};
|
||||
BaseShape rectangleRegionShape = CreateShape(ShapeType.RegionRectangle);
|
||||
rectangleRegionShape.Rectangle = new Rectangle(new Point(location.X - (Options.FixedSize.Width / 2),
|
||||
location.Y - (Options.FixedSize.Height / 2)), Options.FixedSize);
|
||||
return rectangleRegionShape;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1192,10 +1198,9 @@ private BaseShape CheckHover()
|
|||
{
|
||||
Rectangle hoverArea = CaptureHelpers.ScreenToClient(window.Rectangle);
|
||||
|
||||
return new RectangleRegionShape()
|
||||
{
|
||||
Rectangle = Rectangle.Intersect(Form.ClientArea, hoverArea)
|
||||
};
|
||||
BaseShape rectangleRegionShape = CreateShape(ShapeType.RegionRectangle);
|
||||
rectangleRegionShape.Rectangle = Rectangle.Intersect(Form.ClientArea, hoverArea);
|
||||
return rectangleRegionShape;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,6 +213,12 @@ public override UploadResult Upload(Stream stream, string fileName)
|
|||
DebugHelper.WriteLine("B2 uploader: Too Many Requests, trying with same URL.");
|
||||
continue;
|
||||
}
|
||||
else if (uploadResult.RC == 503)
|
||||
{
|
||||
DebugHelper.WriteLine("B2 uploader: Service Unavailable, trying with new URL.");
|
||||
url = null;
|
||||
continue;
|
||||
}
|
||||
else if (uploadResult.RC != 200)
|
||||
{
|
||||
// something else happened that wasn't a success, so bail out
|
||||
|
@ -678,4 +684,4 @@ private class B2Upload
|
|||
|
||||
#endregion JSON responses
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -460,7 +460,7 @@ private void InitializeComponent()
|
|||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
|
@ -509,7 +509,7 @@ private void InitializeComponent()
|
|||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle3.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle3.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
|
@ -623,7 +623,7 @@ private void InitializeComponent()
|
|||
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle5.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
|
@ -907,7 +907,7 @@ private void InitializeComponent()
|
|||
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle7.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle7.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
|
|
|
@ -544,7 +544,7 @@
|
|||
<value>mbHelp</value>
|
||||
</data>
|
||||
<data name=">>mbHelp.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=12.4.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>mbHelp.Parent" xml:space="preserve">
|
||||
<value>gbCustomUploaders</value>
|
||||
|
@ -646,7 +646,7 @@
|
|||
<value>eiCustomUploaders</value>
|
||||
</data>
|
||||
<data name=">>eiCustomUploaders.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=12.4.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.ExportImportControl, ShareX.HelpersLib, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>eiCustomUploaders.Parent" xml:space="preserve">
|
||||
<value>gbCustomUploaders</value>
|
||||
|
@ -2596,7 +2596,7 @@ store.book[0].title</value>
|
|||
<value>mbDestinationType</value>
|
||||
</data>
|
||||
<data name=">>mbDestinationType.Type" xml:space="preserve">
|
||||
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=12.4.2.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
<value>ShareX.HelpersLib.MenuButton, ShareX.HelpersLib, Version=13.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>mbDestinationType.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
|
|
|
@ -296,7 +296,18 @@ private UploadResult InternalUpload(Stream stream, string fileName, bool refresh
|
|||
|
||||
ReturnResponseOnError = true;
|
||||
|
||||
UploadResult result = SendRequestFile("https://api.imgur.com/3/image", stream, fileName, "image", args, headers);
|
||||
string fileFormName;
|
||||
|
||||
if (Helpers.IsVideoFile(fileName))
|
||||
{
|
||||
fileFormName = "video";
|
||||
}
|
||||
else
|
||||
{
|
||||
fileFormName = "image";
|
||||
}
|
||||
|
||||
UploadResult result = SendRequestFile("https://api.imgur.com/3/upload", stream, fileName, fileFormName, args, headers);
|
||||
|
||||
if (!string.IsNullOrEmpty(result.Response))
|
||||
{
|
||||
|
|
40
ShareX/Controls/TaskThumbnailPanel.Designer.cs
generated
40
ShareX/Controls/TaskThumbnailPanel.Designer.cs
generated
|
@ -31,14 +31,38 @@ protected override void Dispose(bool disposing)
|
|||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.lblTitle = new ShareX.HelpersLib.BlackStyleLabel();
|
||||
this.ttMain = new System.Windows.Forms.ToolTip(this.components);
|
||||
this.pThumbnail = new ShareX.TaskRoundedCornerPanel();
|
||||
this.pbProgress = new ShareX.HelpersLib.BlackStyleProgressBar();
|
||||
this.pbThumbnail = new System.Windows.Forms.PictureBox();
|
||||
this.lblTitle = new ShareX.HelpersLib.BlackStyleLabel();
|
||||
this.pThumbnail.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pbThumbnail)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// lblTitle
|
||||
//
|
||||
this.lblTitle.AutoEllipsis = true;
|
||||
this.lblTitle.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblTitle.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblTitle.ForeColor = System.Drawing.Color.White;
|
||||
this.lblTitle.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblTitle.Name = "lblTitle";
|
||||
this.lblTitle.Size = new System.Drawing.Size(256, 22);
|
||||
this.lblTitle.TabIndex = 1;
|
||||
this.lblTitle.Text = "Test.png";
|
||||
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
this.lblTitle.MouseClick += new System.Windows.Forms.MouseEventHandler(this.LblTitle_MouseClick);
|
||||
//
|
||||
// ttMain
|
||||
//
|
||||
this.ttMain.AutoPopDelay = 5000;
|
||||
this.ttMain.InitialDelay = 200;
|
||||
this.ttMain.OwnerDraw = true;
|
||||
this.ttMain.ReshowDelay = 100;
|
||||
this.ttMain.Draw += new System.Windows.Forms.DrawToolTipEventHandler(this.TtMain_Draw);
|
||||
//
|
||||
// pThumbnail
|
||||
//
|
||||
this.pThumbnail.BackColor = System.Drawing.Color.Transparent;
|
||||
|
@ -82,19 +106,6 @@ private void InitializeComponent()
|
|||
this.pbThumbnail.MouseMove += new System.Windows.Forms.MouseEventHandler(this.PbThumbnail_MouseMove);
|
||||
this.pbThumbnail.MouseUp += new System.Windows.Forms.MouseEventHandler(this.PbThumbnail_MouseUp);
|
||||
//
|
||||
// lblTitle
|
||||
//
|
||||
this.lblTitle.AutoEllipsis = true;
|
||||
this.lblTitle.BackColor = System.Drawing.Color.Transparent;
|
||||
this.lblTitle.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.lblTitle.ForeColor = System.Drawing.Color.White;
|
||||
this.lblTitle.Location = new System.Drawing.Point(0, 0);
|
||||
this.lblTitle.Name = "lblTitle";
|
||||
this.lblTitle.Size = new System.Drawing.Size(256, 22);
|
||||
this.lblTitle.TabIndex = 1;
|
||||
this.lblTitle.Text = "Test.png";
|
||||
this.lblTitle.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// TaskThumbnailPanel
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@ -116,5 +127,6 @@ private void InitializeComponent()
|
|||
private HelpersLib.BlackStyleLabel lblTitle;
|
||||
private HelpersLib.BlackStyleProgressBar pbProgress;
|
||||
private System.Windows.Forms.PictureBox pbThumbnail;
|
||||
private System.Windows.Forms.ToolTip ttMain;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -190,7 +190,7 @@ public TaskThumbnailPanel(WorkerTask task)
|
|||
|
||||
InitializeComponent();
|
||||
UpdateTheme();
|
||||
UpdateFilename();
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
public void UpdateTheme()
|
||||
|
@ -200,18 +200,33 @@ public void UpdateTheme()
|
|||
lblTitle.ForeColor = ShareXResources.DarkTextColor;
|
||||
lblTitle.TextShadowColor = ShareXResources.DarkBorderColor;
|
||||
pThumbnail.PanelColor = ShareXResources.DarkBorderColor;
|
||||
ttMain.BackColor = ShareXResources.DarkBackgroundColor;
|
||||
ttMain.ForeColor = ShareXResources.DarkTextColor;
|
||||
}
|
||||
else
|
||||
{
|
||||
lblTitle.ForeColor = SystemColors.WindowText;
|
||||
lblTitle.ForeColor = SystemColors.ControlText;
|
||||
lblTitle.TextShadowColor = Color.Transparent;
|
||||
pThumbnail.PanelColor = SystemColors.ControlLight;
|
||||
ttMain.BackColor = SystemColors.Window;
|
||||
ttMain.ForeColor = SystemColors.ControlText;
|
||||
}
|
||||
}
|
||||
|
||||
public void UpdateFilename()
|
||||
public void UpdateTitle()
|
||||
{
|
||||
Title = Task.Info?.FileName;
|
||||
|
||||
if (Task.Info != null && !string.IsNullOrEmpty(Task.Info.ToString()))
|
||||
{
|
||||
lblTitle.Cursor = Cursors.Hand;
|
||||
ttMain.SetToolTip(lblTitle, Task.Info.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
lblTitle.Cursor = Cursors.Default;
|
||||
ttMain.SetToolTip(lblTitle, null);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateSize()
|
||||
|
@ -303,6 +318,8 @@ public void UpdateStatus()
|
|||
{
|
||||
pThumbnail.UpdateStatusColor(Task.Status);
|
||||
}
|
||||
|
||||
UpdateTitle();
|
||||
}
|
||||
|
||||
public void ClearThumbnail()
|
||||
|
@ -321,6 +338,28 @@ public void ClearThumbnail()
|
|||
ThumbnailExists = false;
|
||||
}
|
||||
|
||||
private void LblTitle_MouseClick(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left && Task.Info != null)
|
||||
{
|
||||
if (Task.Info.Result != null)
|
||||
{
|
||||
string url = Task.Info.Result.ToString();
|
||||
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
URLHelpers.OpenURL(url);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Task.Info.FilePath))
|
||||
{
|
||||
Helpers.OpenFile(Task.Info.FilePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PbThumbnail_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (e.Button == MouseButtons.Left)
|
||||
|
@ -387,5 +426,12 @@ private void PbThumbnail_MouseMove(object sender, MouseEventArgs e)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void TtMain_Draw(object sender, DrawToolTipEventArgs e)
|
||||
{
|
||||
e.DrawBackground();
|
||||
e.DrawBorder();
|
||||
e.DrawText();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -117,4 +117,7 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ttMain.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
|
@ -789,7 +789,7 @@ private void UpdateTheme()
|
|||
cmsTray.Renderer = new ToolStripCustomRenderer();
|
||||
cmsTaskInfo.Renderer = new ToolStripCustomRenderer();
|
||||
lvUploads.BackColor = SystemColors.Window;
|
||||
lvUploads.ForeColor = SystemColors.WindowText;
|
||||
lvUploads.ForeColor = SystemColors.ControlText;
|
||||
lblListViewTip.ForeColor = Color.Silver;
|
||||
scMain.SplitterColor = Color.White;
|
||||
scMain.SplitterLineColor = ProfessionalColors.SeparatorDark;
|
||||
|
|
|
@ -177,7 +177,7 @@ protected override void OnPaint(PaintEventArgs e)
|
|||
TextRenderer.DrawText(g, ToastConfig.Text, textFont, textRect.LocationOffset(1), Color.White, TextFormatFlags.Left | TextFormatFlags.EndEllipsis);
|
||||
}
|
||||
|
||||
Color borderColor = ShareXResources.UseDarkTheme ? ShareXResources.DarkBorderColor : SystemColors.WindowText;
|
||||
Color borderColor = ShareXResources.UseDarkTheme ? ShareXResources.DarkBorderColor : SystemColors.ControlText;
|
||||
using (Pen borderPen = new Pen(borderColor))
|
||||
{
|
||||
g.DrawRectangleProper(borderPen, rect);
|
||||
|
|
11
ShareX/Forms/TaskSettingsForm.Designer.cs
generated
11
ShareX/Forms/TaskSettingsForm.Designer.cs
generated
|
@ -247,6 +247,7 @@ private void InitializeComponent()
|
|||
this.pgTaskSettings = new System.Windows.Forms.PropertyGrid();
|
||||
this.chkOverrideAdvancedSettings = new System.Windows.Forms.CheckBox();
|
||||
this.tttvMain = new ShareX.HelpersLib.TabToTreeView();
|
||||
this.lblActionsNote = new System.Windows.Forms.Label();
|
||||
this.tcTaskSettings.SuspendLayout();
|
||||
this.tpTask.SuspendLayout();
|
||||
this.cmsDestinations.SuspendLayout();
|
||||
|
@ -1895,6 +1896,7 @@ private void InitializeComponent()
|
|||
//
|
||||
// pActions
|
||||
//
|
||||
this.pActions.Controls.Add(this.lblActionsNote);
|
||||
this.pActions.Controls.Add(this.btnActionsDuplicate);
|
||||
this.pActions.Controls.Add(this.btnActionsAdd);
|
||||
this.pActions.Controls.Add(this.lvActions);
|
||||
|
@ -1930,6 +1932,7 @@ private void InitializeComponent()
|
|||
this.chActionsArgs,
|
||||
this.chActionsExtensions});
|
||||
this.lvActions.FullRowSelect = true;
|
||||
this.lvActions.HideSelection = false;
|
||||
this.lvActions.MultiSelect = false;
|
||||
this.lvActions.Name = "lvActions";
|
||||
this.lvActions.UseCompatibleStateImageBehavior = false;
|
||||
|
@ -2010,6 +2013,7 @@ private void InitializeComponent()
|
|||
this.chWatchFolderFilter,
|
||||
this.chWatchFolderIncludeSubdirectories});
|
||||
this.lvWatchFolderList.FullRowSelect = true;
|
||||
this.lvWatchFolderList.HideSelection = false;
|
||||
this.lvWatchFolderList.Name = "lvWatchFolderList";
|
||||
this.lvWatchFolderList.UseCompatibleStateImageBehavior = false;
|
||||
this.lvWatchFolderList.View = System.Windows.Forms.View.Details;
|
||||
|
@ -2110,6 +2114,11 @@ private void InitializeComponent()
|
|||
this.tttvMain.TreeViewSize = 190;
|
||||
this.tttvMain.TabChanged += new ShareX.HelpersLib.TabToTreeView.TabChangedEventHandler(this.tttvMain_TabChanged);
|
||||
//
|
||||
// lblActionsNote
|
||||
//
|
||||
resources.ApplyResources(this.lblActionsNote, "lblActionsNote");
|
||||
this.lblActionsNote.Name = "lblActionsNote";
|
||||
//
|
||||
// TaskSettingsForm
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
|
@ -2188,6 +2197,7 @@ private void InitializeComponent()
|
|||
this.tpActions.ResumeLayout(false);
|
||||
this.tpActions.PerformLayout();
|
||||
this.pActions.ResumeLayout(false);
|
||||
this.pActions.PerformLayout();
|
||||
this.tpWatchFolders.ResumeLayout(false);
|
||||
this.tpWatchFolders.PerformLayout();
|
||||
this.tpTools.ResumeLayout(false);
|
||||
|
@ -2419,5 +2429,6 @@ private void InitializeComponent()
|
|||
private System.Windows.Forms.Label lblAutoIncrementNumber;
|
||||
private System.Windows.Forms.NumericUpDown nudAutoIncrementNumber;
|
||||
private System.Windows.Forms.Button btnAutoIncrementNumber;
|
||||
private System.Windows.Forms.Label lblActionsNote;
|
||||
}
|
||||
}
|
|
@ -1058,6 +1058,8 @@ private void btnScreenRecorderFFmpegOptions_Click(object sender, EventArgs e)
|
|||
{
|
||||
form.DefaultToolsFolder = Program.ToolsFolder;
|
||||
form.ShowDialog();
|
||||
|
||||
TaskSettings.CaptureSettings.FFmpegOptions = form.Options.FFmpeg;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -303,7 +303,7 @@ private static string ProcessTwoPassEncoding(string input, TaskSettings taskSett
|
|||
{
|
||||
if (taskSettings.CaptureSettings.FFmpegOptions.VideoCodec == FFmpegVideoCodec.gif)
|
||||
{
|
||||
screenRecorder.FFmpegEncodeAsGIF(input, output, Program.ToolsFolder);
|
||||
screenRecorder.FFmpegEncodeAsGIF(input, output);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -158,7 +158,7 @@ private static void Task_ImageReady(WorkerTask task)
|
|||
|
||||
if (panel != null)
|
||||
{
|
||||
panel.UpdateFilename();
|
||||
panel.UpdateTitle();
|
||||
|
||||
if (Program.Settings.TaskViewMode == TaskViewMode.ThumbnailView)
|
||||
{
|
||||
|
@ -333,12 +333,7 @@ private static void Task_TaskCompleted(WorkerTask task)
|
|||
{
|
||||
DebugHelper.WriteLine($"Task completed. Filename: {info.FileName}, Duration: {(long)info.TaskDuration.TotalMilliseconds} ms");
|
||||
|
||||
string result = info.Result.ToString();
|
||||
|
||||
if (string.IsNullOrEmpty(result) && !string.IsNullOrEmpty(info.FilePath))
|
||||
{
|
||||
result = info.FilePath;
|
||||
}
|
||||
string result = info.ToString();
|
||||
|
||||
if (lvi != null)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue