diff --git a/ZongziTEK_Blackboard_Sticker/MainWindow.xaml b/ZongziTEK_Blackboard_Sticker/MainWindow.xaml
index e4c2018..17670ee 100644
--- a/ZongziTEK_Blackboard_Sticker/MainWindow.xaml
+++ b/ZongziTEK_Blackboard_Sticker/MainWindow.xaml
@@ -91,26 +91,50 @@
HorizontalAlignment="Right" Visibility="{Binding Visibility, ElementName=eraserButton}">
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
diff --git a/ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs b/ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
index 2ddcca6..c5e7019 100644
--- a/ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
+++ b/ZongziTEK_Blackboard_Sticker/MainWindow.xaml.cs
@@ -290,33 +290,41 @@ private void btnClearOK_Click(object sender, RoutedEventArgs e)
//touchGrid.Visibility = Visibility.Visible;
}
- private void squarePicker_ColorChanged(object sender, RoutedEventArgs e)
- {
- borderShowColor.Background = new SolidColorBrush(squarePicker.SelectedColor);
- inkCanvas.DefaultDrawingAttributes.Color = squarePicker.SelectedColor;
- }
- private void btnWhite_Click(object sender, RoutedEventArgs e)
+ private void BorderColorSelector_MouseUp(object sender, MouseButtonEventArgs e)
{
- squarePicker.SelectedColor = ((SolidColorBrush)btnWhite.Background).Color;
+ if (sender is Border)
+ {
+ Border border = (Border)sender;
+ squarePicker.SelectedColor = ((SolidColorBrush)border.Background).Color;
+ }
}
- private void btnBlue_Click(object sender, RoutedEventArgs e)
+ private void squarePicker_PreviewMouseUp(object sender, MouseButtonEventArgs e)
{
- squarePicker.SelectedColor = ((SolidColorBrush)btnBlue.Background).Color;
+ if (squarePicker.ColorState.HSL_S == 0 || squarePicker.ColorState.HSL_L == 0)
+ {
+ TeachingTipColorPicker.IsOpen = true;
+ }
}
- private void btnYellow_Click(object sender, RoutedEventArgs e)
+ private void squarePicker_ColorChanged(object sender, RoutedEventArgs e)
{
- squarePicker.SelectedColor = ((SolidColorBrush)btnYellow.Background).Color;
+ borderShowColor.Background = new SolidColorBrush(squarePicker.SelectedColor);
+ inkCanvas.DefaultDrawingAttributes.Color = squarePicker.SelectedColor;
}
- private void btnRed_Click(object sender, RoutedEventArgs e)
+ private void btnCloseColorPicker_Click(object sender, RoutedEventArgs e)
{
- squarePicker.SelectedColor = ((SolidColorBrush)btnRed.Background).Color;
+ HideColorPicker();
}
- private void btnCloseColorPicker_Click(object sender, RoutedEventArgs e)
+
+ private void SliderPenThickness_ValueChanged(object sender, RoutedPropertyChangedEventArgs e)
{
- borderColorPicker.Visibility = Visibility.Collapsed;
+ if (drawingAttributes != null)
+ {
+ drawingAttributes.Width = SliderPenThickness.Value;
+ drawingAttributes.Height = SliderPenThickness.Value;
+ }
}
private void ToggleButtonLock_Click(object sender, RoutedEventArgs e)
@@ -433,6 +441,8 @@ private void ShowColorPicker()
private async void HideColorPicker()
{
+ TeachingTipColorPicker.IsOpen = false;
+
ThicknessAnimation marginAnimation = new()
{
From = originalColorPickerMargin,
@@ -1983,7 +1993,7 @@ public static void SetTheme()
if (window.inkCanvas.DefaultDrawingAttributes.Color == Colors.White)
{
- window.btnWhite_Click(null, null);
+ window.inkCanvas.DefaultDrawingAttributes.Color = Colors.Black;
}
foreach (Stroke stroke in window.inkCanvas.Strokes)
@@ -2005,7 +2015,7 @@ public static void SetTheme()
if (window.inkCanvas.DefaultDrawingAttributes.Color == Colors.Black)
{
- window.btnWhite_Click(null, null);
+ window.inkCanvas.DefaultDrawingAttributes.Color = Colors.White;
}
foreach (Stroke stroke in window.inkCanvas.Strokes)
{
diff --git a/ZongziTEK_Blackboard_Sticker/TimetableNotificationWindow.xaml.cs b/ZongziTEK_Blackboard_Sticker/TimetableNotificationWindow.xaml.cs
index b599389..9be9ace 100644
--- a/ZongziTEK_Blackboard_Sticker/TimetableNotificationWindow.xaml.cs
+++ b/ZongziTEK_Blackboard_Sticker/TimetableNotificationWindow.xaml.cs
@@ -86,13 +86,15 @@ private void Timer_Tick(object sender, EventArgs e)
timeLeft = timeToHide - DateTime.Now.TimeOfDay;
TextTime.Text = timeLeft.TotalSeconds.ToString("00");
- if (timeLeft.TotalSeconds == 1)
+ if (timeLeft.TotalSeconds <= 1)
{
- if (!isTimeHidden) HideTime();
+ if (!isTimeHidden)
+ HideTime();
}
- else if (timeLeft.TotalSeconds <= 0)
+ if (timeLeft <= TimeSpan.Zero)
{
- if (!isNotificationHidden) HideNotification();
+ if (!isNotificationHidden)
+ HideNotification();
}
}
@@ -106,16 +108,25 @@ private void ShowNotification()
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut }
};
- ThicknessAnimation marginAnimation = new()
+ /*ThicknessAnimation marginAnimation = new()
{
From = new Thickness(0, -160, 0, 0),
To = new Thickness(0),
Duration = TimeSpan.FromMilliseconds(750),
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut }
+ };*/
+
+ DoubleAnimation topAnimation = new()
+ {
+ From = -Height,
+ To = 0,
+ Duration = TimeSpan.FromMilliseconds(750),
+ EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseOut }
};
GridNotification.BeginAnimation(OpacityProperty, opacityAnimation);
- GridNotification.BeginAnimation(MarginProperty, marginAnimation);
+ //GridNotification.BeginAnimation(MarginProperty, marginAnimation);
+ BeginAnimation(TopProperty, topAnimation);
}
private async void HideNotification()
@@ -130,16 +141,25 @@ private async void HideNotification()
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn }
};
- ThicknessAnimation marginAnimation = new()
+ /*ThicknessAnimation marginAnimation = new()
{
From = new Thickness(0),
To = new Thickness(0, -160, 0, 0),
Duration = TimeSpan.FromMilliseconds(750),
EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn }
+ };*/
+
+ DoubleAnimation topAnimation = new()
+ {
+ From = 0,
+ To = -Height,
+ Duration = TimeSpan.FromMilliseconds(750),
+ EasingFunction = new CubicEase() { EasingMode = EasingMode.EaseIn }
};
GridNotification.BeginAnimation(OpacityProperty, opacityAnimation);
- GridNotification.BeginAnimation(MarginProperty, marginAnimation);
+ //GridNotification.BeginAnimation(MarginProperty, marginAnimation);
+ BeginAnimation(TopProperty, topAnimation);
await Task.Delay(750);
Close();