mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-28 23:42:13 +12:00
fixed #7305: Improve icon detection in quick task menu
This commit is contained in:
parent
8b96a53262
commit
5e317dc5b2
3 changed files with 11 additions and 12 deletions
1
ShareX/Forms/QuickTaskMenuEditorForm.Designer.cs
generated
1
ShareX/Forms/QuickTaskMenuEditorForm.Designer.cs
generated
|
@ -114,6 +114,7 @@ private void InitializeComponent()
|
||||||
this.Controls.Add(this.btnAdd);
|
this.Controls.Add(this.btnAdd);
|
||||||
this.Controls.Add(this.lvPresets);
|
this.Controls.Add(this.lvPresets);
|
||||||
this.Name = "QuickTaskMenuEditorForm";
|
this.Name = "QuickTaskMenuEditorForm";
|
||||||
|
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
|
||||||
this.ResumeLayout(false);
|
this.ResumeLayout(false);
|
||||||
this.PerformLayout();
|
this.PerformLayout();
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@
|
||||||
<value>lvPresets</value>
|
<value>lvPresets</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvPresets.Type" xml:space="preserve">
|
<data name=">>lvPresets.Type" xml:space="preserve">
|
||||||
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=15.0.1.0, Culture=neutral, PublicKeyToken=null</value>
|
<value>ShareX.HelpersLib.MyListView, ShareX.HelpersLib, Version=16.0.3.0, Culture=neutral, PublicKeyToken=null</value>
|
||||||
</data>
|
</data>
|
||||||
<data name=">>lvPresets.Parent" xml:space="preserve">
|
<data name=">>lvPresets.Parent" xml:space="preserve">
|
||||||
<value>$this</value>
|
<value>$this</value>
|
||||||
|
|
|
@ -25,7 +25,9 @@ You should have received a copy of the GNU General Public License
|
||||||
|
|
||||||
using ShareX.HelpersLib;
|
using ShareX.HelpersLib;
|
||||||
using ShareX.Properties;
|
using ShareX.Properties;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
|
using System.Linq;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
|
|
||||||
namespace ShareX
|
namespace ShareX
|
||||||
|
@ -123,20 +125,16 @@ protected void OnTaskInfoSelected(QuickTaskInfo taskInfo)
|
||||||
|
|
||||||
public Image FindSuitableIcon(QuickTaskInfo taskInfo)
|
public Image FindSuitableIcon(QuickTaskInfo taskInfo)
|
||||||
{
|
{
|
||||||
if (taskInfo.AfterCaptureTasks.HasFlag(AfterCaptureTasks.UploadImageToHost))
|
IEnumerable<AfterCaptureTasks> afterCaptureTasks = taskInfo.AfterCaptureTasks.GetFlags();
|
||||||
|
|
||||||
|
if (afterCaptureTasks.Count() > 0)
|
||||||
{
|
{
|
||||||
return Resources.upload_cloud;
|
AfterCaptureTasks last = afterCaptureTasks.Last();
|
||||||
}
|
|
||||||
else if (taskInfo.AfterCaptureTasks.HasFlag(AfterCaptureTasks.CopyImageToClipboard) || taskInfo.AfterCaptureTasks.HasFlag(AfterCaptureTasks.CopyFileToClipboard))
|
return TaskHelpers.FindMenuIcon(last);
|
||||||
{
|
|
||||||
return Resources.clipboard;
|
|
||||||
}
|
|
||||||
else if (taskInfo.AfterCaptureTasks.HasFlag(AfterCaptureTasks.SaveImageToFile) || taskInfo.AfterCaptureTasks.HasFlag(AfterCaptureTasks.SaveImageToFileWithDialog))
|
|
||||||
{
|
|
||||||
return Resources.disk_black;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Resources.image;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue