3 Commits

Author SHA1 Message Date
7be7af5980 Add support for an about menu 2018-02-22 12:03:53 -05:00
c9041badbe Add badges to readme 2018-02-21 13:39:28 -05:00
37d7db3f14 Change appearance window title bar 2018-02-21 13:36:05 -05:00
12 changed files with 86 additions and 46 deletions

View File

@@ -1,17 +1,17 @@
<Window x:Class="FloatingStatusWindowLibrary.AppearanceWindow" <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{x:Static properties:Resources.ChangeAppearanceWindow}" Height="290" Width="450" Binding.SourceUpdated="HandleWindowSourceUpdated"
xmlns:properties="clr-namespace:FloatingStatusWindowLibrary.Properties" xmlns:properties="clr-namespace:FloatingStatusWindowLibrary.Properties"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" SizeToContent="Height"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FloatingStatusWindowLibrary" xmlns:local="clr-namespace:FloatingStatusWindowLibrary"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
xmlns:Windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf" x:Class="FloatingStatusWindowLibrary.AppearanceWindow"
Title="{x:Static properties:Resources.ChangeAppearanceWindow}" Height="290" Width="450" Binding.SourceUpdated="HandleWindowSourceUpdated"
WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" SizeToContent="Height"
mc:Ignorable="d" mc:Ignorable="d"
d:DataContext="{d:DesignInstance local:WindowSettings}" d:DataContext="{d:DesignInstance {x:Type local:WindowSettings}}"
Closing="HandleWindowClosing" x:ClassModifier="internal" Icon="pack://siteoforigin:,,,/Resources/gear.ico"> Closing="HandleWindowClosing" x:ClassModifier="internal" Windows:ControlBox.HasMaximizeButton="False" Windows:ControlBox.HasMinimizeButton="False" Windows:ControlBox.HasSystemMenu="False" WindowStyle="ToolWindow">
<Grid> <Grid>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@@ -28,12 +28,12 @@
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label <Label
Content="{x:Static properties:Resources.FontName}" Content="{x:Static properties:Resources.FontName}"
Name="FontNameLabel" x:Name="FontNameLabel"
Target="{Binding ElementName=FontNameCombo}" Target="{Binding ElementName=FontNameCombo}"
Margin="6" /> Margin="6" />
<ComboBox x:Name="FontNameCombo" Grid.Row="0" Grid.Column="1" <ComboBox x:Name="FontNameCombo" Grid.Row="0" Grid.Column="1"
SelectedValuePath="Source" SelectedValuePath="Source"
SelectedValue="{Binding Path=FontName,UpdateSourceTrigger=PropertyChanged,NotifyOnSourceUpdated=True}" SelectedValue="{Binding FontName, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
Margin="6"> Margin="6">
<ComboBox.ItemsPanel> <ComboBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
@@ -54,12 +54,12 @@
</ComboBox> </ComboBox>
<Label <Label
Content="{x:Static properties:Resources.FontSize}" Content="{x:Static properties:Resources.FontSize}"
Name="FontSizeLabel" Grid.Row="1" Grid.Column="0" x:Name="FontSizeLabel" Grid.Row="1" Grid.Column="0"
Target="{Binding ElementName=FontSizeCombo}" Target="{Binding ElementName=FontSizeCombo}"
Margin="6" /> Margin="6" />
<ComboBox Grid.Column="1" Grid.Row="1" <ComboBox Grid.Column="1" Grid.Row="1"
Name="FontSizeCombo" x:Name="FontSizeCombo"
Text="{Binding Path=FontSize,UpdateSourceTrigger=PropertyChanged,NotifyOnSourceUpdated=True}" Text="{Binding FontSize, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
IsEditable="True" Margin="6"> IsEditable="True" Margin="6">
<ComboBoxItem Content="8" /> <ComboBoxItem Content="8" />
<ComboBoxItem Content="9" /> <ComboBoxItem Content="9" />
@@ -80,31 +80,31 @@
</ComboBox> </ComboBox>
<Label <Label
Content="{x:Static properties:Resources.ForegroundColor}" Content="{x:Static properties:Resources.ForegroundColor}"
Grid.Row="2" Grid.Column="0" Name="ForegroundColorLabel" Grid.Row="2" Grid.Column="0" x:Name="ForegroundColorLabel"
Target="{Binding ElementName=ForegroundColorPicker}" Target="{Binding ElementName=ForegroundColorPicker}"
Margin="6" /> Margin="6" />
<xctk:ColorPicker Grid.Column="1" Grid.Row="2" <xctk:ColorPicker Grid.Column="1" Grid.Row="2"
Name="ForegroundColorPicker" x:Name="ForegroundColorPicker"
DisplayColorAndName="True" DisplayColorAndName="True"
SelectedColor="{Binding Path=FontColor,UpdateSourceTrigger=PropertyChanged,NotifyOnSourceUpdated=True}" SelectedColor="{Binding FontColor, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
Margin="6" /> Margin="6" />
<Label <Label
Content="{x:Static properties:Resources.Padding}" Content="{x:Static properties:Resources.Padding}"
Grid.Row="3" Grid.Column="0" Name="PaddingLabel" Target="{Binding ElementName=PaddingUpDown}" Margin="6" /> Grid.Row="3" Grid.Column="0" x:Name="PaddingLabel" Target="{Binding ElementName=PaddingUpDown}" Margin="6" />
<xctk:IntegerUpDown Grid.Column="1" <xctk:IntegerUpDown Grid.Column="1"
Grid.Row="3" Name="PaddingUpDown" Grid.Row="3" x:Name="PaddingUpDown"
Minimum="0" Maximum="20" Minimum="0" Maximum="20"
Value="{Binding Path=Padding,UpdateSourceTrigger=PropertyChanged,NotifyOnSourceUpdated=True}" Value="{Binding Padding, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Left" Margin="6" /> TextAlignment="Left" Margin="6" />
<Label <Label
Content="{x:Static properties:Resources.HorizontalAlignment}" Content="{x:Static properties:Resources.HorizontalAlignment}"
Grid.Row="4" Grid.Column="0" Name="HorizontalAlignmentLabel" Grid.Row="4" Grid.Column="0" x:Name="HorizontalAlignmentLabel"
Target="{Binding ElementName=HorizontalAlignmentCombo}" Target="{Binding ElementName=HorizontalAlignmentCombo}"
Margin="6" /> Margin="6" />
<ComboBox Grid.Column="1" Grid.Row="4" <ComboBox Grid.Column="1" Grid.Row="4"
Name="HorizontalAlignmentCombo" x:Name="HorizontalAlignmentCombo"
SelectedValuePath="Tag" SelectedValuePath="Tag"
SelectedValue="{Binding Path=HorizontalAlignment,UpdateSourceTrigger=PropertyChanged,NotifyOnSourceUpdated=True}" SelectedValue="{Binding HorizontalAlignment, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
Margin="6"> Margin="6">
<ComboBoxItem <ComboBoxItem
Content="{x:Static properties:Resources.Left}" Content="{x:Static properties:Resources.Left}"
@@ -118,13 +118,13 @@
</ComboBox> </ComboBox>
<Label <Label
Content="{x:Static properties:Resources.VerticalAlignment}" Content="{x:Static properties:Resources.VerticalAlignment}"
Grid.Row="5" Grid.Column="0" Name="VerticalAlignmentLabel" Grid.Row="5" Grid.Column="0" x:Name="VerticalAlignmentLabel"
Target="{Binding ElementName=VerticalAlignmentCombo}" Target="{Binding ElementName=VerticalAlignmentCombo}"
Margin="6" /> Margin="6" />
<ComboBox Grid.Column="1" Grid.Row="5" <ComboBox Grid.Column="1" Grid.Row="5"
Name="VerticalAlignmentCombo" x:Name="VerticalAlignmentCombo"
SelectedValuePath="Tag" SelectedValuePath="Tag"
SelectedValue="{Binding Path=VerticalAlignment,UpdateSourceTrigger=PropertyChanged,NotifyOnSourceUpdated=True}" SelectedValue="{Binding VerticalAlignment, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
Margin="6"> Margin="6">
<ComboBoxItem <ComboBoxItem
Content="{x:Static properties:Resources.Top}" Content="{x:Static properties:Resources.Top}"
@@ -137,7 +137,7 @@
Tag="{x:Static VerticalAlignment.Center}" /> Tag="{x:Static VerticalAlignment.Center}" />
</ComboBox> </ComboBox>
<Grid Grid.Column="1" Grid.Row="6" <Grid Grid.Column="1" Grid.Row="6"
HorizontalAlignment="Right" Name="GridButtons" Width="Auto" Grid.IsSharedSizeScope="True" HorizontalAlignment="Right" x:Name="GridButtons" Width="Auto" Grid.IsSharedSizeScope="True"
Height="38" VerticalAlignment="Bottom"> Height="38" VerticalAlignment="Bottom">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" <ColumnDefinition Width="Auto"
@@ -149,7 +149,7 @@
Content="{x:Static properties:Resources.OK}" Content="{x:Static properties:Resources.OK}"
Height="23" Height="23"
HorizontalAlignment="Stretch" Margin="6" HorizontalAlignment="Stretch" Margin="6"
Name="OkayButton" x:Name="OkayButton"
VerticalAlignment="Stretch" Width="75" VerticalAlignment="Stretch" Width="75"
Padding="7,3" IsDefault="True" Padding="7,3" IsDefault="True"
Click="HandleOkayButtonClick" /> Click="HandleOkayButtonClick" />
@@ -157,7 +157,7 @@
Content="{x:Static properties:Resources.Cancel}" Content="{x:Static properties:Resources.Cancel}"
Grid.Column="1" Height="23" Grid.Column="1" Height="23"
HorizontalAlignment="Stretch" Margin="6" HorizontalAlignment="Stretch" Margin="6"
Name="CancelButton" x:Name="CancelButton"
VerticalAlignment="Stretch" Width="75" VerticalAlignment="Stretch" Width="75"
Padding="7,3" IsCancel="True" /> Padding="7,3" IsCancel="True" />
</Grid> </Grid>

