Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

Commit c8030c4

Browse files
committed
fix: add missed events to extra button
1 parent 119a65b commit c8030c4

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

Plain Craft Launcher 2/Controls/MyExtraButton.xaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
<ScaleTransform ScaleX="0" ScaleY="0" />
1111
</Grid.RenderTransform>
1212
<Border x:Name="PanClick" CornerRadius="1000" BorderThickness="0.001"
13-
Background="{StaticResource ColorBrushSemiTransparent}" />
13+
Background="{StaticResource ColorBrushSemiTransparent}"
14+
MouseLeftButtonUp="Button_LeftMouseUp" MouseLeftButtonDown="Button_LeftMouseDown"
15+
MouseRightButtonUp="Button_RightMouseUp" MouseRightButtonDown="Button_RightMouseDown"
16+
MouseLeave="PanClick_MouseEvent" MouseEnter="PanClick_MouseEvent"/>
1417
<Grid x:Name="PanScale" IsHitTestVisible="False" RenderTransformOrigin="0.5,0.5" Margin="0,10,0,0">
1518
<Grid.RenderTransform>
1619
<ScaleTransform />

Plain Craft Launcher 2/Controls/MyExtraButton.xaml.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ public partial class MyExtraButton
3535

3636
public MyExtraButton()
3737
{
38+
Loaded += (_, _) => RefreshColor();
39+
IsEnabledChanged += (_, _) => RefreshColor();
3840
InitializeComponent();
39-
40-
Loaded += (_, __) => RefreshColor();
41-
IsEnabledChanged += (_, __) => RefreshColor();
41+
PanClick.MouseLeave += (_, _) => Button_MouseLeave();
4242
}
4343

4444
public double Progress
@@ -303,4 +303,9 @@ public void Ribble()
303303
}, "ExtraButton Ribble " + ModBase.GetUuid());
304304
});
305305
}
306+
307+
private void PanClick_MouseEvent(object sender, MouseEventArgs e)
308+
{
309+
RefreshColor();
310+
}
306311
}

Plain Craft Launcher 2/Pages/PageLogRight.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ public partial class PageLogRight
1818

1919
public PageLogRight()
2020
{
21-
InitializeComponent();
2221
Initialized += (_, __) => Init();
2322
Loaded += PageLogRight_Loaded;
23+
InitializeComponent();
2424
}
2525

2626
public void Init()

0 commit comments

Comments
 (0)