This commit is contained in:
Stephan Maier
2024-08-27 08:10:27 +02:00
parent eb5c2fa502
commit 647f938eee
617 changed files with 73086 additions and 7137 deletions

View File

@@ -0,0 +1,73 @@
using System;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;
using FSI.BT.Tools.Global.Utilities;
namespace FSI.BT.Tools.SystemTrayMenu.Helper
{
internal class AppContextMenu
{
public event Action ClickedOpenLog;
public ContextMenuStrip Create()
{
ContextMenuStrip menu = new()
{
BackColor = SystemColors.Control,
};
AddItem(menu, "Settings", () => Global.UserInterface.SettingsForm.ShowSingleInstance());
AddSeperator(menu);
AddItem(menu, "Log File", () => ClickedOpenLog?.Invoke());
AddSeperator(menu);
//AddItem(menu, "Frequently Asked Questions", Config.ShowHelpFAQ);
AddItem(menu, "Support SystemTrayMenu", Config.ShowSupportSystemTrayMenu);
AddItem(menu, "About SystemTrayMenu", About);
//AddItem(menu, "Check for updates", () => GitHubUpdate.ActivateNewVersionFormOrCheckForUpdates(showWhenUpToDate: true));
AddSeperator(menu);
AddItem(menu, "Restart", AppRestart.ByAppContextMenu);
AddItem(menu, "Exit app", Application.Exit);
return menu;
}
private static void AddSeperator(ContextMenuStrip menu)
{
menu.Items.Add(new ToolStripSeparator());
}
private static void AddItem(
ContextMenuStrip menu,
string text,
Action actionClick)
{
ToolStripMenuItem toolStripMenuItem = new()
{
Text = Translator.GetText(text),
};
toolStripMenuItem.Click += (sender, e) => actionClick();
menu.Items.Add(toolStripMenuItem);
}
private static void About()
{
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(
Assembly.GetEntryAssembly().Location);
Global.UserInterface.AboutBox aboutBox = new()
{
AppTitle = versionInfo.ProductName,
AppDescription = versionInfo.FileDescription,
AppVersion = $"Version {versionInfo.FileVersion}",
AppCopyright = versionInfo.LegalCopyright,
AppMoreInfo = versionInfo.LegalCopyright,
AppImage = SystemTrayMenu.Properties.Resources.SystemTrayMenu.ToBitmap(),
};
aboutBox.AppDetailsButton = true;
aboutBox.ShowDialog();
}
}
}

View File

@@ -0,0 +1,75 @@
// <copyright file="AppNotifyIcon.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
using System;
using System.Windows.Forms;
using FSI.BT.Tools.SystemTrayMenu.Helper;
using FSI.BT.Tools.SystemTrayMenu.Utilities;
internal class AppNotifyIcon : IDisposable
{
private readonly NotifyIcon notifyIcon = new();
public AppNotifyIcon()
{
notifyIcon.Text = "FSI.BT.Tools.SystemTrayMenu";
notifyIcon.Icon = Config.GetAppIcon();
notifyIcon.Visible = true;
AppContextMenu contextMenus = new();
contextMenus.ClickedOpenLog += ClickedOpenLog;
void ClickedOpenLog()
{
OpenLog?.Invoke();
}
notifyIcon.ContextMenuStrip = contextMenus.Create();
notifyIcon.MouseClick += NotifyIcon_MouseClick;
void NotifyIcon_MouseClick(object sender, MouseEventArgs e)
{
notifyIcon.BalloonTipText = "Hallo";
notifyIcon.ShowBalloonTip(5000);
// VerifyClick(e);
}
notifyIcon.MouseDoubleClick += NotifyIcon_MouseDoubleClick;
void NotifyIcon_MouseDoubleClick(object sender, MouseEventArgs e)
{
VerifyClick(e);
}
}
public event Action Click;
public event Action OpenLog;
public void Dispose()
{
notifyIcon.Icon = null;
notifyIcon.Dispose();
}
public void LoadingStart()
{
notifyIcon.Icon = Resources.StaticResources.LoadingIcon;
}
public void LoadingStop()
{
notifyIcon.Icon = Config.GetAppIcon();
}
private void VerifyClick(MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Click?.Invoke();
}
}
}
}

View File

