浏览代码

Round corners

Daniel Chalmers 6 年之前
父节点
当前提交
ef60fbbaff
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 4 4
      DesktopClock/MainWindow.xaml
  2. 1 0
      DesktopClock/Properties/Settings.cs

+ 4 - 4
DesktopClock/MainWindow.xaml

@@ -88,11 +88,11 @@
     </Window.ContextMenu>
 
     <Viewbox Height="{Binding Height, Source={x:Static p:Settings.Default}, Mode=OneWay}">
-        <Grid>
-            <Grid.Background>
+        <Border CornerRadius="{Binding CornerRadius, Source={x:Static p:Settings.Default}, Mode=OneWay}">
+            <Border.Background>
                 <SolidColorBrush Opacity="{Binding Opacity, Source={x:Static p:Settings.Default}, Mode=OneWay}"
                                  Color="{Binding BackgroundColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
-            </Grid.Background>
+            </Border.Background>
 
             <StackPanel Margin="2,0,2,0">
                 <TextBlock HorizontalAlignment="Center"
@@ -123,6 +123,6 @@
                     </TextBlock.Foreground>
                 </TextBlock>
             </StackPanel>
-        </Grid>
+        </Border>
     </Viewbox>
 </Window>

+ 1 - 0
DesktopClock/Properties/Settings.cs

@@ -39,6 +39,7 @@ namespace DesktopClock.Properties
         public double Opacity { get; set; } = 0.85;
         public Color TextColor { get; set; } = Colors.Black;
         public string FontFamily { get; set; } = "Consolas";
+        public int CornerRadius { get; set; } = 4;
         public DateTimeOffset DateToCountdownTo { get; set; } = DateTimeOffset.MinValue;
 
         #endregion "Properties"