Added more UI-stuff

This commit is contained in:
Darth Affe 2017-08-05 20:49:39 +02:00
parent 823f8d73dd
commit 57d49ff5b5
9 changed files with 218 additions and 17 deletions

View File

@ -5,6 +5,11 @@ VisualStudioVersion = 15.0.26430.15
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeyboardAudioVisualizer", "KeyboardAudioVisualizer\KeyboardAudioVisualizer.csproj", "{0AC4E8B1-4D4D-447F-B9FD-38A74ED1F243}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeyboardAudioVisualizer", "KeyboardAudioVisualizer\KeyboardAudioVisualizer.csproj", "{0AC4E8B1-4D4D-447F-B9FD-38A74ED1F243}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "libs", "libs", "{9A053D4E-5BC6-4179-8F82-9B5C8C7E4127}"
ProjectSection(SolutionItems) = preProject
libs\Transitionals.dll = libs\Transitionals.dll
EndProjectSection
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU

View File

@ -75,7 +75,7 @@ namespace KeyboardAudioVisualizer.Controls
Button closeButton = GetTemplateChild("PART_CloseButton") as Button; Button closeButton = GetTemplateChild("PART_CloseButton") as Button;
if (closeButton != null) if (closeButton != null)
closeButton.Click += (sender, args) => Application.Current.Shutdown(); closeButton.Click += (sender, args) => ApplicationManager.Instance.ExitCommand.Execute(null);
Button minimizeButton = GetTemplateChild("PART_MinimizeButton") as Button; Button minimizeButton = GetTemplateChild("PART_MinimizeButton") as Button;
if (minimizeButton != null) if (minimizeButton != null)

View File

@ -73,6 +73,9 @@
<Reference Include="System.Xaml"> <Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="Transitionals">
<HintPath>..\libs\Transitionals.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
@ -137,6 +140,7 @@
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<Resource Include="Resources\navigation.ttf" />
<Resource Include="Resources\font.ttf" /> <Resource Include="Resources\font.ttf" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -166,6 +170,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="Styles\Navigation.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Styles\ToolTip.xaml"> <Page Include="Styles\ToolTip.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -175,7 +183,6 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup> <ItemGroup>
<Resource Include="Resources\background.png" /> <Resource Include="Resources\background.png" />
<Resource Include="Resources\close.png" /> <Resource Include="Resources\close.png" />

Binary file not shown.

View File

@ -0,0 +1,180 @@
<styles:CachedResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:styles="clr-namespace:KeyboardAudioVisualizer.Styles"
xmlns:controls="clr-namespace:Transitionals.Controls;assembly=Transitionals"
xmlns:transitions="clr-namespace:Transitionals.Transitions;assembly=Transitionals">
<styles:CachedResourceDictionary.MergedDictionaries>
<styles:CachedResourceDictionary Source="/KeyboardAudioVisualizer;component/Styles/FrameworkElement.xaml" />
<styles:CachedResourceDictionary Source="/KeyboardAudioVisualizer;component/Styles/Theme.xaml" />
</styles:CachedResourceDictionary.MergedDictionaries>
<transitions:FadeTransition x:Key="TransitionFade" Duration="0:0:0.200" />
<Style x:Key="StyleTabControlNavigation"
TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="0,-72,0,0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<!-- DarthAffe 04.08.2017: The TabControl is a shitty one to style - if unused parts are removed it throws exceptions ... -->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel x:Name="HeaderPanel"
Grid.Row="0"
Grid.Column="0"
Margin="82,2,2,0"
Panel.ZIndex="1"
IsItemsHost="true"
KeyboardNavigation.TabIndex="1" />
<Border x:Name="ContentPanel"
Grid.Column="0"
Grid.Row="1"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local">
<controls:TransitionElement x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Transition="{StaticResource TransitionFade}"
Content="{TemplateBinding SelectedContent}" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter Property="Grid.Row" TargetName="HeaderPanel" Value="1" />
<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
<Setter Property="Margin" TargetName="HeaderPanel" Value="2,0,2,2" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0" />
<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="HeaderPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="ContentPanel" Value="1" />
<Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto" />
<Setter Property="Width" TargetName="ColumnDefinition1" Value="*" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="0" />
<Setter Property="Margin" TargetName="HeaderPanel" Value="2,2,0,2" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0" />
<Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="HeaderPanel" Value="1" />
<Setter Property="Grid.Column" TargetName="ContentPanel" Value="0" />
<Setter Property="Width" TargetName="ColumnDefinition0" Value="*" />
<Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="0" />
<Setter Property="Margin" TargetName="HeaderPanel" Value="0,2,2,2" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StyleTabItemNavigation"
BasedOn="{StaticResource StyleFrameworkElement}"
TargetType="{x:Type TabItem}">
<Setter Property="Height" Value="72" />
<Setter Property="FontSize" Value="{StaticResource FontSizeNavigation}" />
<Setter Property="FontFamily" Value="pack://application:,,,/Resources/#Cinzel Decorative" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Border Margin="8,0"
Padding="4"
IsHitTestVisible="True"
BorderThickness="0"
Background="Transparent">
<Grid>
<TextBlock x:Name="TxtBlurred"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontWeight="Black"
Opacity="0"
Foreground="{StaticResource BrushNavigationItemBlur}"
Text="{TemplateBinding Header}">
<TextBlock.Effect>
<BlurEffect Radius="{StaticResource DoubleNavigationBlurRadius}" />
</TextBlock.Effect>
</TextBlock>
<TextBlock VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="{StaticResource BrushNavigationItem}"
Text="{TemplateBinding Header}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<!--<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
<Setter Property="Margin" Value="80,0,0,0" />
</DataTrigger>-->
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:0.150" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.250" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.150" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.250" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource StyleTabItemNavigation}" TargetType="{x:Type TabItem}" />
</styles:CachedResourceDictionary>

