Skip to content

Commit

Permalink
v2.8.0-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmayer-dev committed Jan 29, 2022
1 parent 0d360e5 commit 2ac87be
Show file tree
Hide file tree
Showing 38 changed files with 764 additions and 166 deletions.
6 changes: 1 addition & 5 deletions GUI/CustomControls/DialogForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions GUI/CustomControls/DialogForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public DialogForm()
InitializeComponent();
(new DropShadow()).ApplyShadows(this);
this.ResizeEnd += OnResizeEnd;
this.MouseDown += DialogForm_MouseDown;
}

private void OnResizeEnd(object sender, EventArgs e)
Expand Down
3 changes: 0 additions & 3 deletions GUI/CustomControls/DialogForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="open_animation_timer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down
47 changes: 23 additions & 24 deletions GUI/CustomControls/Form.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions GUI/CustomControls/Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ private void HelpMenuExportLog_Click(object sender, EventArgs e)
}
}
}

}
}
32 changes: 9 additions & 23 deletions GUI/CustomControls/HorizontalTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,17 @@ protected override void OnPaint(PaintEventArgs e)
{
Rectangle buttonSurface = new Rectangle(new Point(GetTabRect(i).Location.X + 6, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width - 5, GetTabRect(i).Height - 1));

Rectangle rectSelected = new Rectangle
{
Height = 3,
Width = buttonSurface.Width - 8,
X = buttonSurface.X + 4,
Y = buttonSurface.Y + buttonSurface.Height - 3,
};
Rectangle rectHover = new Rectangle
{
Height = 3,
Width = buttonSurface.Width - 16,
X = buttonSurface.X + 8,
Y = buttonSurface.Y + buttonSurface.Height - 3,
};



using (SolidBrush backgroundBrush = new SolidBrush(this.Parent.BackColor))
using (SolidBrush selectedBrush = new SolidBrush(Color.FromArgb(0, 123, 255)))
using (SolidBrush selectedBrush = new SolidBrush(Colors.WindowsAccentColorDark))
{
g.FillRectangle(backgroundBrush, buttonSurface);
if (i == SelectedIndex)
switch (i == SelectedIndex)
{
g.FillRectangle(selectedBrush, rectSelected);
case true:
g.FillRectangle(selectedBrush, buttonSurface);
break;
case false:
g.FillRectangle(backgroundBrush, buttonSurface);
break;
}
}

Expand All @@ -70,8 +57,7 @@ protected override void OnPaint(PaintEventArgs e)
{
try
{
g.DrawImage(ImageList.Images[TabPages[i].ImageIndex],
new Point(buttonSurface.Location.X + 8, buttonSurface.Location.Y + 6));
g.DrawImage(ImageList.Images[TabPages[i].ImageIndex], new Point(buttonSurface.Location.X + 8, buttonSurface.Location.Y + 6));
g.DrawString(" " + TabPages[i].Text, Font, Brushes.White, buttonSurface, new StringFormat
{
LineAlignment = StringAlignment.Center,
Expand Down
2 changes: 2 additions & 0 deletions GUI/CustomControls/RoundedButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);

pe.Graphics.InterpolationMode = InterpolationMode.High;

int radius = (int)(((float)this.Radius / 100.0f) * (float)this.Height);

Color borderColor = Color.FromArgb(35, 35, 35);
Expand Down
67 changes: 38 additions & 29 deletions GUI/CustomControls/VerticalTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ public class VerticalTabControl : TabControl
{
private List<int> _notificationIndexes = new List<int>();

public Color SelectedTabColor { get; set; } = Colors.DefaultAccentColorDark;


public VerticalTabControl()
{
SetStyle(
Expand All @@ -35,48 +38,54 @@ public void SetNotification(int tabIndex, bool value)
this.Invalidate();
}

private GraphicsPath GetFigurePath(Rectangle rect, int radius)
{
GraphicsPath path = new GraphicsPath();
float curveSize = radius * 2F;

path.StartFigure();
path.AddArc(rect.X, rect.Y, curveSize, curveSize, 180, 90);
path.AddArc(rect.Right - curveSize, rect.Y, curveSize, curveSize, 270, 90);
path.AddArc(rect.Right - curveSize, rect.Bottom - curveSize, curveSize, curveSize, 0, 90);
path.AddArc(rect.X, rect.Bottom - curveSize, curveSize, curveSize, 90, 90);
path.CloseFigure();
return path;
}

protected override void OnPaint(PaintEventArgs e)
{
Bitmap b = new Bitmap(Width, Height);
Graphics g = Graphics.FromImage(b);

g.Clear(Color.FromArgb(45, 45, 45));
g.FillRectangle(new SolidBrush(Color.FromArgb(45, 45, 45)),
new Rectangle(0, 0, ItemSize.Height + 4, Height));
g.DrawLine(new Pen(Color.FromArgb(45, 45, 45)), new Point(ItemSize.Height + 3, 0),
new Point(ItemSize.Height + 3, 999));
g.DrawLine(new Pen(Color.FromArgb(45, 45, 45)), new Point(0, Size.Height - 1),
new Point(Width + 3, Size.Height - 1));
g.FillRectangle(new SolidBrush(Color.FromArgb(45, 45, 45)), new Rectangle(0, 0, ItemSize.Height + 4, Height));
g.DrawLine(new Pen(Color.FromArgb(45, 45, 45)), new Point(ItemSize.Height + 3, 0), new Point(ItemSize.Height + 3, 999));
g.DrawLine(new Pen(Color.FromArgb(45, 45, 45)), new Point(0, Size.Height - 1), new Point(Width + 3, Size.Height - 1));


for (int i = 0; i <= TabCount - 1; i++)
{
Rectangle x2 = new Rectangle(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1));
Rectangle buttonRectangle = new Rectangle(new Point(GetTabRect(i).Location.X - 2, GetTabRect(i).Location.Y - 2), new Size(GetTabRect(i).Width + 3, GetTabRect(i).Height - 1));

if (i == SelectedIndex)
switch (i == SelectedIndex)
{
g.FillRectangle(new SolidBrush(this.Parent.BackColor), x2);
g.DrawRectangle(new Pen(Color.FromArgb(0, 123, 255)), x2); // Umrandung
case true:

g.SmoothingMode = SmoothingMode.HighQuality;
Point[] p =
{
new Point(ItemSize.Height - 3, GetTabRect(i).Location.Y + 20),
new Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 14),
new Point(ItemSize.Height + 4, GetTabRect(i).Location.Y + 27)
};
g.FillPolygon(SystemBrushes.Control, p);
g.DrawPolygon(new Pen(Color.FromArgb(170, 187, 204)), p);
using (GraphicsPath pathBorderSmooth = GetFigurePath(buttonRectangle, 8))
{
g.SmoothingMode = SmoothingMode.AntiAlias;
g.FillPath(new SolidBrush(SelectedTabColor), pathBorderSmooth);
}

}
else
{
g.FillRectangle(new SolidBrush(this.Parent.BackColor), x2);
break;
case false:
g.FillRectangle(new SolidBrush(this.Parent.BackColor), buttonRectangle);
break;
}

if (this._notificationIndexes.Contains(i))
{
g.FillEllipse(Brushes.Red, x2.X + x2.Width - 22, x2.Y + 6, 10, 10);
g.FillEllipse(Brushes.Red, buttonRectangle.X + buttonRectangle.Width - 22, buttonRectangle.Y + 6, 10, 10);
}


Expand All @@ -85,17 +94,17 @@ protected override void OnPaint(PaintEventArgs e)
{
try
{
g.DrawImage(ImageList.Images[i], new Point(x2.Location.X + 8, x2.Location.Y + 22 - (ImageList.ImageSize.Height / 2)));

g.DrawString(" " + TabPages[i].Text, Font, Brushes.White, x2, new StringFormat
g.InterpolationMode = InterpolationMode.High;
g.DrawImage(ImageList.Images[i], new Rectangle(buttonRectangle.Location.X + 8, buttonRectangle.Location.Y + 22 - (24 / 2), 24, 24));
g.DrawString(" " + TabPages[i].Text, Font, Brushes.White, buttonRectangle, new StringFormat
{
LineAlignment = StringAlignment.Center,
Alignment = StringAlignment.Center
});
}
catch (Exception)
{
g.DrawString(TabPages[i].Text, Font, Brushes.White, x2, new StringFormat
g.DrawString(TabPages[i].Text, Font, Brushes.White, buttonRectangle, new StringFormat
{
LineAlignment = StringAlignment.Center,
Alignment = StringAlignment.Center
Expand All @@ -104,7 +113,7 @@ protected override void OnPaint(PaintEventArgs e)
}
else
{
g.DrawString(TabPages[i].Text, Font, Brushes.White, x2, new StringFormat
g.DrawString(TabPages[i].Text, Font, Brushes.White, buttonRectangle, new StringFormat
{
LineAlignment = StringAlignment.Center,
Alignment = StringAlignment.Center
Expand Down
38 changes: 38 additions & 0 deletions GUI/ExtensionStore/ExtensionStorePluginItemView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2ac87be

Please sign in to comment.