Skip to content

Commit

Permalink
better comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jul 16, 2024
1 parent dc43e9a commit e28a069
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 41 deletions.
35 changes: 16 additions & 19 deletions DesktopClock/Properties/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,48 +73,48 @@ private Settings()
#region "Properties"

/// <summary>
/// Format string for the date and time shown on the clock display.
/// Format string for the date and time shown on the clock.
/// </summary>
/// <remarks>
/// See: <see href="https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings">Custom date and time format strings</see>.
/// </remarks>
public string Format { get; set; } = "{ddd}, {MMM dd}, {h:mm:ss tt}";

/// <summary>
/// Format string shown on the clock display when in countdown mode.
/// Format string shown on the clock in countdown mode.
/// </summary>
/// <remarks>
/// See: <see href="https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-timespan-format-strings">Custom TimeSpan format strings</see>.
/// </remarks>
public string CountdownFormat { get; set; } = "";

/// <summary>
/// Target date and time for countdown mode.
/// Date and time to countdown to. If left blank, countdown mode is not enabled.
/// </summary>
public DateTime? CountdownTo { get; set; } = default(DateTime);

/// <summary>
/// Time zone for the clock display.
/// Time zone to be used.
/// </summary>
public string TimeZone { get; set; } = string.Empty;

/// <summary>
/// Font family for the clock display.
/// Font used for the clock's text.
/// </summary>
public string FontFamily { get; set; } = "Consolas";

/// <summary>
/// Text color for the clock display.
/// Text color for the clock's text.
/// </summary>
public Color TextColor { get; set; }

/// <summary>
/// The outer color, either for the background or the outline..
/// The outer color, for either the background or the outline.
/// </summary>
public Color OuterColor { get; set; }

/// <summary>
/// Shows a full background instead of a simple outline.
/// Shows a solid background instead of an outline.
/// </summary>
public bool BackgroundEnabled { get; set; } = true;

Expand All @@ -129,7 +129,7 @@ private Settings()
public double BackgroundCornerRadius { get; set; } = 1;

/// <summary>
/// Path to the background image.
/// Path to the background image. If left blank, a solid color will be used.
/// </summary>
public string BackgroundImagePath { get; set; } = string.Empty;

Expand All @@ -144,43 +144,40 @@ private Settings()
public bool Topmost { get; set; } = true;

/// <summary>
/// Shows the app icon in the taskbar.
/// Shows the app icon in the taskbar instead of the tray.
/// </summary>
public bool ShowInTaskbar { get; set; } = true;

/// <summary>
/// Height of the clock display.
/// Height of the clock window.
/// </summary>
public int Height { get; set; } = 48;

/// <summary>
/// Runs the app when the user logs in.
/// Opens the app when you log in.
/// </summary>
/// <remarks>
/// A registry key is created or deleted.
/// </remarks>
public bool RunOnStartup { get; set; } = false;

/// <summary>
/// Starts the app in the "Hide for now" state.
/// Starts the app hidden until the taskbar or tray icon is clicked.
/// </summary>
public bool StartHidden { get; set; } = false;

/// <summary>
/// Allows moving the clock by dragging.
/// Allows moving the clock by dragging the mouse.
/// </summary>
public bool DragToMove { get; set; } = true;

/// <summary>
/// Aligns the text to the right.
/// Experimental: Keeps the clock window aligned to the right when the size changes.
/// </summary>
/// <remarks>
/// Small glitches can happen because programs are naturally meant to be left-anchored.
/// </remarks>
public bool RightAligned { get; set; } = false;

/// <summary>
/// Path to a WAV file for audio alerts.
/// Path to a WAV file to be played on a specified interval.
/// </summary>
public string WavFilePath { get; set; } = string.Empty;

Expand Down
44 changes: 22 additions & 22 deletions DesktopClock/SettingsWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
<TabControl>
<TabItem Header="Format">
<StackPanel>
<TextBlock Text="Format:" />
<TextBlock Text="Date and Time Format:" />
<TextBox Text="{Binding Settings.Format, Mode=TwoWay}" />
<TextBlock Text="Format string for the date and time shown on the clock display"
<TextBlock Text="Format string for the date and time shown on the clock display."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Countdown Format:" />
<TextBox Text="{Binding Settings.CountdownFormat, Mode=TwoWay}" />
<TextBlock Text="Format string shown on the clock display when in countdown mode"
<TextBlock Text="Format string shown on the clock display when in countdown mode."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />
Expand All @@ -41,21 +41,21 @@
Margin="5,0,0,0"
Grid.Column="1" />
</Grid>
<TextBlock Text="Target date and time for countdown mode"
<TextBlock Text="Target date and time for countdown mode."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Time Zone:" />
<ComboBox ItemsSource="{Binding TimeZones}" SelectedItem="{Binding Settings.TimeZone, Mode=TwoWay}" />
<TextBlock Text="Time zone for the clock display"
<TextBlock Text="Time zone for the clock display."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Font Family:" />
<ComboBox ItemsSource="{Binding FontFamilies}" SelectedItem="{Binding Settings.FontFamily, Mode=TwoWay}" />
<TextBlock Text="Font family for the clock display"
<TextBlock Text="Font used for the clock's text."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />
Expand All @@ -67,34 +67,34 @@

