Adding icons to menu

This commit is contained in:
Jaex 2016-05-11 22:12:34 +03:00
parent 5b3b7636e9
commit 82f798e538
17 changed files with 225 additions and 4 deletions

View file

@ -60,6 +60,16 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap cross {
get {
object obj = ResourceManager.GetObject("cross", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
@ -135,6 +145,106 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap highlighter_text {
get {
object obj = ResourceManager.GetObject("highlighter_text", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap layer__minus {
get {
object obj = ResourceManager.GetObject("layer__minus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap layer_shape {
get {
object obj = ResourceManager.GetObject("layer_shape", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap layer_shape_ellipse {
get {
object obj = ResourceManager.GetObject("layer_shape_ellipse", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap layer_shape_line {
get {
object obj = ResourceManager.GetObject("layer_shape_line", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap layer_shape_round {
get {
object obj = ResourceManager.GetObject("layer_shape_round", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap minus {
get {
object obj = ResourceManager.GetObject("minus", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap monitor {
get {
object obj = ResourceManager.GetObject("monitor", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap monitor_window {
get {
object obj = ResourceManager.GetObject("monitor_window", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap prohibition {
get {
object obj = ResourceManager.GetObject("prohibition", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to Rectangle capture annotate.
/// </summary>
@ -517,6 +627,26 @@ internal class Resources {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap water {
get {
object obj = ResourceManager.GetObject("water", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap weather_snowflake {
get {
object obj = ResourceManager.GetObject("weather_snowflake", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to Capture.
/// </summary>

View file

@ -279,4 +279,43 @@ Distance: {6:0.00} px / Angle: {7:0.00}°</value>
<data name="exclamation_button" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\exclamation-button.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="cross" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\cross.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer__minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer--minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="minus" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\minus.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="prohibition" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\prohibition.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="highlighter_text" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\highlighter-text.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer_shape" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer_shape_ellipse" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-ellipse.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer_shape_line" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-line.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="layer_shape_round" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\layer-shape-round.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="monitor" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\monitor.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="monitor_window" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\monitor-window.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="water" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\water.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="weather_snowflake" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\weather-snowflake.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

View file

@ -24,6 +24,7 @@
#endregion License Information (GPL v3)
using ShareX.HelpersLib;
using ShareX.ScreenCaptureLib.Properties;
using System;
using System.Collections.Generic;
using System.Drawing;
@ -206,10 +207,12 @@ private void CreateContextMenu()
cmsContextMenu = new ContextMenuStrip(surface.components);
ToolStripMenuItem tsmiCancelCapture = new ToolStripMenuItem("Cancel capture");
tsmiCancelCapture.Image = Resources.prohibition;
tsmiCancelCapture.Click += (sender, e) => surface.Close(SurfaceResult.Close);
cmsContextMenu.Items.Add(tsmiCancelCapture);
ToolStripMenuItem tsmiCloseMenu = new ToolStripMenuItem("Close menu");
tsmiCloseMenu.Image = Resources.cross;
tsmiCloseMenu.Click += (sender, e) => cmsContextMenu.Close();
cmsContextMenu.Items.Add(tsmiCloseMenu);
@ -217,10 +220,12 @@ private void CreateContextMenu()
cmsContextMenu.Items.Add(tssObjectOptions);
ToolStripMenuItem tsmiDeleteSelected = new ToolStripMenuItem("Delete selected object");
tsmiDeleteSelected.Image = Resources.layer__minus;
tsmiDeleteSelected.Click += (sender, e) => RemoveCurrentArea();
cmsContextMenu.Items.Add(tsmiDeleteSelected);
ToolStripMenuItem tsmiDeleteAll = new ToolStripMenuItem("Delete all objects");
tsmiDeleteAll.Image = Resources.minus;
tsmiDeleteAll.Click += (sender, e) => ClearAll();
cmsContextMenu.Items.Add(tsmiDeleteAll);
@ -229,6 +234,38 @@ private void CreateContextMenu()
foreach (ShapeType shapeType in Helpers.GetEnums<ShapeType>())
{
ToolStripMenuItem tsmiShapeType = new ToolStripMenuItem(shapeType.GetLocalizedDescription());
Image img = null;
switch (shapeType)
{
case ShapeType.DrawingRectangle:
img = Resources.layer_shape;
break;
case ShapeType.DrawingRoundedRectangle:
img = Resources.layer_shape_round;
break;
case ShapeType.DrawingEllipse:
img = Resources.layer_shape_ellipse;
break;
case ShapeType.DrawingLine:
img = Resources.layer_shape_line;
break;
case ShapeType.DrawingArrow:
break;
case ShapeType.DrawingBlur:
img = Resources.water;
break;
case ShapeType.DrawingPixelate:
img = Resources.weather_snowflake;
break;
case ShapeType.DrawingHighlight:
img = Resources.highlighter_text;
break;
}
tsmiShapeType.Image = img;
tsmiShapeType.Checked = shapeType == CurrentShapeType;
tsmiShapeType.Tag = shapeType;
tsmiShapeType.Click += (sender, e) =>
@ -360,8 +397,14 @@ private void CreateContextMenu()
tsmiFullscreenCapture.Click += (sender, e) => surface.Close(SurfaceResult.Fullscreen);
cmsContextMenu.Items.Add(tsmiFullscreenCapture);
ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem("Capture active monitor");
tsmiActiveMonitorCapture.Image = Resources.monitor;
tsmiActiveMonitorCapture.Click += (sender, e) => surface.Close(SurfaceResult.ActiveMonitor);
cmsContextMenu.Items.Add(tsmiActiveMonitorCapture);
ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem("Capture monitor");
tsmiMonitorCapture.HideImageMargin();
tsmiMonitorCapture.Image = Resources.monitor_window;
cmsContextMenu.Items.Add(tsmiMonitorCapture);
tsmiMonitorCapture.DropDownItems.Clear();
@ -381,10 +424,6 @@ private void CreateContextMenu()
tsmiMonitorCapture.DropDownItems.Add(tsmi);
}
ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem("Capture active monitor");
tsmiActiveMonitorCapture.Click += (sender, e) => surface.Close(SurfaceResult.ActiveMonitor);
cmsContextMenu.Items.Add(tsmiActiveMonitorCapture);
cmsContextMenu.Items.Add(new ToolStripSeparator());
ToolStripMenuItem tsmiOptions = new ToolStripMenuItem("Options");

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 B

View file

@ -156,6 +156,19 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Resources\weather-snowflake.png" />
<None Include="Resources\highlighter-text.png" />
<None Include="Resources\water.png" />
<None Include="Resources\monitor-window.png" />
<None Include="Resources\monitor.png" />
<None Include="Resources\layer-shape-line.png" />
<None Include="Resources\layer-shape-ellipse.png" />
<None Include="Resources\layer-shape-round.png" />
<None Include="Resources\layer-shape.png" />
<None Include="Resources\layer--minus.png" />
<None Include="Resources\minus.png" />
<None Include="Resources\prohibition.png" />
<None Include="Resources\cross.png" />
<Content Include="Resources\Crosshair.cur" />
<None Include="Resources\exclamation-button.png" />
</ItemGroup>