Skip to content

Commit

Permalink
Updates to some styles, and adding support for accessor keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Ginnivan committed Oct 20, 2011
1 parent 8802abf commit 8e6e24e
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 24 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Expand Up @@ -36,9 +36,6 @@ _ReSharper*/
*.resharper
[Tt]est[Rr]esult*

#Project files
[Bb]uild/

#Subversion files
.svn

Expand Down
2 changes: 2 additions & 0 deletions Build/.gitignore
@@ -0,0 +1,2 @@
*.nupkg
lib
11 changes: 11 additions & 0 deletions Build/Build.cmd
@@ -0,0 +1,11 @@
@echo on
call "%VS100COMNTOOLS%vsvars32.bat"
mkdir log\
mkdir lib\net40\

msbuild.exe /ToolsVersion:4.0 "..\MahApps.Metro\MahApps.Metro.csproj" /p:OutDir=%~dp0lib\net40\
msbuild.exe /ToolsVersion:4.0 "..\MahApps.Metro.Controls\MahApps.Metro.Controls.csproj" /p:OutDir=%~dp0lib\net40\
msbuild.exe /ToolsVersion:4.0 "..\MahApps.Metro.Icons\MahApps.Metro.Icons.csproj" /p:OutDir=%~dp0lib\net40\

..\Utilities\NuGet.exe pack ..\MahApps.Metro.nuspec -BasePath "%~dp0\"
pause
6 changes: 6 additions & 0 deletions MahApps.Metro.Controls/MetroContentControl.cs
Expand Up @@ -35,5 +35,11 @@ private void MetroContentControlLoaded(object sender, RoutedEventArgs e)
{
VisualStateManager.GoToState(this, "AfterLoaded", true);
}

public void Reload()
{
VisualStateManager.GoToState(this, "BeforeLoaded", true);
VisualStateManager.GoToState(this, "AfterLoaded", true);
}
}
}
18 changes: 18 additions & 0 deletions MahApps.Metro.Icons/MergedResources.xaml
Expand Up @@ -246,4 +246,22 @@ http://templarian.com/ admin@templarian.com
<Canvas x:Name="appbar_camera_film" Width="48" Height="48" Clip="F1 M 0,0L 48,0L 48,48L 0,48L 0,0" x:Key="appbar_camera_film">
<Path Width="24" Height="19" Canvas.Left="12" Canvas.Top="14" Stretch="Fill" Fill="{DynamicResource BlackBrush}" Data="F1 M 12,22L 14,22L 14,27L 12,27L 12,22 Z M 14.5,21.5L 31.25,21.5L 31.25,24L 32,24L 36,20L 36,33L 32,29L 31.25,29L 31.25,33L 14.5,33L 14.5,21.5 Z M 18.5,14C 20.433,14 22,15.567 22,17.5C 22,19.433 20.433,21 18.5,21C 16.567,21 15,19.433 15,17.5C 15,15.567 16.567,14 18.5,14 Z M 26.5,14C 28.433,14 30,15.567 30,17.5C 30,19.433 28.433,21 26.5,21C 24.567,21 23,19.433 23,17.5C 23,15.567 24.567,14 26.5,14 Z " />
</Canvas>
<Canvas x:Key="appbar_left"
Width="48"
Height="48"
Clip="F1 M 0,0L 48,0L 48,48L 0,48L 0,0">
<Canvas Width="48"
Height="48"
Canvas.Left="0"
Canvas.Top="0">
<Path Width="25"
Height="18"
Canvas.Left="11"
Canvas.Top="15"
Stretch="Fill"
Fill="#FF000000"
Data="F1 M 36,22L 36,26L 19.75,26L 27,33L 20.5,33L 11,24L 20.5,15L 27,15L 19.75,22L 36,22 Z " />
</Canvas>
</Canvas>

</ResourceDictionary>
3 changes: 2 additions & 1 deletion MahApps.Metro.nuspec
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MahApps.Metro</id>
<version>0.2</version>
<version>0.25</version>
<title>MahApps.Metro</title>
<authors>Paul Jenkins</authors>
<owners />
Expand All @@ -15,6 +15,7 @@
</metadata>
<files>
<file src="lib\net40\MahApps.Metro.Controls.dll" target="lib\net40\MahApps.Metro.Controls.dll" />
<file src="lib\net40\MahApps.Metro.Icons.dll" target="lib\net40\MahApps.Metro.Icons.dll" />
<file src="lib\net40\MahApps.Metro.dll" target="lib\net40\MahApps.Metro.dll" />
<file src="lib\net40\System.Windows.Interactivity.dll" target="lib\net40\System.Windows.Interactivity.dll" />
</files>
Expand Down
42 changes: 27 additions & 15 deletions MahApps.Metro/Styles/Controls.xaml
Expand Up @@ -1405,7 +1405,7 @@
IsHitTestVisible="false"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</ControlTemplate>
</Setter.Value>
Expand Down Expand Up @@ -2156,6 +2156,13 @@
<Setter Property="Foreground" Value="{DynamicResource TextBrush}"/>
</Style>

<Style TargetType="{x:Type TabControl}">
<Setter Property="Background"
Value="{x:Null}" />
<Setter Property="BorderBrush"
Value="{x:Null}" />
</Style>