@@ -0,0 +1,745 @@
// <copyright file="CustomScrollbar.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
[Designer(typeof(ScrollbarControlDesigner))]
public class CustomScrollbar : UserControl
{
private readonly Timer timerMouseStillClicked = new();
private float largeChange = 10;
private float smallChange = 1;
private int minimum = 0;
private int maximum = 100;
private int value = 0;
private int lastValue = 0;
private int clickPoint;
private float sliderTop = 0;
private bool sliderDown = false;
private bool sliderDragging = false;
private bool arrowUpHovered = false;
private bool sliderHovered = false;
private bool arrowDownHovered = false;
private bool trackHovered = false;
private bool mouseStillClickedMoveUp = false;
private bool mouseStillClickedMoveLarge = false;
private int timerMouseStillClickedCounter = 0;
private bool paintEnabled = false;
private int width;
public CustomScrollbar()
{
InitializeComponent();
SetStyle(ControlStyles.ResizeRedraw, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
timerMouseStillClicked.Interval = 30;
timerMouseStillClicked.Tick += TimerMouseStillClicked_Tick;
}
public new event EventHandler Scroll = null;
public event EventHandler ValueChanged = null;
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DefaultValue(false)]
[Category("Behavior")]
[Description("LargeChange")]
public float LargeChange
{
get => largeChange;
set
{
largeChange = value;
Invalidate();
}
}
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DefaultValue(false)]
[Category("Behavior")]
[Description("SmallChange")]
public float SmallChange
{
get => smallChange;
set
{
smallChange = value;
Invalidate();
}
}
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DefaultValue(false)]
[Category("Behavior")]
[Description("Minimum")]
public int Minimum
{
get => minimum;
set
{
minimum = value;
Invalidate();
}
}
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DefaultValue(false)]
[Category("Behavior")]
[Description("Maximum")]
public int Maximum
{
get => maximum;
set
{
maximum = value;
Invalidate();
}
}
[EditorBrowsable(EditorBrowsableState.Always)]
[Browsable(true)]
[DefaultValue(false)]
[Category("Behavior")]
[Description("Value")]
public int Value
{
get => value;
set
{
this.value = value;
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int pixelRange = trackHeight - sliderHeight;
int realRange = GetRealRange();
float percentage = 0.0f;
if (realRange != 0)
{
percentage = this.value / (float)realRange;
}
float top = percentage * pixelRange;
sliderTop = (int)top;
Invalidate();
}
}
public int Delta => Value - lastValue;
public override bool AutoSize
{
get => base.AutoSize;
set => base.AutoSize = value;
}
public void CustomScrollbar_MouseWheel(object sender, MouseEventArgs e)
{
if (e.Delta > 0)
{
MoveUp(SmallChange * MenuDefines.Scrollspeed);
}
else
{
MoveDown(SmallChange * MenuDefines.Scrollspeed);
}
}
internal void Reset()
{
sliderTop = 0;
sliderDown = false;
sliderDragging = false;
arrowUpHovered = false;
sliderHovered = false;
arrowDownHovered = false;
trackHovered = false;
mouseStillClickedMoveUp = false;
mouseStillClickedMoveLarge = false;
timerMouseStillClickedCounter = 0;
lastValue = 0;
}
/// <summary>
/// Show the control
/// (workaround, because visible = false, was causing appearing scrollbars).
/// </summary>
/// <param name="newHeight">newHeight which to paint.</param>
internal void PaintEnable(int newHeight)
{
int newWidth = Math.Max(width, Width);
Size = new Size(newWidth, newHeight);
paintEnabled = true;
}
/// <summary>
/// Hide the control
/// (workaround, because visible = false, was causing appearing scrollbars).
/// </summary>
internal void PaintDisable()
{
if (Width > 0)
{
width = Width;
}
Size = new Size(0, 0);
paintEnabled = false;
}
protected override void Dispose(bool disposing)
{
MouseDown -= CustomScrollbar_MouseDown;
MouseMove -= CustomScrollbar_MouseMove;
MouseUp -= CustomScrollbar_MouseUp;
MouseLeave -= CustomScrollbar_MouseLeave;
timerMouseStillClicked.Tick -= TimerMouseStillClicked_Tick;
timerMouseStillClicked.Dispose();
base.Dispose(disposing);
}
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
Color colorArrow;
Color colorArrowHoverBackground;
Color colorArrowHover;
Color colorArrowClick;
Color colorArrowClickBackground;
Color colorSliderArrowsAndTrackHover;
Color colorSlider;
Color colorSliderHover;
Color colorSliderDragging;
Color colorScrollbarBackground;
if (Config.IsDarkMode())
{
colorArrow = AppColors.ArrowDarkMode;
colorArrowHoverBackground = AppColors.ArrowHoverBackgroundDarkMode;
colorArrowHover = AppColors.ArrowHoverDarkMode;
colorArrowClick = AppColors.ArrowClickDarkMode;
colorArrowClickBackground = AppColors.ArrowClickBackgroundDarkMode;
colorSliderArrowsAndTrackHover = AppColors.SliderArrowsAndTrackHoverDarkMode;
colorSlider = AppColors.SliderDarkMode;
colorSliderHover = AppColors.SliderHoverDarkMode;
colorSliderDragging = AppColors.SliderDraggingDarkMode;
colorScrollbarBackground = AppColors.ScrollbarBackgroundDarkMode;
}
else
{
colorArrow = AppColors.Arrow;
colorArrowHoverBackground = AppColors.ArrowHoverBackground;
colorArrowHover = AppColors.ArrowHover;
colorArrowClick = AppColors.ArrowClick;
colorArrowClickBackground = AppColors.ArrowClickBackground;
colorSliderArrowsAndTrackHover = AppColors.SliderArrowsAndTrackHover;
colorSlider = AppColors.Slider;
colorSliderHover = AppColors.SliderHover;
colorSliderDragging = AppColors.SliderDragging;
colorScrollbarBackground = AppColors.ScrollbarBackground;
}
if (!paintEnabled)
{
e.Graphics.FillRectangle(
new SolidBrush(colorScrollbarBackground),
new Rectangle(0, 0, Width, Height));
return;
}
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int top = (int)sliderTop + Width;
// Draw background
Brush brushScrollbarBorder = new SolidBrush(colorScrollbarBackground);
e.Graphics.FillRectangle(brushScrollbarBorder, new Rectangle(0, 0, Width, Height));
// Draw arrowUp
SolidBrush solidBrushArrowUpBackground;
SolidBrush solidBrushArrowUp;
Pen penArrowUp;
if (timerMouseStillClicked.Enabled &&
!mouseStillClickedMoveLarge && mouseStillClickedMoveUp)
{
solidBrushArrowUpBackground = new SolidBrush(colorArrowClickBackground);
solidBrushArrowUp = new SolidBrush(colorArrowClick);
penArrowUp = new Pen(colorArrowClick, 2.5F);
}
else if (arrowUpHovered)
{
solidBrushArrowUpBackground = new SolidBrush(colorArrowHoverBackground);
solidBrushArrowUp = new SolidBrush(colorArrowHover);
penArrowUp = new Pen(colorArrowHover, 2.5F);
}
else
{
solidBrushArrowUpBackground = new SolidBrush(colorScrollbarBackground);
solidBrushArrowUp = new SolidBrush(colorArrow);
penArrowUp = new Pen(colorArrow, 2.5F);
}
e.Graphics.FillRectangle(solidBrushArrowUpBackground, GetUpArrowRectangleWithoutBorder());
int widthDevidedBy2 = Width / 2;
int widthDevidedBy6 = Width / 6;
int widthDevidedBy2PluswidthDevidedBy8 = widthDevidedBy2 + (Width / 8);
PointF pointArrowUp1 = new(widthDevidedBy2 - widthDevidedBy6, widthDevidedBy2PluswidthDevidedBy8);
PointF pointArrowUp2 = new(widthDevidedBy2 + widthDevidedBy6, widthDevidedBy2PluswidthDevidedBy8);
PointF pointArrowUp3 = new(widthDevidedBy2, widthDevidedBy2PluswidthDevidedBy8 - widthDevidedBy6);
PointF pointArrowUp4 = pointArrowUp1;
PointF[] curvePoints =
{
pointArrowUp1,
pointArrowUp2,
pointArrowUp3,
pointArrowUp4,
};
e.Graphics.FillPolygon(solidBrushArrowUp, curvePoints);
e.Graphics.DrawPolygon(penArrowUp, curvePoints);
// draw slider
SolidBrush solidBrushSlider;
if (sliderDragging)
{
solidBrushSlider = new SolidBrush(colorSliderDragging);
}
else if (sliderHovered)
{
solidBrushSlider = new SolidBrush(colorSliderHover);
}
else
{
if (arrowUpHovered || arrowDownHovered || trackHovered)
{
solidBrushSlider = new SolidBrush(colorSliderArrowsAndTrackHover);
}
else
{
solidBrushSlider = new SolidBrush(colorSlider);
}
}
Rectangle rectangleSlider = new(1, top, Width - 2, sliderHeight);
e.Graphics.FillRectangle(solidBrushSlider, rectangleSlider);
// Draw arrowDown
SolidBrush solidBrushArrowDownBackground;
SolidBrush solidBrushArrowDown;
Pen penArrowDown;
if (timerMouseStillClicked.Enabled &&
!mouseStillClickedMoveLarge && !mouseStillClickedMoveUp)
{
solidBrushArrowDownBackground = new SolidBrush(colorArrowClickBackground);
solidBrushArrowDown = new SolidBrush(colorArrowClick);
penArrowDown = new Pen(colorArrowClick, 2.5F);
}
else
if (arrowDownHovered)
{
solidBrushArrowDownBackground = new SolidBrush(colorArrowHoverBackground);
solidBrushArrowDown = new SolidBrush(colorArrowHover);
penArrowDown = new Pen(colorArrowHover, 2.5F);
}
else
{
solidBrushArrowDownBackground = new SolidBrush(colorScrollbarBackground);
solidBrushArrowDown = new SolidBrush(colorArrow);
penArrowDown = new Pen(colorArrow, 2.5F);
}
e.Graphics.FillRectangle(solidBrushArrowDownBackground, GetDownArrowRectangleWithoutBorder(trackHeight));
PointF pointArrowDown1 = new(widthDevidedBy2 - widthDevidedBy6, Height - widthDevidedBy2PluswidthDevidedBy8);
PointF pointArrowDown2 = new(widthDevidedBy2 + widthDevidedBy6, Height - widthDevidedBy2PluswidthDevidedBy8);
PointF pointArrowDown3 = new(widthDevidedBy2, Height - widthDevidedBy2PluswidthDevidedBy8 + widthDevidedBy6);
PointF pointArrowDown4 = pointArrowDown1;
PointF[] curvePointsArrowDown =
{
pointArrowDown1,
pointArrowDown2,
pointArrowDown3,
pointArrowDown4,
};
e.Graphics.FillPolygon(solidBrushArrowDown, curvePointsArrowDown);
e.Graphics.DrawPolygon(penArrowDown, curvePointsArrowDown);
}
private void TimerMouseStillClicked_Tick(object sender, EventArgs e)
{
timerMouseStillClickedCounter++;
Point pointCursor = PointToClient(Cursor.Position);
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int top = (int)sliderTop + Width;
Rectangle sliderRectangle = GetSliderRectangle(sliderHeight, top);
if (sliderRectangle.Contains(pointCursor))
{
timerMouseStillClicked.Stop();
}
else if (timerMouseStillClickedCounter > 6)
{
float change;
if (mouseStillClickedMoveLarge)
{
change = SmallChange * MenuDefines.Scrollspeed;
}
else
{
change = SmallChange;
}
if (mouseStillClickedMoveUp)
{
MoveUp(change);
}
else
{
MoveDown(change);
}
}
}
private void InitializeComponent()
{
SuspendLayout();
Name = "CustomScrollbar";
MouseDown += CustomScrollbar_MouseDown;
MouseMove += CustomScrollbar_MouseMove;
MouseUp += CustomScrollbar_MouseUp;
MouseLeave += CustomScrollbar_MouseLeave;
ResumeLayout(false);
}
private void CustomScrollbar_MouseLeave(object sender, EventArgs e)
{
arrowUpHovered = false;
sliderHovered = false;
arrowDownHovered = false;
trackHovered = false;
Refresh();
}
private void CustomScrollbar_MouseDown(object sender, MouseEventArgs e)
{
Point pointCursor = PointToClient(Cursor.Position);
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int top = (int)sliderTop + Width;
Rectangle sliderRectangle = GetSliderRectangle(sliderHeight, top);
Rectangle trackRectangle = GetTrackRectangle(trackHeight);
if (sliderRectangle.Contains(pointCursor))
{
clickPoint = pointCursor.Y - top;
sliderDown = true;
}
else if (trackRectangle.Contains(pointCursor))
{
if (e.Y < sliderRectangle.Y)
{
MoveUp(Height);
mouseStillClickedMoveUp = true;
}
else
{
MoveDown(Height);
mouseStillClickedMoveUp = false;
}
mouseStillClickedMoveLarge = true;
timerMouseStillClickedCounter = 0;
timerMouseStillClicked.Start();
}
Rectangle upArrowRectangle = GetUpArrowRectangle();
if (upArrowRectangle.Contains(pointCursor))
{
MoveUp(SmallChange);
mouseStillClickedMoveUp = true;
mouseStillClickedMoveLarge = false;
timerMouseStillClickedCounter = 0;
timerMouseStillClicked.Start();
}
Rectangle downArrowRectangle = GetDownArrowRectangle(trackHeight);
if (downArrowRectangle.Contains(pointCursor))
{
MoveDown(SmallChange);
mouseStillClickedMoveUp = false;
mouseStillClickedMoveLarge = false;
timerMouseStillClickedCounter = 0;
timerMouseStillClicked.Start();
}
}
private void MoveDown(float change)
{
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int realRange = GetRealRange();
int pixelRange = trackHeight - sliderHeight;
if (realRange > 0)
{
if (pixelRange > 0)
{
float changeForOneItem = GetChangeForOneItem(change, pixelRange);
if ((sliderTop + changeForOneItem) > pixelRange)
{
sliderTop = pixelRange;
}
else
{
sliderTop += changeForOneItem;
}
CalculateValue(pixelRange);
if (Value != lastValue)
{
ValueChanged?.Invoke(this, new EventArgs());
Scroll?.Invoke(this, new EventArgs());
lastValue = Value;
}
Invalidate();
}
}
}
private void MoveUp(float change)
{
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int realRange = GetRealRange();
int pixelRange = trackHeight - sliderHeight;
if (realRange > 0)
{
if (pixelRange > 0)
{
float changeForOneItem = GetChangeForOneItem(change, pixelRange);
if ((sliderTop - changeForOneItem) < 0)
{
sliderTop = 0;
}
else
{
sliderTop -= changeForOneItem;
}
CalculateValue(pixelRange);
if (Value != lastValue)
{
ValueChanged?.Invoke(this, new EventArgs());
Scroll?.Invoke(this, new EventArgs());
lastValue = Value;
}
Invalidate();
}
}
}
private void CustomScrollbar_MouseUp(object sender, MouseEventArgs e)
{
sliderDown = false;
sliderDragging = false;
timerMouseStillClicked.Stop();
}
private void CustomScrollbar_MouseMove(object sender, MouseEventArgs e)
{
if (sliderDown == true)
{
sliderDragging = true;
}
if (sliderDragging)
{
MoveSlider(e.Y);
}
if (Value != lastValue)
{
ValueChanged?.Invoke(this, new EventArgs());
Scroll?.Invoke(this, new EventArgs());
lastValue = Value;
}
Point pointCursor = PointToClient(Cursor.Position);
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int top = (int)sliderTop + Width;
Rectangle sliderRectangle = GetSliderRectangle(sliderHeight, top);
Rectangle trackRectangle = GetTrackRectangle(trackHeight);
if (sliderRectangle.Contains(pointCursor))
{
if (e.Button != MouseButtons.Left)
{
arrowUpHovered = false;
sliderHovered = true;
arrowDownHovered = false;
trackHovered = false;
}
}
else if (trackRectangle.Contains(pointCursor))
{
arrowUpHovered = false;
sliderHovered = false;
arrowDownHovered = false;
trackHovered = true;
}
Rectangle upArrowRectangle = GetUpArrowRectangle();
if (upArrowRectangle.Contains(pointCursor))
{
if (e.Button != MouseButtons.Left)
{
arrowUpHovered = true;
sliderHovered = false;
arrowDownHovered = false;
trackHovered = false;
}
}
Rectangle downArrowRectangle = GetDownArrowRectangle(trackHeight);
if (downArrowRectangle.Contains(pointCursor))
{
if (e.Button != MouseButtons.Left)
{
arrowUpHovered = false;
sliderHovered = false;
arrowDownHovered = true;
trackHovered = false;
}
}
Invalidate();
}
private void MoveSlider(int y)
{
int nRealRange = Maximum - Minimum;
int trackHeight = GetTrackHeight();
int sliderHeight = GetSliderHeight(trackHeight);
int spot = clickPoint;
int pixelRange = trackHeight - sliderHeight;
if (sliderDown && nRealRange > 0)
{
if (pixelRange > 0)
{
int newSliderTop = y - (Width + spot);
if (newSliderTop < 0)
{
sliderTop = 0;
}
else if (newSliderTop > pixelRange)
{
sliderTop = pixelRange;
}
else
{
sliderTop = y - (Width + spot);
}
CalculateValue(pixelRange);
Invalidate();
}
}
}
private void CalculateValue(int pixelRange)
{
float percentage = sliderTop / pixelRange;
float fValue = percentage * (Maximum - LargeChange);
value = (int)fValue;
}
private Rectangle GetSliderRectangle(int sliderHeight, int top)
{
return new Rectangle(new Point(0, top), new Size(Width + 1, sliderHeight));
}
private Rectangle GetUpArrowRectangle()
{
return new Rectangle(new Point(0, 0), new Size(Width + 1, Width));
}
private Rectangle GetUpArrowRectangleWithoutBorder()
{
return new Rectangle(new Point(1, 0), new Size(Width - 2, Width));
}
private Rectangle GetDownArrowRectangle(int trackHeight)
{
return new Rectangle(new Point(0, Width + trackHeight), new Size(Width + 1, Width));
}
private Rectangle GetDownArrowRectangleWithoutBorder(int trackHeight)
{
return new Rectangle(new Point(1, Width + trackHeight), new Size(Width - 2, Width));
}
private Rectangle GetTrackRectangle(int trackHeight)
{
return new Rectangle(new Point(0, Width), new Size(Width + 1, trackHeight));
}
private int GetRealRange()
{
return Maximum - Minimum - (int)LargeChange;
}
private float GetChangeForOneItem(float change, int pixelRange)
{
return change * pixelRange / (Maximum - LargeChange);
}
private int GetTrackHeight()
{
return Height - (Width + Width);
}
private int GetSliderHeight(int trackHeight)
{
int sliderHeight = (int)((float)LargeChange / Maximum * trackHeight);
if (sliderHeight > trackHeight)
{
sliderHeight = trackHeight;
}
if (sliderHeight < 56)
{
sliderHeight = 56;
}
return sliderHeight;
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,35 @@
// <copyright file="ScrollbarControlDesigner.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
using System.ComponentModel;
using System.Windows.Forms.Design;
internal class ScrollbarControlDesigner : ControlDesigner
{
public override SelectionRules SelectionRules
{
get
{
SelectionRules selectionRules = base.SelectionRules;
PropertyDescriptor propDescriptor = TypeDescriptor.GetProperties(Component)["AutoSize"];
if (propDescriptor != null)
{
bool autoSize = (bool)propDescriptor.GetValue(Component);
if (autoSize)
{
selectionRules = SelectionRules.Visible | SelectionRules.Moveable | SelectionRules.BottomSizeable | SelectionRules.TopSizeable;
}
else
{
selectionRules = SelectionRules.Visible | SelectionRules.AllSizeable | SelectionRules.Moveable;
}
}
return selectionRules;
}
}
}
}

