Skip to content

Commit

Permalink
Reimplemented ability to disable images. this closes #28.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamcooled committed Aug 31, 2015
1 parent 30ed88c commit 36105ed
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
16 changes: 8 additions & 8 deletions SjUpdater/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@
</Grid.RowDefinitions>
<Label Grid.Row="0" VerticalAlignment="Center" Content="{Binding Title}" Padding="5,0" FontSize="15px" FontWeight="DemiBold"/>

<Image Grid.Row="1" Source="{Binding Background.ImageSource}" Stretch="UniformToFill" Opacity="0.85" />
<Image Grid.Row="1" Source="{Binding Background.ImageSource}" Stretch="UniformToFill" Opacity="0.85" Visibility="{Binding BackgroundImageVisibility}" />
<controls:ProgressRing Grid.Row="1" Margin="25,0,25,0" Visibility="{Binding IsLoadingVisible}" Foreground="White"/>

<Grid Grid.Row="1">
<Grid.Style>
<Style TargetType="{x:Type Grid}">
<Style.Setters>
<Setter Property="Visibility" Value="Collapsed"/>
<Setter Property="Visibility" Value="{Binding OverlayDefaultVisibility}"/>
</Style.Setters>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Grid}, Path=IsMouseOver}" Value="True">
Expand Down Expand Up @@ -293,7 +293,7 @@
</Style>
</Grid.Style>
<Rectangle Fill="{DynamicResource WhiteBrush}" Opacity="0.8" Height="18pt" />
<TextBlock Text="{Binding BottomText}" VerticalAlignment="Center" TextTrimming="WordEllipsis" Padding="5,0" />
<TextBlock Text="{Binding BottomText}" VerticalAlignment="Center" Foreground="{DynamicResource BlackColorBrush}" TextTrimming="WordEllipsis" Padding="5,0" />
</Grid>
</Grid>
</controls:Tile>
Expand Down Expand Up @@ -584,7 +584,7 @@
<RowDefinition Height="Auto" /> <!--- button and header-->
<RowDefinition Height="*"/> <!--- list-->
</Grid.RowDefinitions>
<Image Source="{Binding Cover.ImageSource}" VerticalAlignment="Top" Stretch="Uniform" />
<Image Source="{Binding Cover.ImageSource}" VerticalAlignment="Top" Stretch="Uniform" Visibility="{Binding SeasonImageVisibility}"/>

<ScrollViewer Margin="10" Grid.Row="1" VerticalScrollBarVisibility="Visible">
<TextBlock TextWrapping="Wrap" Text="{Binding Description}"/>
Expand Down Expand Up @@ -701,10 +701,10 @@
</Rectangle.OpacityMask>
</Rectangle>
</Grid>



<Image Grid.Row="1" Margin="10,5" Source="{Binding Photo.ImageSource}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Stretch="Uniform" />


<Image Grid.Row="1" Margin="10,5" Source="{Binding Photo.ImageSource}" HorizontalAlignment="Stretch" VerticalAlignment="Top" Stretch="Uniform" Visibility="{Binding EpisodeImageVisibility}" />


<StackPanel Orientation="Horizontal" Grid.Column="0" Grid.Row="2" VerticalAlignment="Top" Margin="10,5,0,5">
Expand Down Expand Up @@ -888,7 +888,7 @@
<CheckBox Content="Mark 'German Subbed' Episodes as German" Margin="0,2"
IsChecked="{Binding MarkSubbedAsGerman}" />

<!--<CheckBox Content="Enable Images" IsChecked="{Binding EnableImages}" Margin="0,2" />-->
<CheckBox Content="Enable Images" IsChecked="{Binding EnableImages}" Margin="0,2" />

<CheckBox Content="Enable Favorizing of Uploads" IsChecked="{Binding UseFavorites}" Margin="0,2" />

Expand Down
2 changes: 2 additions & 0 deletions SjUpdater/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ private void FilterFlyout_OnIsOpenChanged(object sender, EventArgs e)
{
var vm = FilterFlyout.DataContext as ShowViewModel;
vm.Show.ApplyFilter(true,false);
var firstSeason = vm.Seasons.FirstOrDefault();
if (firstSeason != null) firstSeason.IsExpanded = true;
Stats.TrackAction(Stats.TrackActivity.Filter);
}

Expand Down
1 change: 1 addition & 0 deletions SjUpdater/ViewModel/EpisodeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ void favEpisodeData_PropertyChanged(object sender, System.ComponentModel.Propert

public FavEpisodeData Episode => _favEpisodeData;

public Visibility EpisodeImageVisibility => Settings.Instance.EnableImages ? Visibility.Visible : Visibility.Collapsed;

public CachedBitmap Photo
{
Expand Down
13 changes: 10 additions & 3 deletions SjUpdater/ViewModel/ShowTileViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,14 @@ public String BottomText

public Visibility BottomVisible
{
get { return _bottomVisible;}
get { return _bottomVisible; }
set
{
_bottomVisible = value;
OnPropertyChanged();
if (Settings.Instance.EnableImages)
{
_bottomVisible = value;
OnPropertyChanged();
}
}
}

Expand Down Expand Up @@ -313,5 +316,9 @@ private set
OnPropertyChanged();
}
}

public Visibility BackgroundImageVisibility => Settings.Instance.EnableImages? Visibility.Visible : Visibility.Collapsed;
public Visibility OverlayDefaultVisibility => Settings.Instance.EnableImages? Visibility.Collapsed : Visibility.Visible;

}
}
22 changes: 6 additions & 16 deletions SjUpdater/ViewModel/ShowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,11 @@ private void UpdateNonSeasons(object sender, NotifyCollectionChangedEventArgs e)
}


public ObservableCollection<SeasonViewModel> Seasons
{
get { return _lisSeasons; }
}
public ObservableCollection<SeasonViewModel> Seasons => _lisSeasons;

public ObservableCollection<DownloadData> NonSeasons => _lisNonSeasons;

public ObservableCollection<DownloadData> NonSeasons {
get { return _lisNonSeasons; }
}

public String Title
{
get
{
return _show.Name;
}
}
public String Title => _show.Name;

public CachedBitmap Cover
{
Expand All @@ -241,6 +229,8 @@ private set
}
}

public Visibility SeasonImageVisibility => Settings.Instance.EnableImages ? Visibility.Visible : Visibility.Collapsed;

public String Description
{
get { return _description; }
Expand Down Expand Up @@ -328,7 +318,7 @@ public String FilterHoster



public FavShowData Show { get { return _show; } }
public FavShowData Show => _show;

public ICommand UnmarkAllCommand { get; private set; }
public ICommand MarkAllDownloadedCommand { get; private set; }
Expand Down

0 comments on commit 36105ed

Please sign in to comment.