<Style TargetType="TabItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="IsTabStop" Value="False"/>
Expand All @@ -2165,25 +2172,31 @@
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="MinWidth" Value="5"/>
<Setter Property="MinHeight" Value="5"/>
<Setter Property="Background"
Value="White" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Grid x:Name="root" Height="36" Margin="0,0,15,0">
<TextBlock x:Name="unselected" Margin="0" TextWrapping="Wrap" Text="{TemplateBinding Header}" FontSize="26.667">
<TextBlock.Foreground>
<Grid x:Name="root" Margin="0,0,15,0">
<Label x:Name="unselected" Margin="0" Content="{TemplateBinding Header}" FontSize="26.667">
<Label.Foreground>
<SolidColorBrush Color="{DynamicResource Gray11}" />
</TextBlock.Foreground>
</TextBlock>
<TextBlock x:Name="selected" Margin="0" TextWrapping="Wrap" Text="{TemplateBinding Header}" FontSize="26.667" Opacity="0">
<TextBlock.Foreground>
</Label.Foreground>
</Label>
<Label x:Name="selected"
Margin="0"
Content="{TemplateBinding Header}" FontSize="26.667" Opacity="0">
<Label.Foreground>
<SolidColorBrush Color="{DynamicResource AccentColor}" />
</TextBlock.Foreground>
</TextBlock>
<TextBlock x:Name="hover" Margin="0" TextWrapping="Wrap" Text="{TemplateBinding Header}" FontSize="26.667" Opacity="0">
<TextBlock.Foreground>
</Label.Foreground>
</Label>
<Label x:Name="hover"
Margin="0"
Content="{TemplateBinding Header}" FontSize="26.667" Opacity="0">
<Label.Foreground>
<SolidColorBrush Color="{DynamicResource Gray3}" />
</TextBlock.Foreground>
</TextBlock>
</Label.Foreground>
</Label>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
Expand All @@ -2205,6 +2218,5 @@
</ControlTemplate>
</Setter.Value>
</Setter>

</Style>
</ResourceDictionary>
15 changes: 10 additions & 5 deletions MetroDemo/MainWindow.xaml
Expand Up @@ -102,9 +102,9 @@
</Button>
</StackPanel>
</Grid>
<TabControl Margin="0,40,0,0" Background="{x:Null}" BorderBrush="{x:Null}">
<TabItem Header="First set of controls">

<TabControl Margin="0,40,0,0">
<TabItem Header="_First set of controls">
<Controls:MetroContentControl x:Name="metroContent">
<Grid>
<Grid Margin="0,0,226.999,8">
<Button Content="Right Click Me" Click="Button_Click" Height="30" ToolTip="This is a tooltip" Margin="88.694,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="154.002">
Expand Down Expand Up @@ -140,7 +140,11 @@
<Label Content="Combobox" VerticalAlignment="Top" Margin="16.224,170.84,0,0" HorizontalAlignment="Left"/>
<RadioButton Content="Radio Button 2" Margin="88.695,155.88,0,0" VerticalAlignment="Top" GroupName="test" HorizontalAlignment="Left" />
<Label Content="Progress Bar" VerticalAlignment="Top" Margin="8.216,206.8,0,0" HorizontalAlignment="Left" d:LayoutOverrides="HorizontalAlignment"/>
<Button Content="Launch Panorama" Click="BtnPanoramaClick" VerticalAlignment="Top" Margin="88.696,234,89.305,0"/>
<Button Content="Launch Panorama"
Click="BtnPanoramaClick"
VerticalAlignment="Top"
Margin="88.696,234,89.305,0" />
<Button Content="Reload Content" Click="Reload" VerticalAlignment="Top" Margin="88.696,270,89.305,0"/>
</Grid>
<StackPanel Margin="332.001,0,0,8">
<Button Style="{DynamicResource MetroCircleButtonStyle}" Height="55" Width="55" HorizontalAlignment="Left" VerticalAlignment="Top">
Expand Down Expand Up @@ -186,8 +190,9 @@
</StackPanel>
<!--<Slider Height="23" HorizontalAlignment="Left" Margin="273,119,0,0" Name="slider1" VerticalAlignment="Top" Width="218" Maximum="100" Value="50" />-->
</Grid>
</Controls:MetroContentControl>
</TabItem>
<TabItem Header="More Controls Here!">
<TabItem Header="_More Controls Here!">
<StackPanel>
<Controls:ProgressIndicator ProgressColour="{StaticResource AccentColorBrush}" Height="6" Width="600" />
<Controls:ToggleSwitch HorizontalAlignment="Left" Margin="0,10,0,0" />
Expand Down
5 changes: 5 additions & 0 deletions MetroDemo/MainWindow.xaml.cs
Expand Up @@ -161,5 +161,10 @@ private void BtnPanoramaClick(object sender, RoutedEventArgs e)
{
new PanoramaDemo().Show();
}

private void Reload(object sender, RoutedEventArgs e)
{
metroContent.Reload();
}
}
}
Binary file added Utilities/NuGet.exe
Binary file not shown.

0 comments on commit 8e6e24e

Please sign in to comment.