View File

@ -2,12 +2,12 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:presentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"> xmlns:presentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">
<!-- ### Colors ### --> <!-- ### Colors ### -->
<Color x:Key="ColorTelegrey">#FFD0D0D0</Color> <Color x:Key="ColorTelegrey">#FFD0D0D0</Color>
<Color x:Key="ColorJetBlack">#111111</Color> <Color x:Key="ColorJetBlack">#111111</Color>
<Color x:Key="ColorJetBlackTransparent">#A0111111</Color> <Color x:Key="ColorJetBlackTransparent">#A0111111</Color>
<Color x:Key="ColorBlackTransparent">#50000000</Color> <Color x:Key="ColorBlackTransparent">#50000000</Color>
<Color x:Key="ColorBananaYellow">#FFE135</Color>
<!-- ### Brushes ### --> <!-- ### Brushes ### -->
<SolidColorBrush x:Key="BrushBackground" presentationOptions:Freeze="True" Color="{StaticResource ColorJetBlack}" /> <SolidColorBrush x:Key="BrushBackground" presentationOptions:Freeze="True" Color="{StaticResource ColorJetBlack}" />
@ -21,8 +21,17 @@
<SolidColorBrush x:Key="BrushTooltipBorder" presentationOptions:Freeze="True" Color="{StaticResource ColorJetBlack}" /> <SolidColorBrush x:Key="BrushTooltipBorder" presentationOptions:Freeze="True" Color="{StaticResource ColorJetBlack}" />
<SolidColorBrush x:Key="BrushTooltipBackground" presentationOptions:Freeze="True" Color="{StaticResource ColorJetBlackTransparent}" /> <SolidColorBrush x:Key="BrushTooltipBackground" presentationOptions:Freeze="True" Color="{StaticResource ColorJetBlackTransparent}" />
<!-- Navigation -->
<SolidColorBrush x:Key="BrushNavigationItem" presentationOptions:Freeze="True" Color="{StaticResource ColorTelegrey}" />
<SolidColorBrush x:Key="BrushNavigationItemBlur" presentationOptions:Freeze="True" Color="{StaticResource ColorBananaYellow}" />
<!-- ### Border'n'stuff ### -->
<sys:Double x:Key="DoubleNavigationBlurRadius">40</sys:Double>
<!-- ### Fonts ### --> <!-- ### Fonts ### -->
<sys:Double x:Key="FontSizeDefault">13</sys:Double> <sys:Double x:Key="FontSizeDefault">13</sys:Double>
<sys:Double x:Key="FontSizeTooltip">14</sys:Double> <sys:Double x:Key="FontSizeTooltip">14</sys:Double>
<sys:Double x:Key="FontSizeNavigation">28</sys:Double>
</ResourceDictionary> </ResourceDictionary>

View File

@ -5,16 +5,29 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="clr-namespace:KeyboardAudioVisualizer.UI" xmlns:ui="clr-namespace:KeyboardAudioVisualizer.UI"
xmlns:controls="clr-namespace:KeyboardAudioVisualizer.Controls" xmlns:controls="clr-namespace:KeyboardAudioVisualizer.Controls"
xmlns:styles="clr-namespace:KeyboardAudioVisualizer.Styles"
mc:Ignorable="d" mc:Ignorable="d"
Title="Keyboard Audio-Visualizer # Configuration" Title="Keyboard Audio-Visualizer # Configuration"
Icon="pack://application:,,,/KeyboardAudioVisualizer;component/Resources/Icon.ico" Icon="pack://application:,,,/KeyboardAudioVisualizer;component/Resources/Icon.ico"
IconCommand="{Binding OpenHomepageCommand}" IconCommand="{Binding OpenHomepageCommand}"
Width="1280" Height="720"> Width="1280" Height="720">
<controls:BlurredDecorationWindow.Resources>
<styles:CachedResourceDictionary Source="/KeyboardAudioVisualizer;component/Styles/Navigation.xaml" />
</controls:BlurredDecorationWindow.Resources>
<controls:BlurredDecorationWindow.DataContext> <controls:BlurredDecorationWindow.DataContext>
<ui:ConfigurationViewModel /> <ui:ConfigurationViewModel />
</controls:BlurredDecorationWindow.DataContext> </controls:BlurredDecorationWindow.DataContext>
<Grid></Grid> <TabControl Style="{StaticResource StyleTabControlNavigation}">
<TabItem Header="Primary">
<Border Background="Black"></Border>
</TabItem>
<TabItem Header="Secondary">
<Border Background="White"></Border>
</TabItem>
</TabControl>
</controls:BlurredDecorationWindow> </controls:BlurredDecorationWindow>

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<remove key="RGB.NET package source" />
<add key="RGB.NET package source" value="C:\Users\Darth Affe\Source\Repos\RGB.NET\NuGet" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>

BIN
libs/Transitionals.dll Normal file

Binary file not shown.