diff --git a/RetroBar/Controls/Clock.xaml.cs b/RetroBar/Controls/Clock.xaml.cs
index 2f969bb0..33738e20 100644
--- a/RetroBar/Controls/Clock.xaml.cs
+++ b/RetroBar/Controls/Clock.xaml.cs
@@ -8,6 +8,7 @@
using System.Windows.Threading;
using ManagedShell.Common.Helpers;
using ManagedShell.Common.Logging;
+using ManagedShell.UWPInterop;
using Microsoft.Win32;
using RetroBar.Utilities;
@@ -27,7 +28,6 @@ public DateTime Now
}
private readonly DispatcherTimer clock = new DispatcherTimer(DispatcherPriority.Background);
- private readonly DispatcherTimer singleClick = new DispatcherTimer(DispatcherPriority.Input);
private bool _isLoaded;
@@ -38,9 +38,6 @@ public Clock()
clock.Interval = TimeSpan.FromMilliseconds(200);
clock.Tick += Clock_Tick;
-
- singleClick.Interval = TimeSpan.FromMilliseconds(System.Windows.Forms.SystemInformation.DoubleClickTime);
- singleClick.Tick += SingleClick_Tick;
}
private void Initialize()
@@ -65,7 +62,7 @@ private void StartClock()
SetTime();
clock.Start();
-
+
Visibility = Visibility.Visible;
}
@@ -96,22 +93,6 @@ private void Clock_Tick(object sender, EventArgs args)
SetTime();
}
- private void SingleClick_Tick(object sender, EventArgs args)
- {
- // Windows 10-11 single-click action
- // A double-click will cancel the timer so that this doesn't run
-
- singleClick.Stop();
- if (EnvironmentHelper.IsWindows11OrBetter)
- {
- ShellHelper.ShowNotificationCenter();
- }
- else
- {
- ShellHelper.ShowActionCenter();
- }
- }
-
private void TimeChanged(object sender, EventArgs e)
{
TimeZoneInfo.ClearCachedData();
@@ -181,15 +162,36 @@ private void SetTime()
private void Clock_OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
- if (EnvironmentHelper.IsWindows10OrBetter)
+ switch (Settings.Instance.ClockClickAction)
{
- singleClick.Start();
+ case ClockClickOption.OpenModernCalendar:
+ Point screenPosition = PointToScreen(new(0, 0));
+ ManagedShell.Interop.NativeMethods.Rect rect = new(
+ (int)screenPosition.X, (int)screenPosition.Y,
+ (int)(screenPosition.X + RenderSize.Width),
+ (int)(screenPosition.Y + RenderSize.Height)
+ );
+ ImmersiveShellHelper.ShowClockFlyout(rect);
+ break;
+ case ClockClickOption.OpenAeroCalendar:
+ IntPtr hWnd = (PresentationSource.FromVisual(this) as System.Windows.Interop.HwndSource).Handle;
+ ClockFlyoutLauncher.ShowAeroClockFlyout(hWnd);
+ break;
+ case ClockClickOption.OpenNotificationCenter:
+ if (EnvironmentHelper.IsWindows10RS4OrBetter)
+ {
+ ImmersiveShellHelper.ShowActionCenter();
+ }
+ else
+ {
+ ShellHelper.ShowActionCenter();
+ }
+ break;
}
}
private void Clock_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
- singleClick.Stop();
ShellHelper.StartProcess("timedate.cpl");
e.Handled = true;
diff --git a/RetroBar/Languages/English (United Kingdom).xaml b/RetroBar/Languages/English (United Kingdom).xaml
index ae4de2dd..a02d1e13 100644
--- a/RetroBar/Languages/English (United Kingdom).xaml
+++ b/RetroBar/Languages/English (United Kingdom).xaml
@@ -3,6 +3,13 @@
xmlns:s="clr-namespace:System;assembly=mscorlib">
_Customise...
+
+ Do nothing
+ Open Aero calendar
+ Open Modern calendar
+ Open Notification Centre
+
+
Customise Notifications
RetroBar displays icons for active and urgent notifications, and hides inactive ones. You can change this behaviour for items in the list below.
Select an item, then choose its notification behaviour:
diff --git a/RetroBar/Languages/English.xaml b/RetroBar/Languages/English.xaml
index 8bf6f7d4..4d46b6fb 100644
--- a/RetroBar/Languages/English.xaml
+++ b/RetroBar/Languages/English.xaml
@@ -58,6 +58,13 @@
Open a new instance
Close the task
+ _Clock click action:
+
+ Do nothing
+ Open Aero calendar
+ Open Modern calendar
+ Open Notification Center
+
Version {0}
Visit RetroBar on GitHub
Taskbar scale
diff --git "a/RetroBar/Languages/espa\303\261ol.xaml" "b/RetroBar/Languages/espa\303\261ol.xaml"
index 4da012ad..40061d3b 100644
--- "a/RetroBar/Languages/espa\303\261ol.xaml"
+++ "b/RetroBar/Languages/espa\303\261ol.xaml"
@@ -57,6 +57,13 @@
Abrir una nueva instancia
Cerrar la tarea
+ _Acción al hacer clic en el reloj:
+
+ No hacer nada
+ Abrir el calendario Aero
+ Abrir el calendario Moderno
+ Abrir el Centro de notificaciones
+
Versión {0}
Visitar RetroBar en GitHub
Escala de barra de tareas
diff --git a/RetroBar/PropertiesWindow.xaml b/RetroBar/PropertiesWindow.xaml
index 7eb2bf15..83edb2e5 100644
--- a/RetroBar/PropertiesWindow.xaml
+++ b/RetroBar/PropertiesWindow.xaml
@@ -182,8 +182,7 @@
ToolTip="{DynamicResource language_tip}" />
+ SelectedValue="{Binding Source={x:Static Settings:Settings.Instance}, Path=Language, UpdateSourceTrigger=PropertyChanged}" />
+
+
+
+