Skip to content

Commit

Permalink
add panel show/hide
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisniu committed Feb 28, 2016
1 parent 27f18fc commit 1457c74
Show file tree
Hide file tree
Showing 7 changed files with 337 additions and 80 deletions.
2 changes: 1 addition & 1 deletion Niv.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</Page>
<Compile Include="src\AnimationJar.cs" />
<Compile Include="src\ButtonAnimation.cs" />
<Compile Include="src\I18N.cs" />
<Compile Include="src\I18n.cs" />
<Compile Include="xaml\About.xaml.cs">
<DependentUpon>About.xaml</DependentUpon>
</Compile>
Expand Down
Binary file modified exe/Niv.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions prop/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
ResourceDictionaryLocation.SourceAssembly
)]

[assembly: AssemblyVersion("0.0.2.0")]
[assembly: AssemblyFileVersion("0.0.2.0")]
[assembly: AssemblyVersion("0.0.3.0")]
[assembly: AssemblyFileVersion("0.0.3.0")]
6 changes: 3 additions & 3 deletions src/ButtonAnimation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ class ThemeColors
private string theme;
private List<Border> appliedBorders = new List<Border>();

private double TIME_HOVER = 0.01;
private double TIME_HOVER = 0.1;
private double TIME_DOWN = 0.01;
private double TIME_UP = 0.3;
private double TIME_LEAVE = 0.4;
private double TIME_UP = 0.2;
private double TIME_LEAVE = 0.3;

private SolidColorBrush brush = new SolidColorBrush();

Expand Down
6 changes: 3 additions & 3 deletions src/I18N.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

