Skip to content

Commit

Permalink
found big issue.... more tomorrow.
Browse files Browse the repository at this point in the history
  • Loading branch information
LoneWandererProductions committed Nov 25, 2024
1 parent dd30218 commit 937cec8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
8 changes: 4 additions & 4 deletions SlimViewer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<Button Content="Clean" Command="{Binding CleanTempFolder}" Grid.Column="2" />
</Grid>
<Separator />
<CheckBox IsChecked="{Binding ElementName=ImageZoom, Path=AutoplayGifImage}">Autoplay Gif</CheckBox>
<CheckBox IsChecked="{Binding ElementName=ImageControl, Path=AutoplayGifImage}">Autoplay Gif</CheckBox>
</MenuItem>
<MenuItem Header="Experimental">
<MenuItem Header="Open Cif" Command="{Binding OpenCommandCif}" />
Expand All @@ -312,7 +312,7 @@
<ContentControl Grid.Row="0" Grid.Column="8" Content="{Binding SelectedTool}"
ContentTemplateSelector="{DynamicResource ToolOptionsTemplateSelector}"
Grid.RowSpan="4" />
<Slider Minimum="0.1" Maximum="5.0" Value="{Binding ZoomScale, ElementName=ImageZoom, Mode=TwoWay}"
<Slider Minimum="0.1" Maximum="5.0" Value="{Binding ZoomScale, ElementName=ImageControl, Mode=TwoWay}"
Grid.Row="2" Grid.Column="2" IsEnabled="{Binding Path =IsActive}" />

</Grid>
Expand All @@ -330,8 +330,8 @@
IsTabStop="True"
ItemsSource="{Binding Bmp}"
ImageGifPath="{Binding GifPath}"
Name="ImageZoom"
SelectionTool="{Binding ImageZoomTool, Mode=TwoWay}"
x:Name="ImageControl"
SelectionTool="{Binding ImageZoomTool}"
SelectedFrameCommand="{Binding SelectedFrameCommand}"
SelectedPointCommand="{Binding SelectedPointCommand}" />
</Grid>
Expand Down
5 changes: 3 additions & 2 deletions SlimViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ private void Window_Loaded(object sender, RoutedEventArgs e)

SlimViewerRegister.SetRegister(obj);

//TODO rework and set:
View = new ImageView(obj.MainSubFolders, obj.MainCompressCif, obj.MainSimilarity,
obj.MainAutoClean) { Main = this, Thumb = Thumbnail, Picker = ColorPick, ImageZoom = ImageZoom };
obj.MainAutoClean, ImageControl) { Main = this, Thumb = Thumbnail, Picker = ColorPick };

DataContext = View;

ImageZoom.AutoplayGifImage = obj.MainAutoPlayGif;
ImageControl.AutoplayGifImage = obj.MainAutoPlayGif;
}

/// <summary>
Expand Down
11 changes: 7 additions & 4 deletions SlimViews/ImageView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,12 +453,14 @@ public ImageView()
/// <param name="compressCif">if set to <c>true</c> [compress cif].</param>
/// <param name="similarity">The similarity.</param>
/// <param name="autoClean">if set to <c>true</c> [automatic clean].</param>
public ImageView(bool subFolders, bool compressCif, int similarity, bool autoClean)
/// <param name="imageZoom"></param>
public ImageView(bool subFolders, bool compressCif, int similarity, bool autoClean, ImageZoom imageZoom)
{
SubFolders = subFolders;
Compress = compressCif;
Similarity = similarity;
AutoClean = autoClean;
ImageZoomControl = imageZoom;

Initialize();
}
Expand Down Expand Up @@ -1273,7 +1275,7 @@ public ImageZoomTools ImageZoomTool
/// <value>
/// The image zoom.
/// </value>
public ImageZoom ImageZoom { get; init; }
public ImageZoom ImageZoomControl { get; set; }

/// <summary>
/// Initializes this instance.
Expand Down Expand Up @@ -1301,6 +1303,7 @@ private void Initialize()
{ Key.Right, NextCommand }
};


PropertyChanged += OnPropertyChanged;
}

Expand Down Expand Up @@ -1339,7 +1342,7 @@ private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)
CurrentFilter = Translator.GetFilterFromString(SelectedFilter);
break;
case nameof(SelectedToolType):
ImageZoomTool = Translator.GetToolsFromString(SelectedToolType);
if (ImageZoomControl != null) ImageZoomControl.SelectionTool = Translator.GetToolsFromString(SelectedToolType);
break;
}
}
Expand Down Expand Up @@ -1436,7 +1439,7 @@ private void ColorChangedAction(ColorHsv colorHsv)
private void CloseAction(object obj)
{
var config = SlimViewerRegister.GetRegister();
config.MainAutoPlayGif = ImageZoom.AutoplayGifImage;
config.MainAutoPlayGif = ImageZoomControl.AutoplayGifImage;

Config.SetConfig(config);
if (AutoClean) CleanTempAction(true);
Expand Down

0 comments on commit 937cec8

Please sign in to comment.