<TextBlock Text="Text Color:" />
<TextBox Text="{Binding Settings.TextColor, Mode=TwoWay}" />
<TextBlock Text="Text color for the clock display"
<TextBlock Text="Text color for the clock's text."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Outer Color:" />
<TextBox Text="{Binding Settings.OuterColor, Mode=TwoWay}" />
<TextBlock Text="The outer color, either for the background or the outline"
<TextBlock Text="The outer color, for either the background or the outline."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<CheckBox Content="Background Enabled" IsChecked="{Binding Settings.BackgroundEnabled, Mode=TwoWay}" />
<TextBlock Text="Shows a full background instead of a simple outline"
<CheckBox Content="Enable Background" IsChecked="{Binding Settings.BackgroundEnabled, Mode=TwoWay}" />
<TextBlock Text="Shows a solid background instead of an outline."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Background Opacity:" />
<TextBox Text="{Binding Settings.BackgroundOpacity, Mode=TwoWay}" />
<TextBlock Text="Opacity of the background"
<TextBlock Text="Opacity of the background."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Background Corner Radius:" />
<TextBox Text="{Binding Settings.BackgroundCornerRadius, Mode=TwoWay}" />
<TextBlock Text="Corner radius of the background"
<TextBlock Text="Corner radius of the background."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />
Expand All @@ -111,48 +111,48 @@
Click="BrowseBackgroundImagePath"
Grid.Column="1" />
</Grid>
<TextBlock Text="Path to the background image"
<TextBlock Text="Path to the background image. If left blank, a solid color will be used."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="Outline Thickness:" />
<TextBox Text="{Binding Settings.OutlineThickness, Mode=TwoWay}" />
<TextBlock Text="Thickness of the outline around the clock"
<TextBlock Text="Thickness of the outline around the clock."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />
</StackPanel>
</TabItem>

<TabItem Header="Behaviour">
<TabItem Header="Behavior">
<StackPanel>
<CheckBox Content="Show In Taskbar" IsChecked="{Binding Settings.ShowInTaskbar, Mode=TwoWay}" />
<TextBlock Text="Shows the app icon in the taskbar"
<TextBlock Text="Shows the app icon in the taskbar instead of the tray."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<CheckBox Content="Run On Startup" IsChecked="{Binding Settings.RunOnStartup, Mode=TwoWay}" />
<TextBlock Text="Runs the app when the user logs in"
<TextBlock Text="Opens the app when you log in."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<CheckBox Content="Start Hidden" IsChecked="{Binding Settings.StartHidden, Mode=TwoWay}" />
<TextBlock Text="Starts the app in the 'Hide for now' state"
<TextBlock Text="Starts the app hidden until the taskbar or tray icon is clicked."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<CheckBox Content="Drag To Move" IsChecked="{Binding Settings.DragToMove, Mode=TwoWay}" />
<TextBlock Text="Allows moving the clock by dragging"
<TextBlock Text="Allows moving the clock by dragging the mouse."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<CheckBox Content="Right Aligned" IsChecked="{Binding Settings.RightAligned, Mode=TwoWay}" />
<TextBlock Text="Aligns the text to the right"
<TextBlock Text="Experimental: Keeps the clock window aligned to the right when the size changes."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />
Expand All @@ -169,14 +169,14 @@
Click="BrowseWavFilePath"
Grid.Column="1" />
</Grid>
<TextBlock Text="Path to a WAV file for audio alerts"
<TextBlock Text="Path to a WAV file to be played on a specified interval."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />

<TextBlock Text="WAV File Interval:" />
<TextBox Text="{Binding Settings.WavFileInterval, Mode=TwoWay}" />
<TextBlock Text="Interval for playing the WAV file if one is specified and exists"
<TextBlock Text="Interval for playing the WAV file if one is specified and exists."
FontStyle="Italic"
FontSize="10"
Margin="0,0,0,12" />
Expand Down

0 comments on commit e28a069

Please sign in to comment.