Skip to content

Commit

Permalink
Added new optionally-displayed borders for notification windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
SamHurne committed Oct 18, 2014
1 parent e8741ee commit 66e53c8
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 74 deletions.
3 changes: 3 additions & 0 deletions GW2PAO/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
<setting name="PriceNotificationY" serializeAs="String">
<value>-1</value>
</setting>
<setting name="AreNotificationWindowBordersVisible" serializeAs="String">
<value>False</value>
</setting>
</GW2PAO.Properties.Settings>
</userSettings>
</configuration>
9 changes: 9 additions & 0 deletions GW2PAO/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ public void AppStartup(object sender, StartupEventArgs e)

var settingsMenu = new MenuItemViewModel("Settings", null);

settingsMenu.SubMenuItems.Add(new MenuItemViewModel("Show Notification Borders", null, true, false,
() => { return GW2PAO.Properties.Settings.Default.AreNotificationWindowBordersVisible; },
(enabled) =>
{
GW2PAO.Properties.Settings.Default.AreNotificationWindowBordersVisible = enabled;
GW2PAO.Properties.Settings.Default.Save();
},
GW2PAO.Properties.Settings.Default, "AreNotificationWindowBordersVisible"));

settingsMenu.SubMenuItems.Add(new MenuItemViewModel("Non-Interactive Windows", null, true, false,
() => { return GW2PAO.Properties.Settings.Default.IsClickthroughEnabled; },
(enabled) => {
Expand Down
12 changes: 12 additions & 0 deletions GW2PAO/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions GW2PAO/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,8 @@
<Setting Name="PriceNotificationY" Type="System.Double" Scope="User">
<Value Profile="(Default)">-1</Value>
</Setting>
<Setting Name="AreNotificationWindowBordersVisible" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
</Setting>
</Settings>
</SettingsFile>
102 changes: 62 additions & 40 deletions GW2PAO/Views/EventNotification/EventNotificationWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,76 @@
xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:View="clr-namespace:GW2PAO.Views.EventNotification"
xmlns:properties="clr-namespace:GW2PAO.Properties"
WindowStyle="None" AllowsTransparency="true" Background="Transparent"
Topmost="True" ShowInTaskbar="False"
ResizeMode="NoResize"
TextOptions.TextFormattingMode="Display"
MinHeight="120" Height="Auto" SizeToContent="Height" Width="230"
MinHeight="130" Height="Auto" SizeToContent="Height" Width="230"
MouseLeftButtonDown="Window_MouseLeftButtonDown">

<src:OverlayWindow.Resources>
<core:AutoRefreshCollectionViewSource Source="{Binding EventNotifications}" x:Key="EventNotificationsCollection" />
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Style/BaseControlStyles/ToolTipStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<core:AutoRefreshCollectionViewSource Source="{Binding EventNotifications}" x:Key="EventNotificationsCollection" />
<BooleanToVisibilityConverter x:Key="BoolToVisibility" />
</ResourceDictionary>
</src:OverlayWindow.Resources>

<!--<Border BorderBrush="Black" BorderThickness="1">-->
<!--See code behind for DataContext/ViewModel details-->
<ItemsControl ItemsSource="{Binding Source={StaticResource EventNotificationsCollection}}">

<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical">

<StackPanel.LayoutTransform>
<RotateTransform Angle="180"/>
</StackPanel.LayoutTransform>

<i:Interaction.Behaviors>
<ei:FluidMoveBehavior Duration="0:0:0.5" AppliesTo="Children">
<ei:FluidMoveBehavior.EaseY>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseY>
<ei:FluidMoveBehavior.EaseX>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseX>
</ei:FluidMoveBehavior>
</i:Interaction.Behaviors>
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

<ItemsControl.ItemTemplate>
<DataTemplate>
<View:EventNotificationView DataContext="{Binding}">
<View:EventNotificationView.LayoutTransform>
<RotateTransform Angle="180"/>
</View:EventNotificationView.LayoutTransform>
</View:EventNotificationView>
</DataTemplate>
</ItemsControl.ItemTemplate>

</ItemsControl>
<!--</Border>-->
<Grid>
<Border BorderThickness="0,0,2,10" CornerRadius="10" ClipToBounds="True" Margin="0,0,2,0"
Visibility="{Binding Source={x:Static properties:Settings.Default}, Path=AreNotificationWindowBordersVisible, Converter={StaticResource BoolToVisibility}}">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.75,0" StartPoint="1,1">
<GradientStop Color="#BFFFA500" Offset="0.1" />
<GradientStop Color="#00FFA500" Offset="0.7" />
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Effect>
<DropShadowEffect Direction="90" Color="Gold" ShadowDepth="3" BlurRadius="10" />
</Border.Effect>
<Border.ToolTip>
<TextBlock Text="Event Notifications" />
</Border.ToolTip>
</Border>
<ItemsControl ItemsSource="{Binding Source={StaticResource EventNotificationsCollection}}"
Margin="0,0,0,5">

<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical">

<StackPanel.LayoutTransform>
<RotateTransform Angle="180"/>
</StackPanel.LayoutTransform>

<i:Interaction.Behaviors>
<ei:FluidMoveBehavior Duration="0:0:0.5" AppliesTo="Children">
<ei:FluidMoveBehavior.EaseY>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseY>
<ei:FluidMoveBehavior.EaseX>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseX>
</ei:FluidMoveBehavior>
</i:Interaction.Behaviors>
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

<ItemsControl.ItemTemplate>
<DataTemplate>
<View:EventNotificationView DataContext="{Binding}">
<View:EventNotificationView.LayoutTransform>
<RotateTransform Angle="180"/>
</View:EventNotificationView.LayoutTransform>
</View:EventNotificationView>
</DataTemplate>
</ItemsControl.ItemTemplate>

</ItemsControl>
</Grid>

</src:OverlayWindow>
78 changes: 50 additions & 28 deletions GW2PAO/Views/PriceNotification/PriceNotificationWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,68 @@
xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:View="clr-namespace:GW2PAO.Views.PriceNotification"
xmlns:properties="clr-namespace:GW2PAO.Properties"
WindowStyle="None" AllowsTransparency="true" Background="Transparent"
Topmost="True" ShowInTaskbar="False"
ResizeMode="NoResize"
TextOptions.TextFormattingMode="Display"
MinHeight="600" SizeToContent="Height"
Width="250"
Width="252"
MouseLeftButtonDown="Window_MouseLeftButtonDown">

<src:OverlayWindow.Resources>
<core:AutoRefreshCollectionViewSource Source="{Binding PriceNotifications}" x:Key="PriceNotificationsCollection" />
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Style/BaseControlStyles/ToolTipStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<core:AutoRefreshCollectionViewSource Source="{Binding PriceNotifications}" x:Key="PriceNotificationsCollection" />
<BooleanToVisibilityConverter x:Key="BoolToVisibility" />
</ResourceDictionary>
</src:OverlayWindow.Resources>

<!--<Border BorderBrush="Black" BorderThickness="1">-->
<!--See code behind for DataContext/ViewModel details-->
<ItemsControl ItemsSource="{Binding Source={StaticResource PriceNotificationsCollection}}">
<Grid>
<Border BorderThickness="2,10,0,0" CornerRadius="10" ClipToBounds="True" Margin="2,0,0,0"
Visibility="{Binding Source={x:Static properties:Settings.Default}, Path=AreNotificationWindowBordersVisible, Converter={StaticResource BoolToVisibility}}">
<Border.BorderBrush>
<LinearGradientBrush StartPoint="0,0" EndPoint="0.2,0.22">
<GradientStop Color="#BFFFA500" Offset="0.1" />
<GradientStop Color="#00FFA500" Offset="0.7" />
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Effect>
<DropShadowEffect Direction="270" Color="Gold" ShadowDepth="3" BlurRadius="10" />
</Border.Effect>
<Border.ToolTip>
<TextBlock Text="Price Notifications" />
</Border.ToolTip>
</Border>
<ItemsControl ItemsSource="{Binding Source={StaticResource PriceNotificationsCollection}}"
Margin="0,5,0,0">

<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical">
<i:Interaction.Behaviors>
<ei:FluidMoveBehavior Duration="0:0:0.25" AppliesTo="Children">
<ei:FluidMoveBehavior.EaseY>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseY>
<ei:FluidMoveBehavior.EaseX>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseX>
</ei:FluidMoveBehavior>
</i:Interaction.Behaviors>
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical">
<i:Interaction.Behaviors>
<ei:FluidMoveBehavior Duration="0:0:0.25" AppliesTo="Children">
<ei:FluidMoveBehavior.EaseY>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseY>
<ei:FluidMoveBehavior.EaseX>
<CubicEase EasingMode="EaseInOut"/>
</ei:FluidMoveBehavior.EaseX>
</ei:FluidMoveBehavior>
</i:Interaction.Behaviors>
</StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

<ItemsControl.ItemTemplate>
<DataTemplate>
<View:PriceNotificationView DataContext="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.ItemTemplate>
<DataTemplate>
<View:PriceNotificationView DataContext="{Binding}" />
</DataTemplate>
</ItemsControl.ItemTemplate>

</ItemsControl>
<!--</Border>-->
</ItemsControl>
</Grid>

</src:OverlayWindow>
34 changes: 28 additions & 6 deletions GW2PAO/Views/WvWNotification/WvWNotificationWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,42 @@
xmlns:core="clr-namespace:GW2PAO.PresentationCore;assembly=GW2PAO.PresentationCore"
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
xmlns:view="clr-namespace:GW2PAO.Views.WvWNotification"
xmlns:properties="clr-namespace:GW2PAO.Properties"
WindowStyle="None" AllowsTransparency="true" Background="Transparent"
ResizeMode="NoResize"
Topmost="True" ShowInTaskbar="False"
TextOptions.TextFormattingMode="Display"
MinHeight="216" Height="Auto" SizeToContent="Height" Width="215"
MinHeight="336" Height="Auto" SizeToContent="Height" Width="217"
MouseLeftButtonDown="Window_MouseLeftButtonDown">

<src:OverlayWindow.Resources>
<core:AutoRefreshCollectionViewSource Source="{Binding WvWNotifications}" x:Key="WvWNotificationsCollection" />
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Style/BaseControlStyles/ToolTipStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
<core:AutoRefreshCollectionViewSource Source="{Binding WvWNotifications}" x:Key="WvWNotificationsCollection" />
<BooleanToVisibilityConverter x:Key="BoolToVisibility" />
</ResourceDictionary>
</src:OverlayWindow.Resources>

<!--<Border BorderBrush="Black" BorderThickness="1">-->
<!--See code behind for DataContext/ViewModel details-->
<ItemsControl ItemsSource="{Binding Source={StaticResource WvWNotificationsCollection}}">
<Grid>
<Border BorderThickness="0,0,2,10" CornerRadius="10" ClipToBounds="True" Margin="0,0,3,0"
Visibility="{Binding Source={x:Static properties:Settings.Default}, Path=AreNotificationWindowBordersVisible, Converter={StaticResource BoolToVisibility}}">
<Border.BorderBrush>
<LinearGradientBrush EndPoint="0.75,0.63" StartPoint="1,1">
<GradientStop Color="#BFFFA500" Offset="0.1" />
<GradientStop Color="#00FFA500" Offset="0.7" />
</LinearGradientBrush>
</Border.BorderBrush>
<Border.Effect>
<DropShadowEffect Direction="90" Color="Gold" ShadowDepth="3" BlurRadius="10" />
</Border.Effect>
<Border.ToolTip>
<TextBlock Text="WvW Notifications" />
</Border.ToolTip>
</Border>
<ItemsControl ItemsSource="{Binding Source={StaticResource WvWNotificationsCollection}}"
Margin="0,0,0,5">

<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand Down Expand Up @@ -55,6 +77,6 @@
</ItemsControl.ItemTemplate>

</ItemsControl>
<!--</Border>-->
</Grid>

</src:OverlayWindow>

0 comments on commit 66e53c8

Please sign in to comment.