namespace Niv
{
public class I18N
public class I18n
{
private static string cultureCode;
private static Dictionary<string, Dictionary<string, string>> langData = new Dictionary<string, Dictionary<string, string>>();

static I18N()
static I18n()
{
loadLangData();

Expand All @@ -24,7 +24,7 @@ static I18N()

// cultureCode = "en-US"; // test default
// cultureCode = "zh-TW"; // test none-english
// cultureCode = "zh-TW2"; // test not exist
// cultureCode = "zh-HK"; // test not exist

try
{
Expand Down
54 changes: 27 additions & 27 deletions xaml/Niv.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
Title="&lt;Niv&gt;" Height="350" Width="520" WindowStartupLocation="CenterScreen" WindowState="Maximized" Icon="/Niv;component/res/Niv.ico" Loaded="window_Loaded" Closing="window_Closing">
<Grid x:Name="niv" Background="#FF404040">

<Grid x:Name="container" Background="#FF202020" AllowDrop="True">
<Grid x:Name="container" Background="#FF202020" AllowDrop="True" SizeChanged="container_SizeChanged" MouseMove="container_MouseMove">
<Image x:Name="image" Margin="168,34,214.6,93.4" Stretch="Fill" RenderTransformOrigin="0.5,0.5" />
<Border x:Name="page" BorderBrush="Gray" BorderThickness="2" Margin="0,0,10,218" CornerRadius="0" Background="#FF404040" HorizontalAlignment="Right" Width="50" Height="32" VerticalAlignment="Bottom">
<Label x:Name="pageText" Content="0/0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="15" Foreground="#FFDEDEDE"/>
<Label x:Name="iPage" Content="0/0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="15" Foreground="#FFDEDEDE"/>
</Border>

</Grid>
Expand All @@ -33,7 +33,7 @@
<Image x:Name="imageNext" Margin="15" Source="/Niv;component/res/theme-dark/icon-next.png"/>
</Border>
</Grid>
<Border x:Name="btnAA" BorderBrush="#FF484848" BorderThickness="0" Height="48" VerticalAlignment="Top" Margin="0,0,96,0" HorizontalAlignment="Right" Width="48" MouseUp="btnAA_MouseUp">
<Border x:Name="btnSmooth" BorderBrush="#FF484848" BorderThickness="0" Height="48" VerticalAlignment="Top" Margin="0,0,96,0" HorizontalAlignment="Right" Width="48" MouseUp="btnSmooth_MouseUp">
<Image x:Name="imageSmooth" Margin="15" Source="/Niv;component/res/theme-dark/icon-smooth-off.png"/>
</Border>
<Border x:Name="btnZoom" BorderBrush="#FF484848" BorderThickness="0" Height="48" VerticalAlignment="Top" Margin="0,0,48,0" HorizontalAlignment="Right" Width="48" MouseUp="btnZoom_MouseUp">
Expand All @@ -43,41 +43,26 @@
<Image x:Name="imageMenu" Margin="15" Source="/Niv;component/res/theme-dark/icon-menu.png"/>
</Border>
</Grid>
<Grid x:Name="info" HorizontalAlignment="Left" Width="200" Background="#FF404040" Margin="10,10,0,57">
<Label x:Name="iImageInfo" Content="&lt;Image Info&gt;" Foreground="#FFDEDEDE" FontSize="18" VerticalContentAlignment="Center" Margin="0,0,58,0" Height="48" VerticalAlignment="Top" Padding="14,5,5,5"/>
<Border x:Name="btnCloseInfo" BorderBrush="#FF484848" BorderThickness="0" Height="48" VerticalAlignment="Top" HorizontalAlignment="Right" Width="48">
<Image Margin="15" Source="/Niv;component/res/theme-dark/icon-close.png"/>
</Border>
<Rectangle Fill="#FFF4F4F5" Height="2" Margin="0,48,0,0" Stroke="Gray" VerticalAlignment="Top"/>
<Label x:Name="iFilename" Content="&lt;Filename&gt;" HorizontalAlignment="Left" Margin="10,60,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoFilename" Content="-" Margin="10,84,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
<Label x:Name="iSize" Content="&lt;Size&gt;" HorizontalAlignment="Left" Margin="10,120,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoSize" Content="-" Margin="10,144,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
<Label x:Name="iResolution" Content="&lt;Rolution&gt;" HorizontalAlignment="Left" Margin="10,180,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoResolution" Content="-" Margin="10,204,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
<Label x:Name="iDate" Content="&lt;Date&gt;" HorizontalAlignment="Left" Margin="10,240,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoDate" Content="-" Margin="10,264,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
</Grid>
<Border x:Name="menu" BorderBrush="#FF404040" BorderThickness="2,2,2,0" Margin="0,0,10,57" HorizontalAlignment="Right" Width="196" Height="154" VerticalAlignment="Bottom" Background="Black">
<Border x:Name="menu" BorderBrush="#BF404040" BorderThickness="2,2,2,0" Margin="0,0,10,57" HorizontalAlignment="Right" Width="196" Height="154" VerticalAlignment="Bottom" Background="Black">
<StackPanel x:Name="menuStack">
<Rectangle Fill="White" Stroke="#FF404040" Height="0" Margin="0,0,0,8"/>
<Border x:Name="menuHelp" BorderBrush="Black" BorderThickness="0" Height="40">
<Grid Margin="0">
<Image HorizontalAlignment="Left" Margin="15,11,0,11" Width="18" Source="/Niv;component/res/theme-dark/icon-about.png"/>
<Label x:Name="iHelp" Content="&lt;Help&gt;" Margin="40,6,10,6" VerticalContentAlignment="Center" Foreground="#FFC1C1C1" FontSize="15"/>
<Image x:Name="imageHelp" HorizontalAlignment="Left" Margin="15,11,0,11" Width="18" Source="/Niv;component/res/theme-dark/icon-about.png"/>
<Label x:Name="iHelp" Content="&lt;Help&gt;" Margin="40,4,10,4" VerticalContentAlignment="Center" Foreground="Silver" FontSize="15"/>
</Grid>
</Border>
<Border x:Name="menuAbout" BorderBrush="Black" BorderThickness="0" Height="40" MouseUp="menuAbout_MouseUp">
<Grid Margin="0">
<Image HorizontalAlignment="Left" Margin="15,11,0,11" Width="18" Source="/Niv;component/res/theme-dark/icon-about.png"/>
<Label x:Name="iAbout" Content="&lt;About&gt;" Margin="40,6,10,6" VerticalContentAlignment="Center" Foreground="#FFC1C1C1" FontSize="15"/>
<Image x:Name="imageAbout" HorizontalAlignment="Left" Margin="15,11,0,11" Width="18" Source="/Niv;component/res/theme-dark/icon-about.png"/>
<Label x:Name="iAbout" Content="&lt;About&gt;" Margin="40,4,10,4" VerticalContentAlignment="Center" Foreground="Silver" FontSize="15"/>
</Grid>
</Border>
<Rectangle Fill="White" Stroke="#FF404040" Height="1" Margin="0,8"/>
<Border x:Name="menuInfo" BorderBrush="Black" BorderThickness="0" Height="40">
<Rectangle x:Name="menuLine" Fill="White" Stroke="#FF404040" Height="1" Margin="0,8"/>
<Border x:Name="menuInfo" BorderBrush="Black" BorderThickness="0" Height="40" MouseUp="menuInfo_MouseUp">
<Grid Margin="0">
<Image HorizontalAlignment="Left" Margin="15,11,0,11" Width="18" Source="/Niv;component/res/theme-dark/icon-list.png"/>
<Label x:Name="iImageInfoMenu" Content="&lt;Image Info&gt;" Margin="40,6,10,6" VerticalContentAlignment="Center" Foreground="#FFC1C1C1" FontSize="15"/>
<Image x:Name="imageInfo" HorizontalAlignment="Left" Margin="15,11,0,11" Width="18" Source="/Niv;component/res/theme-dark/icon-list.png"/>
<Label x:Name="iImageInfo" Content="&lt;Image Info&gt;" Margin="40,4,10,4" VerticalContentAlignment="Center" Foreground="Silver" FontSize="15"/>
</Grid>
</Border>
<Rectangle Fill="White" Stroke="#FF404040" Height="0" Margin="0,0,0,8"/>
Expand All @@ -88,5 +73,20 @@
<Border x:Name="exitButton" BorderBrush="#FF484848" BorderThickness="0" Height="48" VerticalAlignment="Top" HorizontalAlignment="Right" Width="48" Margin="0">
<Image Margin="15" Source="/Niv;component/res/theme-dark/icon-close.png"/>
</Border>
<Grid x:Name="info" HorizontalAlignment="Left" Width="200" Background="#FF404040" Margin="10,10,0,57">
<Label x:Name="iImageInfoTitle" Content="&lt;Image Info&gt;" Foreground="#FFDEDEDE" FontSize="18" VerticalContentAlignment="Center" Margin="0,0,48,0" Height="48" VerticalAlignment="Top" Padding="14,5,5,5"/>
<Border x:Name="btnCloseInfo" BorderBrush="#FF484848" BorderThickness="0" Height="48" VerticalAlignment="Top" HorizontalAlignment="Right" Width="48" MouseUp="btnCloseInfo_MouseUp">
<Image x:Name="imageCloseInfo" Margin="15" Source="/Niv;component/res/theme-dark/icon-close.png"/>
</Border>
<Rectangle Fill="#FFF4F4F5" Height="2" Margin="0,48,0,0" Stroke="Gray" VerticalAlignment="Top"/>
<Label x:Name="iFilename" Content="&lt;Filename&gt;" HorizontalAlignment="Left" Margin="10,60,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoFilename" Content="-" Margin="10,84,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
<Label x:Name="iSize" Content="&lt;Size&gt;" HorizontalAlignment="Left" Margin="10,120,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoSize" Content="-" Margin="10,144,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
<Label x:Name="iResolution" Content="&lt;Rolution&gt;" HorizontalAlignment="Left" Margin="10,180,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoResolution" Content="-" Margin="10,204,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
<Label x:Name="iDate" Content="&lt;Date&gt;" HorizontalAlignment="Left" Margin="10,240,0,0" VerticalAlignment="Top" Foreground="Silver" FontSize="14" VerticalContentAlignment="Center" Height="28"/>
<Label x:Name="labelInfoDate" Content="-" Margin="10,264,10,0" VerticalAlignment="Top" FontSize="14" Foreground="White"/>
</Grid>
</Grid>
</Window>
Loading

0 comments on commit 1457c74

Please sign in to comment.