View File

@@ -118,6 +118,15 @@ namespace FloatingStatusWindowLibrary
contextMenu.Items.Add(new Separator()); contextMenu.Items.Add(new Separator());
if (_windowSource.HasAboutMenu)
{
menuItem = new MenuItem { Header = Resources.ContextMenuAbout };
menuItem.Click += (sender, args) => _windowSource.ShowAbout();
contextMenu.Items.Add(menuItem);
contextMenu.Items.Add(new Separator());
}
menuItem = new MenuItem menuItem = new MenuItem
{ {
Name = "contextMenuItemExit", Name = "contextMenuItemExit",

View File

@@ -71,6 +71,7 @@
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
@@ -87,11 +88,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="Resources\gear.ico">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="Common.Wpf\Common.Native\Common.Native.csproj"> <ProjectReference Include="Common.Wpf\Common.Native\Common.Native.csproj">
<Project>{ed1c07a1-54f5-4796-8b06-2a0bb1960d84}</Project> <Project>{ed1c07a1-54f5-4796-8b06-2a0bb1960d84}</Project>

View File

@@ -10,8 +10,10 @@ namespace FloatingStatusWindowLibrary
bool HasSettingsMenu { get; } bool HasSettingsMenu { get; }
bool HasRefreshMenu { get; } bool HasRefreshMenu { get; }
bool HasAboutMenu { get; }
void ShowSettings(); void ShowSettings();
void Refresh(); void Refresh();
void ShowAbout();
} }
} }

