diff --git a/LanMontainDesktop/Views/Components/ClockWidget.axaml b/LanMontainDesktop/Views/Components/ClockWidget.axaml
index 3da6dac..9666856 100644
--- a/LanMontainDesktop/Views/Components/ClockWidget.axaml
+++ b/LanMontainDesktop/Views/Components/ClockWidget.axaml
@@ -7,7 +7,8 @@
d:DesignHeight="70"
x:Class="LanMontainDesktop.Views.Components.ClockWidget">
-
diff --git a/LanMontainDesktop/Views/Components/ClockWidget.axaml.cs b/LanMontainDesktop/Views/Components/ClockWidget.axaml.cs
index 1f8c555..9468166 100644
--- a/LanMontainDesktop/Views/Components/ClockWidget.axaml.cs
+++ b/LanMontainDesktop/Views/Components/ClockWidget.axaml.cs
@@ -2,6 +2,7 @@ using System;
using System.Globalization;
using Avalonia;
using Avalonia.Controls;
+using Avalonia.Media;
using Avalonia.Threading;
namespace LanMontainDesktop.Views.Components;
@@ -44,4 +45,15 @@ public partial class ClockWidget : UserControl
var now = DateTime.Now;
TimeTextBlock.Text = now.ToString("HH:mm:ss", CultureInfo.CurrentCulture);
}
+
+ public void ApplyCellSize(double cellSize)
+ {
+ var padding = Math.Clamp(cellSize * 0.12, 2, 14);
+ RootBorder.Padding = new Thickness(padding);
+ RootBorder.CornerRadius = new CornerRadius(Math.Clamp(cellSize * 0.16, 4, 18));
+
+ // Keep the time legible across dense and sparse grid layouts.
+ TimeTextBlock.FontSize = Math.Clamp(cellSize * 0.42, 10, 56);
+ TimeTextBlock.FontWeight = FontWeight.SemiBold;
+ }
}
diff --git a/LanMontainDesktop/Views/MainWindow.axaml b/LanMontainDesktop/Views/MainWindow.axaml
index 9fa1e71..f9623b5 100644
--- a/LanMontainDesktop/Views/MainWindow.axaml
+++ b/LanMontainDesktop/Views/MainWindow.axaml
@@ -44,7 +44,7 @@
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Click="OnMinimizeClick"
- Content="回到Windows" />
+ Content="回到Windows" />
@@ -64,7 +64,7 @@
Grid.Column="0"
VerticalAlignment="Center"
Foreground="#FFE5E7EB"
- Text="短边格数" />
+ Text="短边格数" />
+ Content="应用" />
+ {
+ if (WindowState is not (WindowState.Minimized or WindowState.FullScreen))
+ {
+ WindowState = WindowState.FullScreen;
+ }
+ });
+ }
}