mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
UI Tweaks
This commit is contained in:
@@ -270,6 +270,12 @@ namespace GHelper
|
||||
labelCharge.Click += LabelCharge_Click;
|
||||
|
||||
buttonDonate.Click += ButtonDonate_Click;
|
||||
|
||||
if (AppConfig.Get("start_count") > 10 && !AppConfig.Is("donate_click"))
|
||||
{
|
||||
buttonDonate.BorderColor = colorTurbo;
|
||||
buttonDonate.Badge = true;
|
||||
}
|
||||
|
||||
labelDynamicLighting.Click += LabelDynamicLighting_Click;
|
||||
|
||||
@@ -279,6 +285,8 @@ namespace GHelper
|
||||
|
||||
private void ButtonDonate_Click(object? sender, EventArgs e)
|
||||
{
|
||||
AppConfig.Set("donate_click", 1);
|
||||
buttonDonate.Badge = false;
|
||||
Process.Start(new ProcessStartInfo("https://github.com/seerge/g-helper/wiki/Support-Project") { UseShellExecute = true });
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,16 @@ namespace GHelper.UI
|
||||
}
|
||||
}
|
||||
|
||||
private bool badge = false;
|
||||
public bool Badge
|
||||
{
|
||||
get { return badge; }
|
||||
set
|
||||
{
|
||||
badge = value;
|
||||
}
|
||||
}
|
||||
|
||||
public RButton()
|
||||
{
|
||||
DoubleBuffered = true;
|
||||
@@ -99,6 +109,16 @@ namespace GHelper.UI
|
||||
pevent.Graphics.DrawPath(penBorder, pathBorder);
|
||||
}
|
||||
|
||||
if (badge)
|
||||
{
|
||||
using (Brush brush = new SolidBrush(borderColor))
|
||||
{
|
||||
var radius = ratio * 10;
|
||||
var padding = ratio * 10;
|
||||
pevent.Graphics.FillEllipse(brush, rectSurface.Width - padding - (2 * radius), padding, radius + radius, radius + radius);
|
||||
}
|
||||
}
|
||||
|
||||
if (!Enabled && ForeColor != SystemColors.ControlText)
|
||||
{
|
||||
var rect = pevent.ClipRectangle;
|
||||
|
||||
Reference in New Issue
Block a user