View File

@@ -0,0 +1,40 @@
// <copyright file="LabelNoCopy.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
using System;
using System.Windows.Forms;
/// <summary>
/// Workaround class for "Clipboard" issue on .Net Windows Forms Label (https://github.com/Hofknecht/SystemTrayMenu/issues/5)
/// On Label MouseDoubleClick the framework will copy the title text into the clipboard.
/// We avoid this by overriding the Text atrribute and use own _text attribute.
/// Text will remain unset and clipboard copy will not take place but it is still possible to get/set Text attribute as usual from outside.
/// (see: https://stackoverflow.com/questions/2519587/is-there-any-way-to-disable-the-double-click-to-copy-functionality-of-a-net-l)
///
/// Note: When you have trouble with the Visual Studio Designer not showing the GUI properly, simply build once and reopen the Designer.
/// This will place the required files into the Designer's cache and becomes able to show the GUI as usual.
/// </summary>
public class LabelNoCopy : Label
{
private string text;
public override string Text
{
get => text;
set
{
value ??= string.Empty;
if (text != value)
{
text = value;
Refresh();
OnTextChanged(EventArgs.Empty);
}
}
}
}
}

View File

@@ -0,0 +1,13 @@
// <copyright file="Language.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
public class Language
{
public string Name { get; set; }
public string Value { get; set; }
}
}