View File

@@ -105,6 +105,15 @@ namespace FloatingStatusWindowLibrary.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
public static string ContextMenuAbout {
get {
return ResourceManager.GetString("ContextMenuAbout", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Start with Windows. /// Looks up a localized string similar to Start with Windows.
/// </summary> /// </summary>
@@ -222,16 +231,6 @@ namespace FloatingStatusWindowLibrary.Properties {
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
public static System.Drawing.Icon gear {
get {
object obj = ResourceManager.GetObject("gear", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to _Horizontal alignment:. /// Looks up a localized string similar to _Horizontal alignment:.
/// </summary> /// </summary>

View File

@@ -132,6 +132,9 @@
<data name="ChangeAppearanceWindow" xml:space="preserve"> <data name="ChangeAppearanceWindow" xml:space="preserve">
<value>Change Appearance</value> <value>Change Appearance</value>
</data> </data>
<data name="ContextMenuAbout" xml:space="preserve">
<value>About</value>
</data>
<data name="ContextMenuAutoStart" xml:space="preserve"> <data name="ContextMenuAutoStart" xml:space="preserve">
<value>Start with Windows</value> <value>Start with Windows</value>
</data> </data>
@@ -171,10 +174,6 @@
<data name="ForegroundColor" xml:space="preserve"> <data name="ForegroundColor" xml:space="preserve">
<value>_Foreground color:</value> <value>_Foreground color:</value>
</data> </data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="gear" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gear.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="HorizontalAlignment" xml:space="preserve"> <data name="HorizontalAlignment" xml:space="preserve">
<value>_Horizontal alignment:</value> <value>_Horizontal alignment:</value>
</data> </data>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 224 KiB

View File

@@ -2,6 +2,9 @@
Library to create a "floating" window that blends in with the Windows desktop and allows displaying status text. Library to create a "floating" window that blends in with the Windows desktop and allows displaying status text.
[![Build status](https://ci.appveyor.com/api/projects/status/ushodm57bv2dnu3h?svg=true)](https://ci.appveyor.com/project/ckaczor/floatingstatuswindow)
[![NuGet](https://img.shields.io/nuget/v/FloatingStatusWindow.svg)](https://www.nuget.org/packages/FloatingStatusWindow)
## Authors ## Authors
* **Chris Kaczor** - *Initial work* - https://github.com/ckaczor - https://chriskaczor.com * **Chris Kaczor** - *Initial work* - https://github.com/ckaczor - https://chriskaczor.com

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary; using FloatingStatusWindowLibrary;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Reflection;
using System.Timers; using System.Timers;
using System.Windows.Threading; using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; } get { return true; }
} }
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings() public void ShowSettings()
{ {

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary; using FloatingStatusWindowLibrary;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Reflection;
using System.Timers; using System.Timers;
using System.Windows.Threading; using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; } get { return true; }
} }
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings() public void ShowSettings()
{ {

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary; using FloatingStatusWindowLibrary;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Reflection;
using System.Timers; using System.Timers;
using System.Windows.Threading; using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; } get { return true; }
} }
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings() public void ShowSettings()
{ {

View File

@@ -1,6 +1,7 @@
using FloatingStatusWindowLibrary; using FloatingStatusWindowLibrary;
using System; using System;
using System.Globalization; using System.Globalization;
using System.Reflection;
using System.Timers; using System.Timers;
using System.Windows.Threading; using System.Windows.Threading;
@@ -53,6 +54,13 @@ namespace TestWindow
get { return true; } get { return true; }
} }
public bool HasAboutMenu => true;
public void ShowAbout()
{
_floatingStatusWindow.SetText(Assembly.GetEntryAssembly().GetName().Version.ToString());
}
public void ShowSettings() public void ShowSettings()
{ {