Skip to content

Commit

Permalink
Merge pull request #2255 from GabeMx5/master
Browse files Browse the repository at this point in the history
bugfix #2254
  • Loading branch information
arkypita authored May 23, 2024
2 parents 57c4580 + 29fc62e commit c5795f6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 21 deletions.
2 changes: 1 addition & 1 deletion LaserGRBL/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion ("6.9.9")]
[assembly: AssemblyVersion ("6.9.10")]
[assembly: NeutralResourcesLanguage("en")]
46 changes: 26 additions & 20 deletions LaserGRBL/UserControls/ImageButton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace LaserGRBL.UserControls
{
Expand Down Expand Up @@ -212,34 +213,39 @@ protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
else
{
float direction = ColorScheme.DarkScheme ? 1 : -1;
Color borderColor = (Tmp.Tag as LoadedImageTag).Color;
if (DrawDisabled())
{
Tmp = Base.Drawing.ImageTransform.SetColor(Tmp, ColorScheme.DisabledButtons);
borderColor = ColorScheme.DisabledButtons;
}
else
Color borderColor = ColorScheme.ControlsBorder;
if (Tmp != null)
{
if (IsMouseInside())
LoadedImageTag tag = Tmp.Tag as LoadedImageTag;
borderColor = tag?.Color ?? ColorScheme.ControlsBorder;
if (DrawDisabled())
{
Tmp = Base.Drawing.ImageTransform.SetColor(Tmp, ColorScheme.DisabledButtons);
borderColor = ColorScheme.DisabledButtons;
}
else
{
if (MouseButtons == MouseButtons.Left)
if (IsMouseInside())
{
borderColor = ColorScheme.ChangeColorBrightness(borderColor, 0.3F * direction);
Tmp = Base.Drawing.ImageTransform.Brightness(Tmp, 0.3F * direction);
Point = new Point(Point.X + CLICK_SCALE_IN_PIXEL, CLICK_SCALE_IN_PIXEL);
Size.Width -= CLICK_SCALE_IN_PIXEL * 2;
Size.Height -= CLICK_SCALE_IN_PIXEL * 2;
if (MouseButtons == MouseButtons.Left)
{
borderColor = ColorScheme.ChangeColorBrightness(borderColor, 0.3F * direction);
Tmp = Base.Drawing.ImageTransform.Brightness(Tmp, 0.3F * direction);
Point = new Point(Point.X + CLICK_SCALE_IN_PIXEL, CLICK_SCALE_IN_PIXEL);
Size.Width -= CLICK_SCALE_IN_PIXEL * 2;
Size.Height -= CLICK_SCALE_IN_PIXEL * 2;
}
else
{
borderColor = ColorScheme.ChangeColorBrightness(borderColor, 0.2F * direction);
Tmp = Base.Drawing.ImageTransform.Brightness(Tmp, 0.2F * direction);
}
}
else
{
borderColor = ColorScheme.ChangeColorBrightness(borderColor, 0.2F * direction);
Tmp = Base.Drawing.ImageTransform.Brightness(Tmp, 0.2F * direction);
//Tmp = Base.Drawing.ImageTransform.Brightness(Tmp, 0);
}
}
else
{
//Tmp = Base.Drawing.ImageTransform.Brightness(Tmp, 0);
}
}

e.Graphics.Clear(ColorScheme.FormBackColor);
Expand Down

0 comments on commit c5795f6

Please sign in to comment.