View File

@@ -0,0 +1,149 @@
// <copyright file="Menu.ControlsTheDesignerRemoves.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
using System.Drawing;
using System.Windows.Forms;
using FSI.BT.Tools.Global.Utilities;
using FSI.BT.Tools.SystemTrayMenu.Utilities;
internal partial class Menu
{
public bool IsLoadingMenu { get; internal set; }
private void InitializeComponentControlsTheDesignerRemoves()
{
DataGridViewCellStyle dataGridViewCellStyle1 = new();
DataGridViewCellStyle dataGridViewCellStyle2 = new();
DataGridViewCellStyle dataGridViewCellStyle3 = new();
labelTitle = new LabelNoCopy();
ColumnText = new DataGridViewTextBoxColumn();
ColumnIcon = new DataGridViewImageColumn();
customScrollbar = new CustomScrollbar();
tableLayoutPanelDgvAndScrollbar.Controls.Add(customScrollbar, 1, 0);
// tableLayoutPanelDgvAndScrollbar.SuspendLayout();
// ((System.ComponentModel.ISupportInitialize)dgv).BeginInit();
// tableLayoutPanelSearch.SuspendLayout();
// ((System.ComponentModel.ISupportInitialize)pictureBoxSearch).BeginInit();
// tableLayoutPanelMenu.SuspendLayout();
// SuspendLayout();
// labelTitle
labelTitle.AutoEllipsis = true;
labelTitle.AutoSize = true;
labelTitle.Dock = DockStyle.Fill;
labelTitle.Font = new Font("Segoe UI", 8.25F * Scaling.Factor, FontStyle.Bold, GraphicsUnit.Point, 0);
labelTitle.ForeColor = Color.Black;
labelTitle.Location = new Point(0, 0);
labelTitle.Margin = new Padding(0);
labelTitle.Name = "labelTitle";
labelTitle.Padding = new Padding(3, 0, 0, 1);
labelTitle.Size = new Size(70, 14);
labelTitle.Text = "FSI.BT.Tools.SystemTrayMenu";
labelTitle.TextAlign = ContentAlignment.MiddleCenter;
labelTitle.MouseWheel += new MouseEventHandler(DgvMouseWheel);
labelTitle.MouseDown += Menu_MouseDown;
labelTitle.MouseUp += Menu_MouseUp;
labelTitle.MouseMove += Menu_MouseMove;
// tableLayoutPanelMenu
tableLayoutPanelMenu.MouseDown += Menu_MouseDown;
tableLayoutPanelMenu.MouseUp += Menu_MouseUp;
tableLayoutPanelMenu.MouseMove += Menu_MouseMove;
// tableLayoutPanelBottom
tableLayoutPanelBottom.MouseDown += Menu_MouseDown;
tableLayoutPanelBottom.MouseUp += Menu_MouseUp;
tableLayoutPanelBottom.MouseMove += Menu_MouseMove;
// ColumnIcon
ColumnIcon.DataPropertyName = "ColumnIcon";
dataGridViewCellStyle1.Alignment = DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.NullValue = "System.Drawing.Icon";
dataGridViewCellStyle1.Padding = new Padding(3, 1, 2, 1);
ColumnIcon.DefaultCellStyle = dataGridViewCellStyle1;
ColumnIcon.Frozen = true;
ColumnIcon.HeaderText = "ColumnIcon";
ColumnIcon.ImageLayout = DataGridViewImageCellLayout.Zoom;
ColumnIcon.Name = "ColumnIcon";
ColumnIcon.ReadOnly = true;
ColumnIcon.Resizable = DataGridViewTriState.False;
ColumnIcon.Width = 25;
// ColumnText
ColumnText.DataPropertyName = "ColumnText";
dataGridViewCellStyle2.Alignment = DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.Padding = new Padding(0, 0, 3, 0);
ColumnText.DefaultCellStyle = dataGridViewCellStyle2;
ColumnText.Frozen = true;
ColumnText.HeaderText = "ColumnText";
ColumnText.MaxInputLength = 40;
ColumnText.Name = "ColumnText";
ColumnText.ReadOnly = true;
ColumnText.Resizable = DataGridViewTriState.False;
ColumnText.SortMode = DataGridViewColumnSortMode.Programmatic;
ColumnText.Width = 25;
dgv.Columns.AddRange(new DataGridViewColumn[]
{
ColumnIcon,
ColumnText,
});
dataGridViewCellStyle3.Font = new Font("Segoe UI", 7F * Scaling.Factor, FontStyle.Regular, GraphicsUnit.Pixel, 0);
dgv.RowsDefaultCellStyle = dataGridViewCellStyle3;
dgv.RowTemplate.DefaultCellStyle.Font = new Font("Segoe UI", 9F * Scaling.Factor, FontStyle.Regular, GraphicsUnit.Point, 0);
dgv.RowTemplate.Height = 20;
dgv.RowTemplate.ReadOnly = true;
textBoxSearch.ContextMenuStrip = new ContextMenuStrip();
tableLayoutPanelMenu.Controls.Add(labelTitle, 0, 0);
// customScrollbar
customScrollbar.Location = new Point(0, 0);
customScrollbar.Name = "customScrollbar";
customScrollbar.Size = new Size(Scaling.Scale(15), 40);
pictureBoxOpenFolder.Size = new Size(
Scaling.Scale(pictureBoxOpenFolder.Width),
Scaling.Scale(pictureBoxOpenFolder.Height));
pictureBoxMenuAlwaysOpen.Size = new Size(
Scaling.Scale(pictureBoxMenuAlwaysOpen.Width),
Scaling.Scale(pictureBoxMenuAlwaysOpen.Height));
pictureBoxSettings.Size = new Size(
Scaling.Scale(pictureBoxSettings.Width),
Scaling.Scale(pictureBoxSettings.Height));
pictureBoxRestart.Size = new Size(
Scaling.Scale(pictureBoxRestart.Width),
Scaling.Scale(pictureBoxRestart.Height));
pictureBoxSearch.Size = new Size(
Scaling.Scale(pictureBoxSearch.Width),
Scaling.Scale(pictureBoxSearch.Height));
labelItems.Font = new Font("Segoe UI", 7F * Scaling.Factor, FontStyle.Bold, GraphicsUnit.Point, 0);
// tableLayoutPanelDgvAndScrollbar.ResumeLayout(false);
// ((System.ComponentModel.ISupportInitialize)dgv).EndInit();
// tableLayoutPanelSearch.ResumeLayout(false);
// tableLayoutPanelSearch.PerformLayout();
// ((System.ComponentModel.ISupportInitialize)pictureBoxSearch).EndInit();
// tableLayoutPanelMenu.ResumeLayout(false);
// tableLayoutPanelMenu.PerformLayout();
// customScrollbar.PerformLayout();
// ResumeLayout(false);
// PerformLayout();
}
}
}

