-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 70c5a58
Showing
17 changed files
with
1,375 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto | ||
|
||
# Custom for Visual Studio | ||
*.cs diff=csharp | ||
*.sln merge=union | ||
*.csproj merge=union | ||
*.vbproj merge=union | ||
*.fsproj merge=union | ||
*.dbproj merge=union | ||
|
||
# Standard to msysgit | ||
*.doc diff=astextplain | ||
*.DOC diff=astextplain | ||
*.docx diff=astextplain | ||
*.DOCX diff=astextplain | ||
*.dot diff=astextplain | ||
*.DOT diff=astextplain | ||
*.pdf diff=astextplain | ||
*.PDF diff=astextplain | ||
*.rtf diff=astextplain | ||
*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Directories # | ||
############### | ||
Generated/ | ||
obj/ | ||
bin/ | ||
ClientBin/ | ||
x64/ | ||
ipch/ | ||
[Rr]elease*/ | ||
[Dd]ebug*/ | ||
[Tt]est[Rr]esult* | ||
_ReSharper* | ||
*.bak | ||
*.user | ||
*.opensdf | ||
*.sdf | ||
*.suo | ||
*.sublime-project | ||
*.log | ||
*.sqlite | ||
*.vsmdi | ||
*.tmp_proj | ||
|
||
NDependOut/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | ||
</startup> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<Application x:Class="SubtitlesRunner.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
StartupUri="MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Configuration; | ||
using System.Data; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
|
||
namespace SubtitlesRunner | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<Window x:Class="SubtitlesRunner.MainWindow" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:subtitlesRunner="clr-namespace:SubtitlesRunner" | ||
Title="MainWindow" | ||
WindowStyle="None" | ||
WindowState="Maximized" | ||
AllowsTransparency="True" | ||
Background="Transparent" | ||
Topmost="True" | ||
x:Name="Root" | ||
mc:Ignorable="d" | ||
d:DataContext="{d:DesignInstance subtitlesRunner:MainWindowModel}"> | ||
<Grid> | ||
<Grid.Margin> | ||
<MultiBinding Converter="{subtitlesRunner:WindowTopConverter}"> | ||
<Binding Path="WindowTop" /> | ||
<Binding Path="ActualHeight" ElementName="Root" /> | ||
<Binding Path="ActualHeight" ElementName="ButtonsGrid" /> | ||
<Binding Path="ActualHeight" ElementName="TitlesGrid" /> | ||
</MultiBinding> | ||
</Grid.Margin> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
</Grid.ColumnDefinitions> | ||
<Button Grid.Column="0" | ||
x:Name="MoveGrip" /> | ||
<Grid Grid.Column="1" | ||
HorizontalAlignment="Stretch"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto" /> | ||
<RowDefinition Height="Auto" /> | ||
</Grid.RowDefinitions> | ||
<Grid Grid.Row="0" | ||
x:Name="ButtonsGrid"> | ||
<Grid.Resources> | ||
<Style TargetType="{x:Type Button}"> | ||
<Setter Property="Height" Value="30" /> | ||
<Setter Property="Margin" Value="10 0" /> | ||
</Style> | ||
</Grid.Resources> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="Auto" /> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
<StackPanel Grid.Column="0" | ||
Orientation="Horizontal" | ||
HorizontalAlignment="Stretch"> | ||
<Button Content="Open..." /> | ||
<Button Content="Play" /> | ||
<Button Content="Stop" /> | ||
</StackPanel> | ||
<Slider Grid.Column="1" | ||
HorizontalAlignment="Stretch" /> | ||
<StackPanel Orientation="Horizontal" | ||
Grid.Column="2"> | ||
<Button Content="Restore" HorizontalAlignment="Right" /> | ||
<Button Content="Close" | ||
HorizontalAlignment="Stretch" | ||
IsCancel="True" | ||
Click="OnCancel" /> | ||
</StackPanel> | ||
</Grid> | ||
<Grid MinHeight="100" | ||
x:Name="TitlesGrid" | ||
Grid.Row="1" | ||
HorizontalAlignment="Stretch"> | ||
<Grid.Style> | ||
<Style TargetType="{x:Type Grid}"> | ||
<Setter Property="Background" Value="#01010101" /> | ||
<Style.Triggers> | ||
<Trigger Property="IsMouseOver" Value="True"> | ||
<Setter Property="Background" Value="LightCyan" /> | ||
</Trigger> | ||
</Style.Triggers> | ||
</Style> | ||
</Grid.Style> | ||
<TextBlock VerticalAlignment="Center" | ||
HorizontalAlignment="Stretch" | ||
TextAlignment="Center" | ||
FontSize="60" | ||
Foreground="Blue" | ||
Text="{Binding CurrentSubtitle}" /> | ||
</Grid> | ||
</Grid> | ||
</Grid> | ||
</Window> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Windows; | ||
|
||
namespace SubtitlesRunner | ||
{ | ||
public partial class MainWindow | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
DataContext = new MainWindowModel(Height); | ||
} | ||
|
||
private void OnCancel(object sender, RoutedEventArgs e) | ||
{ | ||
Close(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
using SubtitlesRunner.Annotations; | ||
|
||
namespace SubtitlesRunner | ||
{ | ||
public class MainWindowModel : INotifyPropertyChanged | ||
{ | ||
public MainWindowModel(double windowHeight) | ||
{ | ||
CurrentSubtitle = "This is...\n...just a test"; | ||
WindowTop = windowHeight - 100; | ||
} | ||
|
||
private string _currentSubtitle; | ||
|
||
public string CurrentSubtitle | ||
{ | ||
get { return _currentSubtitle; } | ||
set | ||
{ | ||
if (value == _currentSubtitle) return; | ||
_currentSubtitle = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
private double _windowTop; | ||
|
||
public double WindowTop | ||
{ | ||
get { return _windowTop; } | ||
set | ||
{ | ||
if (value.Equals(_windowTop)) return; | ||
_windowTop = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
|
||
public event PropertyChangedEventHandler PropertyChanged; | ||
|
||
[NotifyPropertyChangedInvocator] | ||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) | ||
{ | ||
var handler = PropertyChanged; | ||
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
} | ||
} |
Oops, something went wrong.