-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from LoadedCamel/dev
3.6.6.3
- Loading branch information
Showing
35 changed files
with
964 additions
and
1,733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
...UIv2/v2Controls/PowersControl.Designer.cs → MidsReborn/Controls/LabelEx.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Drawing; | ||
using System.Windows.Forms; | ||
|
||
namespace Mids_Reborn.Controls | ||
{ | ||
public sealed partial class LabelEx : Label | ||
{ | ||
public LabelEx() | ||
{ | ||
SetStyle(ControlStyles.SupportsTransparentBackColor, true); | ||
BackColor = Color.Transparent; | ||
InitializeComponent(); | ||
} | ||
|
||
protected override CreateParams CreateParams | ||
{ | ||
get | ||
{ | ||
var cp = base.CreateParams; | ||
cp.ExStyle |= 0x20; // EX_TRANSPARENT | ||
return cp; | ||
} | ||
} | ||
|
||
protected override void OnPaintBackground(PaintEventArgs e) | ||
{ | ||
// Paint background with underlying graphics from other controls | ||
base.OnPaintBackground(e); | ||
var g = e.Graphics; | ||
|
||
if (Parent == null) return; | ||
|
||
// Take each control in turn | ||
var index = Parent.Controls.GetChildIndex(this); | ||
for (var i = Parent.Controls.Count - 1; i > index; i--) | ||
{ | ||
var c = Parent.Controls[i]; | ||
|
||
// Check it's visible and overlaps this control | ||
if (!c.Bounds.IntersectsWith(Bounds) || !c.Visible) continue; | ||
|
||
// Load appearance of underlying control and redraw it on this background | ||
var bmp = new Bitmap(c.Width, c.Height, g); | ||
c.DrawToBitmap(bmp, c.ClientRectangle); | ||
g.TranslateTransform(c.Left - Left, c.Top - Top); | ||
g.DrawImageUnscaled(bmp, Point.Empty); | ||
g.TranslateTransform(Left - c.Left, Top - c.Top); | ||
bmp.Dispose(); | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Drawing; | ||
using System.Drawing.Drawing2D; | ||
|
||
namespace Mids_Reborn.Core.Base.Extensions | ||
{ | ||
public static class GraphicsPathExt | ||
{ | ||
public static void AddRoundRectangle(this GraphicsPath path, Rectangle rectangle, int radius) | ||
{ | ||
var diameter = radius * 2; | ||
var size = new Size(diameter, diameter); | ||
var arc = new Rectangle(rectangle.Location, size); | ||
|
||
path.AddArc(arc, 180, 90); // Top-left corner | ||
arc.X = rectangle.Right - diameter; | ||
path.AddArc(arc, 270, 90); // Top-right corner | ||
arc.Y = rectangle.Bottom - diameter; | ||
path.AddArc(arc, 0, 90); // Bottom-right corner | ||
arc.X = rectangle.Left; | ||
path.AddArc(arc, 90, 90); // Bottom-left corner | ||
path.CloseFigure(); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Mids_Reborn.Core.Base.IO_Classes; | ||
|
||
public interface IMessenger | ||
{ | ||
void SetMessage(string text); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.