View File

@@ -0,0 +1,417 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface {
using System;
partial class Menu
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
timerUpdateIcons.Stop();
timerUpdateIcons.Tick -= TimerUpdateIcons_Tick;
timerUpdateIcons.Tick += TimerUpdateIcons_Tick_Loading;
timerUpdateIcons.Dispose();
fading.ChangeOpacity -= Fading_ChangeOpacity;
fading.Show -= Fading_Show;
fading.Hide -= Hide;
fading.Dispose();
dgv.GotFocus -= Dgv_GotFocus;
dgv.MouseEnter -= ControlsMouseEnter;
dgv.MouseLeave -= ControlsMouseLeave;
customScrollbar.GotFocus -= CustomScrollbar_GotFocus;
customScrollbar.Scroll -= CustomScrollbar_Scroll;
customScrollbar.MouseEnter -= ControlsMouseEnter;
customScrollbar.MouseLeave -= ControlsMouseLeave;
customScrollbar.Dispose();
labelTitle.MouseEnter -= ControlsMouseEnter;
labelTitle.MouseLeave -= ControlsMouseLeave;
textBoxSearch.MouseEnter -= ControlsMouseEnter;
textBoxSearch.MouseLeave -= ControlsMouseLeave;
pictureBoxOpenFolder.MouseEnter -= ControlsMouseEnter;
pictureBoxOpenFolder.MouseLeave -= ControlsMouseLeave;
pictureBoxMenuAlwaysOpen.MouseEnter -= ControlsMouseEnter;
pictureBoxMenuAlwaysOpen.MouseLeave -= ControlsMouseLeave;
pictureBoxMenuAlwaysOpen.Paint -= PictureBoxMenuAlwaysOpen_Paint;
pictureBoxMenuAlwaysOpen.Paint -= LoadingMenu_Paint;
pictureBoxSettings.MouseEnter -= ControlsMouseEnter;
pictureBoxSettings.MouseLeave -= ControlsMouseLeave;
pictureBoxRestart.MouseEnter -= ControlsMouseEnter;
pictureBoxRestart.MouseLeave -= ControlsMouseLeave;
pictureBoxSearch.MouseEnter -= ControlsMouseEnter;
pictureBoxSearch.MouseLeave -= ControlsMouseLeave;
tableLayoutPanelMenu.MouseEnter -= ControlsMouseEnter;
tableLayoutPanelMenu.MouseLeave -= ControlsMouseLeave;
tableLayoutPanelDgvAndScrollbar.MouseEnter -= ControlsMouseEnter;
tableLayoutPanelDgvAndScrollbar.MouseLeave -= ControlsMouseLeave;
tableLayoutPanelBottom.MouseEnter -= ControlsMouseEnter;
tableLayoutPanelBottom.MouseLeave -= ControlsMouseLeave;
labelItems.MouseEnter -= ControlsMouseEnter;
labelItems.MouseLeave -= ControlsMouseLeave;
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.tableLayoutPanelDgvAndScrollbar = new System.Windows.Forms.TableLayoutPanel();
this.dgv = new System.Windows.Forms.DataGridView();
this.tableLayoutPanelSearch = new System.Windows.Forms.TableLayoutPanel();
this.textBoxSearch = new System.Windows.Forms.TextBox();
this.pictureBoxSearch = new System.Windows.Forms.PictureBox();
this.labelItems = new System.Windows.Forms.Label();
this.tableLayoutPanelMenu = new System.Windows.Forms.TableLayoutPanel();
this.panelLine = new System.Windows.Forms.Panel();
this.tableLayoutPanelBottom = new System.Windows.Forms.TableLayoutPanel();
this.pictureBoxRestart = new System.Windows.Forms.PictureBox();
this.pictureBoxSettings = new System.Windows.Forms.PictureBox();
this.pictureBoxMenuAlwaysOpen = new System.Windows.Forms.PictureBox();
this.pictureBoxOpenFolder = new System.Windows.Forms.PictureBox();
this.timerUpdateIcons = new System.Windows.Forms.Timer(this.components);
this.tableLayoutPanelDgvAndScrollbar.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgv)).BeginInit();
this.tableLayoutPanelSearch.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSearch)).BeginInit();
this.tableLayoutPanelMenu.SuspendLayout();
this.tableLayoutPanelBottom.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxRestart)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSettings)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMenuAlwaysOpen)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxOpenFolder)).BeginInit();
this.SuspendLayout();
//
// tableLayoutPanelDgvAndScrollbar
//
this.tableLayoutPanelDgvAndScrollbar.AutoSize = true;
this.tableLayoutPanelDgvAndScrollbar.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelDgvAndScrollbar.ColumnCount = 2;
this.tableLayoutPanelDgvAndScrollbar.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelDgvAndScrollbar.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelDgvAndScrollbar.Controls.Add(this.dgv, 0, 0);
this.tableLayoutPanelDgvAndScrollbar.Location = new System.Drawing.Point(3, 25);
this.tableLayoutPanelDgvAndScrollbar.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanelDgvAndScrollbar.Name = "tableLayoutPanelDgvAndScrollbar";
this.tableLayoutPanelDgvAndScrollbar.RowCount = 1;
this.tableLayoutPanelDgvAndScrollbar.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelDgvAndScrollbar.Size = new System.Drawing.Size(55, 40);
this.tableLayoutPanelDgvAndScrollbar.TabIndex = 3;
this.tableLayoutPanelDgvAndScrollbar.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DgvMouseWheel);
//
// dgv
//
this.dgv.AllowUserToAddRows = false;
this.dgv.AllowUserToDeleteRows = false;
this.dgv.AllowUserToResizeColumns = false;
this.dgv.AllowUserToResizeRows = false;
this.dgv.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.dgv.BackgroundColor = System.Drawing.Color.White;
this.dgv.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dgv.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dgv.ClipboardCopyMode = System.Windows.Forms.DataGridViewClipboardCopyMode.Disable;
this.dgv.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
this.dgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
this.dgv.ColumnHeadersVisible = false;
this.dgv.Location = new System.Drawing.Point(0, 0);
this.dgv.Margin = new System.Windows.Forms.Padding(0);
this.dgv.Name = "dgv";
this.dgv.RowHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.None;
this.dgv.RowHeadersVisible = false;
this.dgv.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Segoe UI", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel);
this.dgv.RowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgv.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.dgv.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgv.ShowCellErrors = false;
this.dgv.ShowCellToolTips = false;
this.dgv.ShowEditingIcon = false;
this.dgv.ShowRowErrors = false;
this.dgv.Size = new System.Drawing.Size(55, 40);
this.dgv.TabIndex = 4;
this.dgv.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DgvMouseWheel);
//
// tableLayoutPanelSearch
//
this.tableLayoutPanelSearch.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.tableLayoutPanelSearch.AutoSize = true;
this.tableLayoutPanelSearch.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelSearch.BackColor = System.Drawing.Color.White;
this.tableLayoutPanelSearch.ColumnCount = 2;
this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelSearch.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelSearch.Controls.Add(this.textBoxSearch, 1, 0);
this.tableLayoutPanelSearch.Controls.Add(this.pictureBoxSearch, 0, 0);
this.tableLayoutPanelSearch.Location = new System.Drawing.Point(3, 0);
this.tableLayoutPanelSearch.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanelSearch.Name = "tableLayoutPanelSearch";
this.tableLayoutPanelSearch.RowCount = 1;
this.tableLayoutPanelSearch.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelSearch.Size = new System.Drawing.Size(128, 22);
this.tableLayoutPanelSearch.TabIndex = 5;
this.tableLayoutPanelSearch.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DgvMouseWheel);
//
// textBoxSearch
//
this.textBoxSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.textBoxSearch.BackColor = System.Drawing.Color.White;
this.textBoxSearch.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.textBoxSearch.Font = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point);
this.textBoxSearch.Location = new System.Drawing.Point(25, 4);
this.textBoxSearch.Margin = new System.Windows.Forms.Padding(3, 4, 3, 2);
this.textBoxSearch.MaxLength = 37;
this.textBoxSearch.Name = "textBoxSearch";
this.textBoxSearch.Size = new System.Drawing.Size(100, 15);
this.textBoxSearch.TabIndex = 0;
this.textBoxSearch.TextChanged += new System.EventHandler(this.TextBoxSearch_TextChanged);
this.textBoxSearch.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxSearch_KeyPress);
//
// pictureBoxSearch
//
this.pictureBoxSearch.BackColor = System.Drawing.Color.White;
this.pictureBoxSearch.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBoxSearch.Location = new System.Drawing.Point(1, 1);
this.pictureBoxSearch.Margin = new System.Windows.Forms.Padding(1);
this.pictureBoxSearch.Name = "pictureBoxSearch";
this.pictureBoxSearch.Size = new System.Drawing.Size(20, 20);
this.pictureBoxSearch.TabIndex = 1;
this.pictureBoxSearch.TabStop = false;
this.pictureBoxSearch.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBoxSearch_Paint);
this.pictureBoxSearch.Resize += new System.EventHandler(this.PictureBox_Resize);
//
// labelItems
//
this.labelItems.Anchor = System.Windows.Forms.AnchorStyles.Left;
this.labelItems.AutoSize = true;
this.labelItems.ForeColor = System.Drawing.Color.White;
this.labelItems.Location = new System.Drawing.Point(10, 3);
this.labelItems.Margin = new System.Windows.Forms.Padding(0, 6, 0, 0);
this.labelItems.Name = "labelItems";
this.labelItems.Size = new System.Drawing.Size(45, 15);
this.labelItems.TabIndex = 2;
this.labelItems.Text = "0 items";
//
// tableLayoutPanelMenu
//
this.tableLayoutPanelMenu.AutoSize = true;
this.tableLayoutPanelMenu.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelMenu.ColumnCount = 1;
this.tableLayoutPanelMenu.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelMenu.Controls.Add(this.tableLayoutPanelSearch, 0, 1);
this.tableLayoutPanelMenu.Controls.Add(this.panelLine, 0, 2);
this.tableLayoutPanelMenu.Controls.Add(this.tableLayoutPanelBottom, 0, 6);
this.tableLayoutPanelMenu.Controls.Add(this.tableLayoutPanelDgvAndScrollbar, 0, 4);
this.tableLayoutPanelMenu.Location = new System.Drawing.Point(1, 1);
this.tableLayoutPanelMenu.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanelMenu.Name = "tableLayoutPanelMenu";
this.tableLayoutPanelMenu.Padding = new System.Windows.Forms.Padding(6, 0, 6, 6);
this.tableLayoutPanelMenu.RowCount = 7;
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 1F));
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 2F));
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 2F));
this.tableLayoutPanelMenu.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelMenu.Size = new System.Drawing.Size(159, 89);
this.tableLayoutPanelMenu.TabIndex = 4;
this.tableLayoutPanelMenu.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.DgvMouseWheel);
//
// panelLine
//
this.panelLine.AutoSize = true;
this.panelLine.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.panelLine.BackColor = System.Drawing.Color.Silver;
this.panelLine.Dock = System.Windows.Forms.DockStyle.Fill;
this.panelLine.Location = new System.Drawing.Point(3, 22);
this.panelLine.Margin = new System.Windows.Forms.Padding(0);
this.panelLine.Name = "panelLine";
this.panelLine.Size = new System.Drawing.Size(153, 1);
this.panelLine.TabIndex = 6;
//
// tableLayoutPanelBottom
//
this.tableLayoutPanelBottom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.tableLayoutPanelBottom.AutoSize = true;
this.tableLayoutPanelBottom.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.tableLayoutPanelBottom.BackColor = System.Drawing.Color.Transparent;
this.tableLayoutPanelBottom.ColumnCount = 8;
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 10F));
this.tableLayoutPanelBottom.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanelBottom.Controls.Add(this.pictureBoxRestart, 6, 0);
this.tableLayoutPanelBottom.Controls.Add(this.pictureBoxSettings, 5, 0);
this.tableLayoutPanelBottom.Controls.Add(this.pictureBoxMenuAlwaysOpen, 4, 0);
this.tableLayoutPanelBottom.Controls.Add(this.pictureBoxOpenFolder, 3, 0);
this.tableLayoutPanelBottom.Controls.Add(this.labelItems, 1, 0);
this.tableLayoutPanelBottom.Location = new System.Drawing.Point(3, 67);
this.tableLayoutPanelBottom.Margin = new System.Windows.Forms.Padding(0);
this.tableLayoutPanelBottom.Name = "tableLayoutPanelBottom";
this.tableLayoutPanelBottom.RowCount = 1;
this.tableLayoutPanelBottom.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanelBottom.Size = new System.Drawing.Size(153, 22);
this.tableLayoutPanelBottom.TabIndex = 5;
//
// pictureBoxRestart
//
this.pictureBoxRestart.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxRestart.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBoxRestart.Location = new System.Drawing.Point(122, 1);
this.pictureBoxRestart.Margin = new System.Windows.Forms.Padding(1, 5, 1, 1);
this.pictureBoxRestart.Name = "pictureBoxRestart";
this.pictureBoxRestart.Size = new System.Drawing.Size(16, 16);
this.pictureBoxRestart.TabIndex = 3;
this.pictureBoxRestart.TabStop = false;
this.pictureBoxRestart.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBoxRestart_Paint);
this.pictureBoxRestart.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PictureBoxRestart_MouseClick);
this.pictureBoxRestart.MouseEnter += new System.EventHandler(this.PictureBox_MouseEnter);
this.pictureBoxRestart.MouseLeave += new System.EventHandler(this.PictureBox_MouseLeave);
this.pictureBoxRestart.Resize += new System.EventHandler(this.PictureBox_Resize);
//
// pictureBoxSettings
//
this.pictureBoxSettings.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxSettings.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBoxSettings.Location = new System.Drawing.Point(100, 1);
this.pictureBoxSettings.Margin = new System.Windows.Forms.Padding(1, 5, 1, 1);
this.pictureBoxSettings.Name = "pictureBoxSettings";
this.pictureBoxSettings.Size = new System.Drawing.Size(16, 16);
this.pictureBoxSettings.TabIndex = 2;
this.pictureBoxSettings.TabStop = false;
this.pictureBoxSettings.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBoxSettings_Paint);
this.pictureBoxSettings.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PictureBoxSettings_MouseClick);
this.pictureBoxSettings.MouseEnter += new System.EventHandler(this.PictureBox_MouseEnter);
this.pictureBoxSettings.MouseLeave += new System.EventHandler(this.PictureBox_MouseLeave);
this.pictureBoxSettings.Resize += new System.EventHandler(this.PictureBox_Resize);
//
// pictureBoxMenuAlwaysOpen
//
this.pictureBoxMenuAlwaysOpen.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxMenuAlwaysOpen.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBoxMenuAlwaysOpen.Location = new System.Drawing.Point(78, 1);
this.pictureBoxMenuAlwaysOpen.Margin = new System.Windows.Forms.Padding(1, 5, 1, 1);
this.pictureBoxMenuAlwaysOpen.Name = "pictureBoxMenuAlwaysOpen";
this.pictureBoxMenuAlwaysOpen.Size = new System.Drawing.Size(16, 16);
this.pictureBoxMenuAlwaysOpen.TabIndex = 1;
this.pictureBoxMenuAlwaysOpen.TabStop = false;
this.pictureBoxMenuAlwaysOpen.Click += new System.EventHandler(this.PictureBoxMenuAlwaysOpen_Click);
this.pictureBoxMenuAlwaysOpen.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBoxMenuAlwaysOpen_Paint);
this.pictureBoxMenuAlwaysOpen.DoubleClick += new System.EventHandler(this.PictureBoxMenuAlwaysOpen_Click);
this.pictureBoxMenuAlwaysOpen.MouseEnter += new System.EventHandler(this.PictureBox_MouseEnter);
this.pictureBoxMenuAlwaysOpen.MouseLeave += new System.EventHandler(this.PictureBox_MouseLeave);
this.pictureBoxMenuAlwaysOpen.Resize += new System.EventHandler(this.PictureBox_Resize);
//
// pictureBoxOpenFolder
//
this.pictureBoxOpenFolder.BackColor = System.Drawing.Color.Transparent;
this.pictureBoxOpenFolder.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.pictureBoxOpenFolder.Location = new System.Drawing.Point(56, 1);
this.pictureBoxOpenFolder.Margin = new System.Windows.Forms.Padding(1, 5, 1, 1);
this.pictureBoxOpenFolder.Name = "pictureBoxOpenFolder";
this.pictureBoxOpenFolder.Size = new System.Drawing.Size(16, 16);
this.pictureBoxOpenFolder.TabIndex = 1;
this.pictureBoxOpenFolder.TabStop = false;
this.pictureBoxOpenFolder.Paint += new System.Windows.Forms.PaintEventHandler(this.PictureBoxOpenFolder_Paint);
this.pictureBoxOpenFolder.MouseClick += new System.Windows.Forms.MouseEventHandler(this.PictureBoxOpenFolder_Click);
this.pictureBoxOpenFolder.MouseEnter += new System.EventHandler(this.PictureBox_MouseEnter);
this.pictureBoxOpenFolder.MouseLeave += new System.EventHandler(this.PictureBox_MouseLeave);
this.pictureBoxOpenFolder.Resize += new System.EventHandler(this.PictureBox_Resize);
//
// Controls like the scrollbar are removed when open the designer
// When adding after InitializeComponent(), then e.g. scrollbar on high dpi not more working
//
InitializeComponentControlsTheDesignerRemoves();
//
// timerUpdateIcons
//
this.timerUpdateIcons.Tick += new System.EventHandler(this.TimerUpdateIcons_Tick);
//
// Menu
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.AutoSize = true;
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.BackColor = System.Drawing.Color.Black;
this.ClientSize = new System.Drawing.Size(302, 347);
this.Controls.Add(this.tableLayoutPanelMenu);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Menu";
this.Opacity = 0.01D;
this.Padding = new System.Windows.Forms.Padding(1);
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "SystemTrayMenu";
this.TopMost = true;
this.tableLayoutPanelDgvAndScrollbar.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgv)).EndInit();
this.tableLayoutPanelSearch.ResumeLayout(false);
this.tableLayoutPanelSearch.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSearch)).EndInit();
this.tableLayoutPanelMenu.ResumeLayout(false);
this.tableLayoutPanelMenu.PerformLayout();
this.tableLayoutPanelBottom.ResumeLayout(false);
this.tableLayoutPanelBottom.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxRestart)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxSettings)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxMenuAlwaysOpen)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBoxOpenFolder)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private SystemTrayMenu.UserInterface.LabelNoCopy labelTitle;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelDgvAndScrollbar;
private System.Windows.Forms.DataGridView dgv;
private System.Windows.Forms.DataGridViewImageColumn ColumnIcon;
private System.Windows.Forms.DataGridViewTextBoxColumn ColumnText;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelSearch;
private System.Windows.Forms.TextBox textBoxSearch;
private System.Windows.Forms.PictureBox pictureBoxSearch;
private UserInterface.CustomScrollbar customScrollbar;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelMenu;
private System.Windows.Forms.PictureBox pictureBoxOpenFolder;
private System.Windows.Forms.PictureBox pictureBoxMenuAlwaysOpen;
private System.Windows.Forms.Label labelItems;
private System.Windows.Forms.Timer timerUpdateIcons;
private System.Windows.Forms.PictureBox pictureBoxSettings;
private System.Windows.Forms.PictureBox pictureBoxRestart;
private System.Windows.Forms.TableLayoutPanel tableLayoutPanelBottom;
private System.Windows.Forms.Panel panelLine;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timerUpdateIcons.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,37 @@
// <copyright file="ShellContextMenuException.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.Helper
{
using System;
using System.Runtime.Serialization;
[Serializable]
public class ShellContextMenuException : Exception
{
public ShellContextMenuException()
{
// Add any type-specific logic, and supply the default message.
}
public ShellContextMenuException(string message)
: base(message)
{
// Add any type-specific logic.
}
public ShellContextMenuException(string message, Exception innerException)
: base(message, innerException)
{
// Add any type-specific logic for inner exceptions.
}
protected ShellContextMenuException(
SerializationInfo info, StreamingContext context)
: base(info, context)
{
// Implement type-specific serialization constructor logic.
}
}
}

View File

@@ -0,0 +1,40 @@
// <copyright file="ShellHelper.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.Helper
{
using System;
internal static class ShellHelper
{
/// <summary>
/// Retrieves the High Word of a WParam of a WindowMessage.
/// </summary>
/// <param name="ptr">The pointer to the WParam.</param>
/// <returns>The unsigned integer for the High Word.</returns>
public static uint HiWord(IntPtr ptr)
{
uint param32 = (uint)(ptr.ToInt64() | 0xffffffffL);
if ((param32 & 0x80000000) == 0x80000000)
{
return param32 >> 16;
}
else
{
return (param32 >> 16) & 0xffff;
}
}
/// <summary>
/// Retrieves the Low Word of a WParam of a WindowMessage.
/// </summary>
/// <param name="ptr">The pointer to the WParam.</param>
/// <returns>The unsigned integer for the Low Word.</returns>
public static uint LoWord(IntPtr ptr)
{
uint param32 = (uint)(ptr.ToInt64() | 0xffffffffL);
return param32 & 0xffff;
}
}
}

View File

@@ -0,0 +1,55 @@
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
partial class TaskbarForm
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TaskbarForm));
this.SuspendLayout();
//
// TaskbarForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.BackColor = System.Drawing.Color.White;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.ClientSize = new System.Drawing.Size(159, 136);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "TaskbarForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.Text = "SystemTrayMenu";
this.LocationChanged += new System.EventHandler(this.TaskbarForm_LocationChanged);
this.ResumeLayout(false);
}
#endregion
}
}

View File

@@ -0,0 +1,39 @@
// <copyright file="TaskbarForm.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace FSI.BT.Tools.SystemTrayMenu.UserInterface
{
using System.Drawing;
using System.Windows.Forms;
public partial class TaskbarForm : Form
{
public TaskbarForm()
{
InitializeComponent();
Icon = Config.GetAppIcon();
MaximumSize = new Size(10, 1);
// Opacity = 0.01f;
// (otherwise: Task View causes Explorer restart when SystemTrayMenu is open #299)
SetLocation();
}
private void TaskbarForm_LocationChanged(object sender, System.EventArgs e)
{
SetLocation();
}
/// <summary>
/// Hide below taskbar.
/// </summary>
private void SetLocation()
{
Screen screen = Screen.PrimaryScreen;
Location = new Point(
screen.Bounds.Right - Size.Width,
screen.Bounds.Bottom + 80);
}
}
}

File diff suppressed because it is too large Load Diff